登入開始免費試用
easyCoexistence 官方 API

透過 API 取得 Instagram 追蹤者人口統計

Instagram 的帳戶洞察端點會回傳追蹤者人口統計:指定 metric=follower_demographics、period=lifetime、metric_type=total_value、時間範圍,以及年齡、性別、城市或國家的分項。engaged_audience_demographics 對與內容互動的帳戶執行相同操作。Meta 只回傳前 45 個值;追蹤者數據需要 100 位追蹤者,互動受眾數據則需要時間範圍內有 100 次互動。

easyCoexistence 透過 get_social_insights 讀取 Instagram 追蹤者與互動受眾的人口統計,讓 Claude、ChatGPT 或您的程式能查詢哪些國家、城市或年齡層關注該帳戶,並取得已連接帳戶的 Meta 數據。

100 followers

低於此數,帳戶將不會回傳 follower_demographics。

100 engagements

時間範圍內須達到此互動數,engaged_audience_demographics 才會回傳。

Top 45

人口統計指標只回傳表現最佳的前 45 項,因此較小的城市與國家不會出現在結果中。

19 Aug 2024

last_14_days、last_30_days、last_90_days 與 prev_month 已在所有版本中對 engaged_audience_demographics 失效。

48 hours

帳戶指標背後的數據最多可延遲多久。

有哪些人口統計指標?

Meta 的帳戶洞察參考中有兩項指標,兩者均透過 GET /<IG_ID>/insights 讀取;另有兩組舊指標,舊有程式碼仍會要求:

  • follower_demographics:帳戶追蹤者的人口統計特徵。
  • engaged_audience_demographics:與之相同,但對象為互動受眾,即與其內容互動的帳戶。
  • 兩者皆適用:period 為 lifetime、metric_type 為 total_value、時間範圍,以及年齡、城市、國家或性別的分項。
  • audience_gender_age、audience_locale、audience_country 與 audience_city:已於 2023 年 12 月 11 日停用。
  • reached_audience_demographics:Meta 2024 年的更新日誌中有提及,但不見於其現行指標表。

如何請求追蹤者人口統計?

需提供該指標、period=lifetime、metric_type=total_value、時間範圍,以及一項分項。時間範圍會取代 since 與 until,而人口統計指標不支援後兩者;時間範圍為必填。若使用 Instagram Login,存取權杖需具備 instagram_business_basic 與 instagram_business_manage_insights 權限,請求須發送至 graph.instagram.com:

Followers by country, this month
GET https://graph.instagram.com/<IG_ID>/insights
  ?metric=follower_demographics
  &period=lifetime
  &timeframe=this_month
  &breakdown=country
  &metric_type=total_value
  &access_token=<INSTAGRAM_USER_ACCESS_TOKEN>

回應的結構如何?

數值會放在 total_value.breakdowns 內。dimension_keys 列出所請求的時間範圍與分項,每筆結果會配對 dimension_values、時間範圍,以及分項中的一個值,並附上數量。Meta 的範例是按國家查看互動受眾,國家以兩位字母代碼表示,例如 US 與 ES:

The response shape, broken down by country
{
  "data": [
    {
      "name": "follower_demographics",
      "period": "lifetime",
      "title": "<TITLE>",
      "description": "<DESCRIPTION>",
      "total_value": {
        "breakdowns": [
          {
            "dimension_keys": ["timeframe", "country"],
            "results": [
              { "dimension_values": ["<TIMEFRAME>", "<COUNTRY_CODE>"], "value": <COUNT> },
              { "dimension_values": ["<TIMEFRAME>", "<COUNTRY_CODE>"], "value": <COUNT> }
            ]
          }
        ]
      },
      "id": "<IG_ID>/insights/follower_demographics/lifetime"
    }
  ]
}

哪些時間範圍有效?

Meta 的參考資料列出 last_14_days、last_30_days、last_90_days、prev_month、this_month 與 this_week,適用於兩項指標;就互動受眾而言,this_month 指過去 30 天,this_week 指過去 7 天。對於 engaged_audience_demographics,前四者由 v20.0 起失效,並於 2024 年 8 月 19 日起在所有版本中失效,因此請改用 this_week 或 this_month;該更新日誌條目並未提及 follower_demographics。

