Instagram账号粉丝数获取:原接口返回403错误求替代简易方案
?__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 withcurl: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:- Go to the target user’s Instagram profile in your desktop browser
- Press
F12to open Developer Tools, then useCtrl+F(orCmd+Fon Mac) to search foredge_followed_by - 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

