You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Instagram公开用户流API分页失效:max_id参数使用后返回重复内容

Instagram Unofficial API Pagination Broken Post JSON Format Update

Hey, I’ve been dealing with this exact same frustrating issue lately regarding Instagram’s unofficial endpoint https://www.instagram.com/<user>/?__a=1 — their recent JSON format tweak has completely broken the pagination flow that relied on max_id and end_cursor.

The Problem Breakdown

  • Previously, the workflow was straightforward: Fetch a public user’s feed, verify has_next_page was true, then plug the returned end_cursor into the max_id parameter for a follow-up request (https://www.instagram.com/<user>/?__a=1&max_id=<end_cursor>) to load older posts.
  • Now, even though end_cursor still shows up in the response and has_next_page remains true, using that max_id parameter just spits back the exact same first page of posts every single time. No new content gets loaded.

Why This Is Happening

This feels like another intentional move from Instagram to clamp down on unofficial API/scraping usage. They’ve kept the old field names (end_cursor, has_next_page) intact so basic feed fetching still works, but they’ve completely changed how the max_id parameter maps to their internal pagination system. It’s a classic "break third-party tools without breaking the core user experience" move.

Possible Workarounds

  • Dig deeper into the new JSON structure: Instagram might have hidden the valid pagination token under a different key or nested in a new part of the response. Look for fields like after, next_cursor, or other pagination-related strings that aren’t the familiar end_cursor.
  • Mimic official browser requests: Load the target user’s profile in a desktop browser, scroll down to trigger loading more posts, then check your browser’s dev tools (Network tab) to see what actual API calls Instagram’s own site uses. They’re definitely using a different endpoint or parameter setup now that you can replicate (at least temporarily).
  • Switch to official APIs (if possible): The only long-term reliable solution is using Instagram’s official APIs — either the Graph API for business/creator accounts or the Basic Display API for personal accounts. Unofficial endpoints will always be a moving target since Instagram actively works to block them.

Important reminder: Using unofficial Instagram APIs violates their Terms of Service, so proceed with caution if you choose to go that route.

内容的提问来源于stack exchange,提问作者Francisc0

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 09:13:32