寻求无需client_id/认证密钥的Instagram API获取个人公开图片及点赞数的可用链接
Hey there! I totally get your frustration—those old unauthenticated public APIs were so convenient, but Instagram's tightened up their access rules over time. Let's go through your options right now:
1. 无需认证密钥的临时替代方案:网页公开数据抓取
Since your account is public, its content is visible on Instagram's web interface. You can scrape this data (critical note: only do this for your own account, and strictly follow Instagram's terms of service to avoid getting blocked):
- Open your public Instagram profile in a browser, hit F12 to open Developer Tools, then check the "Network" tab for requests that load your media content. These requests usually return JSON data containing image URLs and like counts.
- Write code to mimic these requests (make sure to include valid headers like
User-Agentto avoid being flagged as a bot). Parse the JSON response to extract the exact data you need. - Heads up: Instagram might tweak their web API structure at any time, so this method isn't as stable as official tools.
2. 官方稳定方案:使用Instagram Graph API(认证步骤简单,适合个人自用)
If you want a reliable, long-term solution, setting up basic developer credentials for your own account is way easier than it sounds:
- Sign up for a Meta Developer Account, create a new app, and add the Instagram Graph API product to it.
- Complete the OAuth authorization flow for your own Instagram account—this generates an access token with permissions like
user_media(to access your posts) anduser_likes(to fetch like counts). - Use endpoints like
GET /me/mediato pull your media content. The response will include fields likemedia_url(direct image link) andlike_count.
Even though this requires a client ID and access token, since you're only accessing your own account, the setup takes just a few minutes and gives you a stable, supported way to get your data.
内容的提问来源于stack exchange,提问作者KittyCat

