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

Instagram原公开数据JSON接口失效,求新接口或替代方案

Instagram ?__a=1 Endpoint Replacement Solutions

Hey there, sorry to hear that the old https://www.instagram.com/<username>/?__a=1 endpoint stopped working for you — Instagram has been tightening up their public API access over time, so this kind of breakage isn't unexpected. Here are some reliable alternatives you can explore:

This is Instagram's official, supported way to access public (and authorized private) user data. It requires a bit of setup, but it's the most stable option:

  • First, create a Meta Developer account and register a new app.
  • Submit your app for review if you need access to non-public user data (public data might be accessible without full review in some cases).
  • Use endpoints like GET /{user-id}/media to fetch posts, or GET /{user-id} to retrieve basic user info. You'll need an access token to authenticate requests.

The biggest upside here is compliance with Instagram's terms of service — you won't risk getting your IP blocked or your access revoked unexpectedly.

2. Web-Based GraphQL API (For Personal/Small-Scale Use)

Instagram's web interface relies heavily on GraphQL to load content, and you can replicate these requests programmatically. Here's how it works:

  • When you visit a user's profile in your browser, open the developer tools (Network tab) and look for requests to https://www.instagram.com/graphql/query/.
  • You'll notice two key parameters: query_hash (a fixed string that identifies the specific query being run) and variables (a JSON object with parameters like the user's ID and number of posts to fetch).
  • Example request format:
    https://www.instagram.com/graphql/query/?query_hash=e769aa130647d2354c40ea6a439bfc08&variables={"id":"123456789","first":20}
    
    Note: Query hashes can change without warning, so you'll need to periodically check and update them. Also, avoid making too many rapid requests — Instagram will rate-limit or block your IP if you do.

3. Third-Party Data Services

If you don't want to handle API setup or GraphQL maintenance, there are third-party services that wrap Instagram's data into easy-to-use APIs. These services handle authentication, rate-limiting, and query hash updates for you. Just make sure to choose a reputable provider that adheres to Instagram's terms to avoid any issues.

Important Notes

  • Always follow Instagram's Terms of Service when accessing their data — unauthorized scraping or excessive requests can lead to account or IP bans.
  • For production applications, the Official Basic Display API is the only sustainable choice.

内容的提问来源于stack exchange,提问作者Diego Mora Cespedes

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.22 09:55:16