透過 API 取得 Instagram 追蹤者數目與個人檔案欄位
Instagram API 會在 followers_count 欄位回傳專業帳戶的追蹤者數目,同時包括 follows_count、media_count、username、name、profile_picture_url 與 account_type。使用 Instagram Login 時,以 instagram_business_basic 權限對 graph.instagram.com 發出 GET /me 請求,並加入這些欄位即可讀取。Meta 的 IG User 參考文件亦列出 biography 與 website,而追蹤者數目隨時間的變化則來自 insights。
easyCoexistence 以 Instagram Login 連接 Instagram 商業或創作者帳戶,讓 Claude、ChatGPT 或你自己的程式碼,透過 get_social_insights 讀取覆蓋人數、瀏覽次數與追蹤數據,全部使用 Meta 官方 API;個人檔案上的追蹤者與帖文數目則沒有對應的工具。
Meta 的 IG User 參考文件標示為公開的欄位,代表追蹤此帳戶的 Instagram 用戶總數。
Meta 的 Instagram Login 指南列出的 User 欄位,由 id 與 user_id 至 followers_count 與 media_count。
創作者帳戶的 account_type 值;商業帳戶讀取為 Business。
低於此門檻時,Meta 不會為該帳戶回傳 follows_and_unfollows 或 follower_count insights。
Instagram Login 會回傳哪些個人檔案欄位?
Meta 的 Instagram Login 指南為 User 物件列出九個欄位,以 GET /me 搭配欄位清單讀取。存取權杖需要 instagram_business_basic 權限;其後的呼叫則使用 user_id(而非 id)作為帳戶的 IG_ID:
如何讀取追蹤者數目?
在 /me 上要求 followers_count。Meta 參考文件將此欄位對應至存取權杖所屬帳戶的 User 節點。該數值是呼叫當刻的累計總數,因此若控制台要繪製變化圖表,須自行每日儲存一次讀數。
GET https://graph.instagram.com/me
?fields=user_id,username,followers_count,follows_count,media_count
&access_token=<ACCESS_TOKEN>
{
"user_id": "<IG_ID>",
"username": "<USERNAME>",
"followers_count": 1840,
"follows_count": 312,
"media_count": 97
}Meta 參考文件還列出哪些其他欄位?
Meta 的 IG User 參考文件同時適用於三種設定,在 Instagram Login 指南的九個欄位之外,另加入多個欄位。部分欄位標示為適用於 Page 連結帳戶,其餘則沒有登入說明:
- biography:個人檔案的簡介文字,標示為公開。
- website:帳戶的網站網址,標示為公開。
has_profile_pic:帳戶是否設有個人檔案相片。is_published與legacy_instagram_user_id:適用於 Page 連結帳戶,後者為 v21.0 或之前的 Marketing API 端點所用的 ID。shopping_product_tag_eligibility:帳戶是否已設定 Instagram 購物。
如何追蹤追蹤者增長?
透過帳戶的 insights,而非個人檔案。發出 GET /<IG_ID>/insights 並帶上 metric=follows_and_unfollows、metric_type=total_value 及 follow_type 細分,即可取得已追蹤的帳戶,以及已取消追蹤或已離開 Instagram 的帳戶。使用 Instagram Login 時,存取權杖亦需要 instagram_business_manage_insights 權限。只有追蹤者達 100 人或以上的帳戶,Meta 才會回傳該數據及 follower_count。
API 能否列出追蹤者是誰?
不能。Meta 的 IG User 參考文件將 followers_count 與 follows_count 列為數字,並沒有列出可回傳背後帳戶的邊緣(edge)。它提供的是帳戶 insights 中的 follower_demographics,可按年齡、城市、國家或性別細分,但僅限追蹤者達 100 人或以上的帳戶。
能否讀取其他帳戶的追蹤者數目?
可以,透過 Business Discovery。Meta 在 Facebook Login 與 Unified Login 中提供此功能:發出 GET /<IG_ID>?fields=business_discovery.username(<USERNAME>){followers_count,media_count},即可取得其他商業或創作者帳戶的數據。它讀取的是另一帳戶的公開欄位,即 IG User 參考文件所標示者,包括 biography、followers_count、id、media_count、username 與 website 等。
如何透過 easyCoexistence 讀取個人檔案?
list_social_accounts 會回傳每個已連接帳戶的 username、name 及 external_id,即其 IG_ID。個人檔案上的數目,即 followers_count、follows_count 及 media_count,並沒有對應的工具,而且 Instagram 權杖不會交出;改為由 get_social_insights 讀取受眾的變化,包括 follows_and_unfollows、reach 及 views。
常見錯誤
- 期望取得追蹤者名單。Meta 只回傳數目,並在追蹤者達 100 人後回傳人口統計資料,但不會回傳帳戶本身。
- 只憑 followers_count 繪製增長圖表。它是累計總數;insights 中的 follows_and_unfollows 才能區分新增追蹤與取消追蹤。
- 以 CREATOR 檢查 account_type。創作者帳戶回報 Media_Creator,商業帳戶則為 Business。
- 把 /me 的 id 當作帳戶 ID。Meta 指南將 user_id(而非 id)與 webhook 通知,以及 /<IG_ID>/media 等路徑相連。
每個連接每月 US$ 9 至 US$ 0.75,連接越多價格越低,首 3 天免費試用。
常見問題
Instagram API 會回傳個人檔案簡介嗎?
是,為 biography 欄位,Meta 的 IG User 參考文件將其標示為公開。Instagram Login 指南的 9 個 User 欄位並不包括此欄位,因此請在 GET /me 中要求該欄位,並於您的設定中檢查回應。
為何 follows_and_unfollows 沒有回傳任何內容?
追蹤者少於 100 人的帳戶,Meta 不會回傳此數據。
我能取得個人帳戶的追蹤者數目嗎?
不能。Meta 的 API 服務專業帳戶,Business Discovery 只讀取商業與創作者帳戶。
追蹤者數目需要哪項權限?
使用 Instagram Login 時,需要 instagram_business_basic。追蹤者 insights 則另加 instagram_business_manage_insights。
繼續閱讀
兩分鐘內連接您的第一個頻道。
無需等待平台審核。連接 WhatsApp、Instagram、TikTok 或其他頻道,然後請您的 AI 發佈貼文、回覆訊息或匯報數據,並看着它運作。
- 免費試用 3 天
- 隨時取消
- 只用官方 API
- 24/7 監察
驗證日期