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

如何通过Instagram Graph API及访问令牌获取Instagram关注列表(尝试无效)

How to Fetch Instagram Following List via Instagram Graph API

Hey there! I see you've been struggling to pull an Instagram account's following list—those old unofficial endpoints like https://www.instagram.com/urvish_._/?__a=1 are long dead, so let's walk through the proper, official way using the Instagram Graph API.

First, Critical Prerequisites

Before diving into API calls, you need to check these non-negotiable boxes:

  • Your target Instagram account must be a Business or Creator Account (personal accounts aren't supported by the Graph API).
  • The account must be linked to a Facebook Page (this is mandatory for accessing Instagram data via the Graph API ecosystem).
  • You need the correct permissions attached to your access token: instagram_basic (for basic profile data) and pages_read_engagement (to access Page-linked Instagram accounts).

Step-by-Step Implementation

  1. Retrieve your Instagram User ID
    First, you need the unique ID of the Instagram account you're targeting. Grab it by querying your linked Facebook Page's endpoint:

    GET /{facebook-page-id}/instagram_accounts?access_token={your-access-token}
    

    The response will include an id field—this is your Instagram User ID (sometimes labeled ig_id).

  2. Generate a Long-Lived Access Token
    Short-lived tokens expire after 1 hour, so create a long-lived one (valid for 60 days, renewable) using this endpoint:

    GET /oauth/access_token?grant_type=fb_exchange_token&client_id={your-app-id}&client_secret={your-app-secret}&fb_exchange_token={your-short-lived-token}
    

    Guard this token securely—it's the key to making valid API requests.

  3. Fetch the Following List
    Now call the official endpoint to get the following list. You can specify which user data you want (like username, profile picture) in the fields parameter:

    GET /{instagram-user-id}/following?fields=id,username,full_name,profile_picture_url&access_token={your-long-lived-access-token}
    

Why Your Old Attempts Failed

The __a=1 endpoint was an unofficial, internal API that Instagram has completely deprecated and blocked. Using it will return empty data, errors, or get your requests throttled—so stick strictly to the official Graph API methods.

Common Pitfalls to Avoid

  • Missing Permissions: A 403 Forbidden error almost always means your token lacks instagram_basic or pages_read_engagement.
  • Expired Token: Always use a long-lived token and renew it before it expires to avoid unexpected failures.
  • Personal Account Limitation: If you're working with a personal Instagram account, convert it to a Business or Creator Account first—there's no way around this for the Graph API.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.09 11:37:45