Facebook Graph API - IG 用户洞察 - 获取 audience_* 指标

Facebook Graph API - IG User Insights - Get audience_* metrics

我正在尝试从 FB 图 API 获取 audience_cityaudience_countryaudience_gender_ageaudience_locale 指标 API IG 用户洞察端点:https://developers.facebook.com/docs/instagram-api/reference/ig-user/insights

我提出的要求:

curl --location --request GET 'https://graph.facebook.com/v10.0/17841411377776842/insights?access_token=...&metric=audience_city&period=lifetime&since=1614639600&until=1614812400'

返回错误:

{
    "error": {
        "message": "(#100) (audience_city) metric supports querying data only till yesterday",
        "type": "OAuthException",
        "code": 100,
        "fbtrace_id": "APrDtw-8BzaJSbu4F9Q-RA5"
    }
}

sinceuntil 时间戳相应地设置为 24 March 2021 - 所以我绝对不是在查询“太新”的数据.

online_followers 等另一个指标的相同请求非常有效。

有没有人遇到过类似的问题并且能够过桥的?

也许你现在已经想通了,但万一有人降落在这里,让我们帮助他们:

引用文档:https://developers.facebook.com/docs/instagram-api/reference/ig-user/insights#metrics-and-periods

Metrics that support lifetime periods will have results returned in an array of 24 hour periods, with periods ending on UTC−07:00. audience_* metrics do not support since and until range parameters

所以基本上当使用前缀为 audience_ 的指标时,您不需要指定 since/until 参数。错误信息有点迷惑。


更新:
API 文档自问题发布后已更新,包括 audience_* 规范。我没有检查,我的错。
感谢@Jan 的更新并让我知道!