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

Instagram账号粉丝数获取:原接口返回403错误求替代简易方案

Alternatives to Get Instagram Follower Count After the ?__a=1 Endpoint 403s

Been there, done that—Instagram’s old ?__a=1 endpoint getting blocked with 403 errors is super frustrating when you just need a quick follower count. Here are a few straightforward, no-fuss alternatives I’ve tested recently that work without needing full API access or complex authentication:

  • Mobile API Endpoint (Programmatic Access)
    Instagram’s mobile web API still allows unauthenticated requests (for now) if you spoof a mobile user agent. Here’s how to use it with curl:

    curl -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1" "https://i.instagram.com/api/v1/users/web_profile_info/?username=your_target_username"
    

    The follower count lives in the JSON response at data.user.edge_followed_by.count. For a quick Python script to parse this automatically:

    import requests
    
    target_username = "your_target_username"
    headers = {
        "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1"
    }
    
    response = requests.get(f"https://i.instagram.com/api/v1/users/web_profile_info/?username={target_username}", headers=headers)
    if response.ok:
        follower_count = response.json()["data"]["user"]["edge_followed_by"]["count"]
        print(f"{target_username} has {follower_count} followers")
    else:
        print(f"Failed to fetch data: Status code {response.status_code}")
    

    Note: Don’t hit this endpoint too quickly—Instagram will rate-limit or block your IP if you make too many requests in a short window.

  • Manual Page Source Check (No Code Needed)
    If you only need to look up a follower count occasionally, skip the code entirely:

    1. Go to the target user’s Instagram profile in your desktop browser
    2. Press F12 to open Developer Tools, then use Ctrl+F (or Cmd+F on Mac) to search for edge_followed_by
    3. You’ll find a line like "edge_followed_by":{"count":123456} — the number here is the follower count.
  • Heads-Up for Long-Term Use
    Important: Instagram regularly tweaks its unauthenticated endpoints to block scraping. These methods might stop working without warning. If you need a reliable solution for production or commercial use, you’ll have to use Instagram’s official Graph API, but that requires creating a developer account, getting app approval, and using access tokens — which is less "简易" as you requested.


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 03:42:59