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

如何通过Facebook Graph API获取Instagram最新10条帖子及点赞数?

问题分析与解决方案

一、解决media字段访问错误的问题

你遇到的(#100) Tried accessing nonexisting field (media) on node type (InstagramUser)错误,核心原因是:

  • 你当前请求的InstagramUser节点属于个人Instagram账号,这类节点不支持media和insights字段;只有**Instagram商业账号(InstagramBusinessAccount)或Instagram创作者账号(InstagramCreatorAccount)**才允许访问这些数据。

修复步骤:

  1. 验证账号节点类型
    先请求以下接口确认你拿到的账号ID对应的节点类型:

    /{accountID}?fields=__typename
    

    如果返回的__typename是InstagramUser,说明这是个人账号,需要先将其转为商业/创作者账号,且确保和Facebook页面完成绑定。

  2. 使用正确的访问令牌与请求路径
    关联成功后,你需要使用Facebook页面的访问令牌(而非个人用户令牌)来请求Instagram商业账号的数据,正确的media请求格式应为:

    /{instagram-business-account-id}/media?fields=id,caption,insights.metric(engagement,impressions)&limit=10
    

    注意:必须确保你的令牌拥有pages_show_list、instagram_basic、instagram_manage_insights这三个权限。

二、关于Instagram Basic Display API无法获取粉丝数的问题

Instagram Basic Display API仅面向个人用户授权,只能获取公开的内容数据,粉丝数(followers_count/followed_by_count)属于非公开的账号核心数据,该API没有权限访问这类信息。你只能通过Facebook Graph API关联Instagram商业/创作者账号的方式来获取这些数据。


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.19 22:18:21