洞察報告

您可以��用 Instagram Graph API 來獲取 Instagram 用戶及其 Instagram 媒體物件的社交互動衡量數據。每個衡量數據的數量均根據 API 要求計算。

由於私隱規定��用戶在某些地區執行而與訊息相關的限時動態 Instagram 媒體互動將不再包含在一些衡量數據計算中。這些地區包括:歐洲(從 2020 年 12 月 1 日開始)和日本(從 2021 年 4 月 14 日開始)。

  • 對於用戶在受影響地區所製作的限時動態,replies 衡量數據目前將傳回值 0
  • 對於用戶在受影響地區以外所製作的限時動態,replies 衡量數據將傳回回覆次數,但用戶在受影響地區所作出的回覆將不會包含在計算中。

限制

  • 一些衡量數據不適用於追蹤者人數不足 100 的 Instagram 用戶。
  • 此 API 只會報告自主互動衡量數據;包含媒體物件的廣告上之互動不計算在內。
  • 媒體衡量數據資料最多會儲存 2 年。用戶衡量數據資料最多會儲存 90 天。
  • 您每次只能獲取單一用戶的洞察報告。
  • 您無法獲取 Facebook 專頁的洞察報告。
  • 即使限時動態已封存或設為精選,其洞察報告也只會出現 24 小時。如果您希望在限時動態過期之前獲得最新洞察報告,請為 Instagram 主題設定 Webhook,並訂閱 story_insights 欄位。
  • 不支援相簿子 Instagram 媒體的洞察報告。
  • 如果您正在要求的洞察報告資料不存在或者目前已消失,API 將為個別衡量數據傳回空白資料集,而不是傳回 0

UTC

API 回應中的時戳使用零位移的 UTC,並使用 ISO-8601 設定格式。例如:2019-04-05T07:56:32+0000

端點

此 API 由以下端點組成:

有關系統提供的衡量數據、參數和權限要求,請參閱每個端點的參考文件。

範例

獲取帳戶衡量數據

如需獲取 Instagram 商業或創作者帳戶的衡量數據,請查詢 GET /{ig-user-id}/insights 關係連線,並指定您希望傳回的衡量數據。

要求範例

GET graph.facebook.com/17841405822304914/insights
    ?metric=impressions,reach,profile_views
    &period=day

回應範例

{
  "data": [
    {
      "name": "impressions",
      "period": "day",
      "values": [
        {
          "value": 32,
          "end_time": "2018-01-11T08:00:00+0000"
        },
        {
          "value": 32,
          "end_time": "2018-01-12T08:00:00+0000"
        }
      ],
      "title": "Impressions",
      "description": "Total number of times the Business Account's media objects have been viewed",
      "id": "instagram_business_account_id/insights/impressions/day"
    },
    {
      "name": "reach",
      "period": "day",
      "values": [
        {
          "value": 12,
          "end_time": "2018-01-11T08:00:00+0000"
        },
        {
          "value": 12,
          "end_time": "2018-01-12T08:00:00+0000"
        }
      ],
      "title": "Reach",
      "description": "Total number of times the Business Account's media objects have been uniquely viewed",
      "id": "instagram_business_account_id/insights/reach/day"
    },
    {
      "name": "profile_views",
      "period": "day",
      "values": [
        {
          "value": 15,
          "end_time": "2018-01-11T08:00:00+0000"
        },
        {
          "value": 15,
          "end_time": "2018-01-12T08:00:00+0000"
        }
      ],
      "title": "Profile Views",
      "description": "Total number of users who have viewed the Business Account's profile within the specified period",
      "id": "instagram_business_account_id/insights/profile_views/day"
    }
  ]
}

獲取媒體衡量數據

如需獲取媒體物件的衡量數據,請查詢 GET /{ig-media-id}/insights 關係連線,並指定您希望傳回的衡量數據。

要求範例

GET graph.facebook.com/{media-id}/insights
    ?metric=engagement,impressions,reach

回應範例

{
  "data": [
    {
      "name": "engagement",
      "period": "lifetime",
      "values": [
        {
          "value": 8
        }
      ],
      "title": "Engagement",
      "description": "Total number of likes and comments on the media object",
      "id": "media_id/insights/engagement/lifetime"
    },
    {
      "name": "impressions",
      "period": "lifetime",
      "values": [
        {
          "value": 13
        }
      ],
      "title": "Impressions",
      "description": "Total number of times the media object has been seen",
      "id": "media_id/insights/impressions/lifetime"
    },
    {
      "name": "reach",
      "period": "lifetime",
      "values": [
        {
          "value": 13
        }
      ],
      "title": "Reach",
      "description": "Total number of unique accounts that have seen the media object",
      "id": "media_id/insights/reach/lifetime"
    }
  ]
}