Search code examples
htmlapiinstagramanalyticsinstagram-api

Instagram Analyze via API or something else


for a master thesis I need to analyze several Instagram profiles with more than 1000 posts each.

I need a list of the following things: Post Type (Image, Multi Image, Video) description Likes Comments (count)

Is there a way to do this with the Instagram Api or do you have another idea how this can work?

Thank you so much Torben


Solution

  • Sorry. Not easily possible. Facebook has disabled this feature. What parts of this that still work will likely be disabled. You could try to scrape the profiles yourself from the public HTML Instagram webpages.

    Using the developer console in Google Chrome and analyzing the network traffic I found the following URL that might be able to do some of what you want. Looks like calling the /graphql/query/ URL with a JSON object as a query parameter labeled: variables, along with a hash of some kind of that object. Not sure if you can call it on your own, but I've had success with other embedded URLs like this. The ID is the users ID which you can get from the HTML as well.

    I hope it helps somehow.

    https://www.instagram.com/graphql/query/?query_hash=76d9c5f9c2d88aa251ece9ea61fdc570&variables=%7B%22id%22%3A%225466275%22%2C%22first%22%3A12%2C%22after%22%3A%22AQCqBkaT0gZcgV1z9nfTgM3saTJi3cDRQoQy2YM4SdWNWyo3kdMTfCzWvuGcGRI9e1WpAIquMMG9jeuuXSe0TSMiQMPIL1ZmVimTMQ0dfrD_9Q%22%7D
    

    Decoded that is:

    https://www.instagram.com/graphql/query/?query_hash=76d9c5f9c2d88aa251ece9ea61fdc570&variables={"id":"5466275","first":12,"after":"AQCNhv_lxGd-nHBBaZb5kk3J4N-n058NgyCiWDnJ10rLc2V-YrVUvGsiuXr4NsMQ4QDzOLdjbTIVqoMpspJ69r-0s-PzOceis9J25o8P2BcjdA"}