English 中文(简体)
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?

最佳回答

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. Therefore, I definitely prefer to use the private API.

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 September 2023

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

https://www.instagram.com/leomessi/?__a=1&__d=dis
问题回答

In Flutter/dart this solution works for me:

String url = "https://www.instagram.com/";
String userName= "instaUserName";

var res = await http.get(
Uri.parse(Uri.encodeFull(url + username + "/?__a=1&__d=dis"))); 
// adding /?__a=1&__d=dis at the end will return json data

var userProfileInfo = json.decode(res.body);
print(userProfileInfo  ); 




相关问题
Scrapy SgmlLinkExtractor question

I am trying to make the SgmlLinkExtractor to work. This is the signature: SgmlLinkExtractor(allow=(), deny=(), allow_domains=(), deny_domains=(), restrict_xpaths(), tags=( a , area ), attrs=( href )...

Scrapy BaseSpider: How does it work?

This is the BaseSpider example from the Scrapy tutorial: from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from dmoz.items import DmozItem class DmozSpider(...

Designing a multi-process spider in Python

I m working on a multi-process spider in Python. It should start scraping one page for links and work from there. Specifically, the top-level page contains a list of categories, the second-level pages ...

What is the best way to crawl a login based sites?

I ve to automate a file download activity from a website (similar to, let s say, yahoomail.com). To reach a page which has this file download link, i ve to login, jump from page to page to provide ...

Twisted errors in Scrapy spider

When I run the spider from the Scrapy tutorial I get these error messages: File "C:Python26libsite-packages wistedinternetase.py", line 374, in fireEvent DeferredList(beforeResults)....

Crawling not working windows2008

We installed a new MOSS 2007 farm on windows 2008 SP2 enviroment. We used SQL2008 too. Configuration is 1 index, 1 FE and 1 server with 2008, all on ESX 4.0. All the Service that need it uses a ...

Is there a list of known web crawlers? [closed]

I m trying to get accurate download numbers for some files on a web server. I look at the user agents and some are clearly bots or web crawlers, but many for many I m not sure, they may or may not be ...

Most optimized way to store crawler states?

I m currently writing a web crawler (using the python framework scrapy). Recently I had to implement a pause/resume system. The solution I implemented is of the simplest kind and, basically, stores ...

热门标签