適用哪些門檻與限制?

Meta 的帳戶洞察參考為人口統計指標設定以下規則:

  • 帳戶追蹤者少於 100 位時,不會回傳 follower_demographics。
  • 時間範圍內互動少於 100 次時,不會回傳 engaged_audience_demographics。
  • 只回傳表現最佳的前 45 項,因此較小的城市與國家不會出現。
  • 只計算有人口統計數據的觀眾,因此各數值加總可能少於追蹤者數目。
  • 數據缺失時回傳空集合而非 0,數據可能延遲最多 48 小時。
  • 若所請求的指標不支援某分項,整個請求會失敗,並顯示 An unknown error has occurred.

人口統計能否配合 Instagram Login 使用?

可以。Meta 於 2025 年 1 月 21 日向 Instagram Login 應用程式開放帳戶與內容洞察功能,其帳戶洞察參考列出 Instagram Login 搭配 instagram_business_basic 與 instagram_business_manage_insights 權限,並以 graph.instagram.com 為主機。帳戶必須為商業或創作者帳戶,此為 Meta Instagram Platform 的要求。

get_social_insights 如何讀取人口統計?

將 metrics 設為 follower_demographics 或 engaged_audience_demographics,period 設為 lifetime,並在 params 中帶入 timeframe、breakdown 與 metric_type。easyCoexistence 會以已連接帳戶的存取權杖,為該帳戶呼叫 GET /<IG_ID>/insights,並回傳 Meta 的回應,讓 Claude 或 ChatGPT 能說明哪些國家、城市或年齡層關注該帳戶。

get_social_insights arguments for followers by age
{
  "account_id": "<ACCOUNT_ID>",
  "metrics": ["follower_demographics"],
  "period": "lifetime",
  "params": {
    "timeframe": "this_month",
    "breakdown": "age",
    "metric_type": "total_value"
  }
}

常見錯誤

  • 傳入 since 與 until。人口統計指標不支援兩者:請以 timeframe 設定範圍,且此參數為必填。
  • 對互動受眾使用 last_30_days 或 last_90_days。這兩個時間範圍已於 2024 年 8 月 19 日起在所有版本中對 engaged_audience_demographics 失效。
  • 將分項加總以取得追蹤者數目。只計算有人口統計數據的觀眾,且只回傳前 45 個值,因此加總結果會偏少。
  • 期望小帳戶有數據。追蹤者人口統計需要 100 位追蹤者,互動受眾則需要時間範圍內有 100 次互動。
使用 EasyCoexistence 完成這項設定

每個連接每月由 US$ 9 起,連接越多越便宜,最低降至 US$ 0.75,首 3 天免費。

常見問題

Instagram 帳戶需要多少追蹤者才能取得人口統計?

100 位。低於此數時,Meta 不會回傳 follower_demographics;engaged_audience_demographics 則需要時間範圍內有 100 次互動。

為何 Instagram 只回傳 45 個城市?

Meta 的人口統計指標只回傳表現最佳的前 45 項,因此較小的城市與國家會被排除。

Instagram API 中什麼取代了 audience_gender_age?

follower_demographics,並可按年齡、性別、城市或國家進行分項。Meta 已於 2023 年 12 月 11 日停用 audience_gender_age、audience_locale、audience_country 與 audience_city。

可以在 follower_demographics 中使用 since 與 until 嗎?

不可以。人口統計指標不支援 since 與 until;改由 timeframe 參數設定範圍,且此參數為必填。

繼續閱讀

兩分鐘內連接您的第一個頻道。

無需等待平台審核。連接 WhatsApp、Instagram、TikTok 或其他頻道,然後請您的 AI 發佈貼文、回覆訊息或匯報數據,並看着它運作。

  • 免費試用 3 天
  • 隨時取消
  • 只用官方 API
  • 24/7 監察

驗證日期