Instagram ?__a=1接口失效及GraphQL查询数据问题(4月19日更新)
Instagram User Post Scraping: Updated Pagination & Authentication (April 19, 2024)
Hey folks, if you've been struggling to fetch a full list of Instagram user posts lately, you're not alone—Instagram's made some significant changes to their unofficial API in recent weeks, and here's the latest intel based on hands-on testing:
What's Broken Right Now
- Pagination Methods: The previously reliable workflow using the endpoint
https://www.instagram.com/{{username}}/?__a=1with pagination viagraphql.edge_owner_to_timeline_media.page_info.end_cursoris no longer functional. On top of that, the oldermax_idpagination parameter has been fully disabled by Instagram. - Old Authentication: The
ig_prcookie that many developers relied on for authenticated requests has been blocked entirely—any requests using this cookie will now fail.
Current Working Approach (April 19 Update)
The only viable way to fetch user post data right now is to use a valid, account-tied sessionid cookie in your request headers:
- Grab the
sessionidfrom an active, logged-in Instagram session (this cookie is specific to your account and needs to be fresh to avoid being flagged). - Include this
sessionidin theCookieheader of your requests to Instagram's endpoints. - Note that while the basic
?__a=1endpoint structure might still return partial data, pagination via the end cursor is no longer supported—you'll need to adapt to Instagram's updated GraphQL endpoint schema if you need to retrieve full post histories.
Heads up: Instagram actively enforces rate limits and blocks unofficial API usage, so even with a valid
sessionid, avoid making excessive requests in a short window to prevent getting your account or IP flagged.
内容的提问来源于stack exchange,提问作者Pablo Gutiérrez
相关产品推荐
相关产品推荐

