The inquiry to the social media platform was made with reference to threats to security and public order in the country.
Ekrem Imamoglu is seen in Turkey as the greatest rival to President Recep Tayyip Erdogan. He was arrested for corruption allegations on March 19 and has been imprisoned since then. Imamoglu denies all allegations.
Despite imprisonment, Imamoglu has remained active on social media. His X-account, with 9.7 million followers, can still be accessed in the rest of the world, but for Turkish users, it states that the account has been blocked in response to a legal requirement.
A number of major demonstrations have been held in support of the mayor since the arrest. On Wednesday evening, the largest demonstration in several weeks was held with tens of thousands of people present.