适用于Python Facebook API的Instagram数据

时间:2017-11-11 04:00:54

标签: python facebook-graph-api instagram

我尝试根据通过图谱API找到的Instagram帖子ID访问Instagram帖子到达

impressions= graph.get_object(id='17881493329146188', fields='reach')

我收到以下错误:

GraphAPIError: (#100) Tried accessing nonexisting field (reach) on node type (ShadowIGMedia)

有没有办法通过这个Facebook API Python包装器成功检索Instagram帖子的覆盖率?

1 个答案:

答案 0 :(得分:0)

Reach不是媒体上的字段,而是对象下的insights。你可以这样做:

impressions = graph.get_object(id='17881493329146188', fields='insights.metric(reach)')

根据对象的类型,您可能需要指定period和其他字段,例如fields='insights.metric(reach).period(lifetime)'