Search code examples
web-crawlerinstagram

Is there CURRENTLY anyway to fetch Instagram user media without authentication?


Until recently there were several ways to retrieve Instagram user media without the need for API authentication. But apparently, the website stopped all of them.

Some of the old methods:

And some old related questions are:

I was able to retrieve the first twenty items by crawling the webpage of the user, but this is not a good or standard method especially when Instagram is not supporting it officially.

I was wondering If you know any method that currently works?


Solution

  • Unfortunately, Instagram stopped many of its APIs, including the ones that require authentication. It states in https://www.instagram.com/developer/:

    To continuously improve Instagram users' privacy and security, we are accelerating the deprecation of Instagram API Platform, making the following changes effective immediately.

    Some links explaining the details and causes of these changes:

    Some unofficial crawling methods have been proposed in (suggested by @Louis B.) https://stackoverflow.com/a/49906525/278840. You should take into consideration that these methods are being transformed each week.

    Update 2018:

    The old public API (without auth) is working again. We can access by adding ?__a=1 to the end of a profile url, like this:

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

    Update June 2022

    The old API '?__a=1' has stopped working again. It seems to be due to an error. The page redirects to the login page as a guest. If you open it after logging in, it shows a weird error:

    for (;;);{"__ar":1,"error":1357004,"errorSummary":"Sorry, something went wrong","errorDescription":"Please try closing and re-opening your browser window.","payload":null,"hsrp":{"hblp":{"consistency":{"rev":1005648797}}},"lid":"7106751273377983967"}

    Update December 2023 (requires valid auth cookies)

    The following link works and returns json (both parameters are required)

    https://www.instagram.com/leomessi/?__a=1&__d=dis