GRAPH API INSTAGRAM-获取范围日期中的指标值

问题描述 投票:1回答:1

我有以下查询:

[object media ID]/insights/?metric=reach&since2019-12-02&until=2019-12-22

它一直在返回生存期值(按日期过滤不起作用)。然后我添加了“ period=day”来添加所有值,但是响应是:

(#100) The following periods (day) are incompatible with the metric (reach)

如何获得范围内日期的指标总值?

谢谢

instagram-api instagram-graph-api
1个回答
0
投票

Instagram Graph API Media(对象)Insights端点不支持User Insights端点的所有精美过滤器。

所以我想问,您是在instagram媒体对象还是在用户对象上执行此操作?我的猜测是您正在媒体对象上执行此操作,这就是为什么会出现该错误的原因。我在媒体和用户对象上都运行了这些调用,以深入了解此问题。

如果您正在处理user对象,则最多只能使用28天。因此,如果您使用日期范围,则需要这样:

[instagram-id] / insights /?metric = reach&period = days_28&since2019-12-02&until = 2019-12-22

由于您的数据范围小于28天,因此您将获得该范围内所有instagram用户内容的覆盖率。

样本:

{
  "data": [
    {
      "name": "reach",
      "period": "days_28",
      "values": [
        {
          "value": 620,
          "end_time": "2019-12-20T08:00:00+0000"
        },
        {
          "value": 623,
          "end_time": "2019-12-21T08:00:00+0000"
        }
      ],
      "title": "Reach",
      "description": "Total number of times the Business Account's media objects have been uniquely viewed",
      "id": "17841400804152929/insights/reach/days_28"
    }
  ],
  "paging": {
    ....
  }
}

展示次数和覆盖率对于用户对象具有相同的时间段选项;天,周,28天。

所以要使用期限,从那时起直到,您只能在User对象上执行,不能在媒体上执行。

用户见解(带有过滤器)-> https://developers.facebook.com/docs/instagram-api/reference/user/insights#insights-2

媒体见解(仅限终生)-> https://developers.facebook.com/docs/instagram-api/reference/media/insights#insights-2

[作为参考,如果您要在Facebook上进行此调用,例如,对于某个帖子,您可以使用在FB上“覆盖”的指标post_impressions_unique。 FB有更多的过滤器。

https://developers.facebook.com/docs/graph-api/reference/v5.0/insights

© www.soinside.com 2019 - 2024. All rights reserved.