phpinstagramweb-search

Get Instagram public profile data with web search


I try to retrieve some public profile data from instagram without take a use of the API. I already used file_get_contents and extract the _sharedData. But this method slow down the performance extremly (5 Seconds to load) so for production it is nonesense.

I've seen in one stackoverflow question, that they called http://instagram.com/web/search/topsearch/?query=user_id to access at least the number of followers. But there are no further details.

Is there any documentation about this web search or some solution to access public profile data with instagrams web search? I need at least the counts for media, followers and followed-by.


Solution

  • You can add ?__a=1 to the url and get json only:

    https://www.instagram.com/facebook/?__a=1
    

    It contains public profile data which you've mentioned:

    user:
        follows:
            count
        followed_by:
            count
        media:
            count
    

    It tooks about 280ms for me.