Meta ads_insights API 拉自己廣告 90 天 CPM:act_xxx/insights endpoint 實作 2026
直接回答
Meta /act_xxxxx/insights endpoint 用 ads_read scope token 即可 call,回傳每個 campaign 的真實 cpm / impressions / reach / spend。實測台灣某 act 過去 90 天 CPM 範圍 NT$30 到 NT$405。個人廣告主免 App Review,10 分鐘搞定。對「已投過的興趣」拿真實歷史數據準確。
評估自建 Meta 廣告數據工具時撞到一條好用 endpoint。
—
我跑 6 種 Meta API 變體想拿 bid 數據都不行。但意外發現 ads_insights endpoint 拿自己歷史 CPM 完全沒問題,10 分鐘可以建私人 CPM 資料庫。
雖然不能 cover「沒投過的新興趣」use case,對「已投過想看真實表現」的場景超直接。
—
完整實作 3 步
第 1 步:拿短期 user token
去 developers.facebook.com/tools/explorer。App 下拉選 default 或你自己建的 dev app,Permissions 加 ads_read,按 Generate Access Token。FB 跳對話窗確認後拿到一串 EAA 開頭的 token,1 小時內有效。
個人廣告主用 Development Mode 不用過 App Review,這條路徑昨天另一篇有寫過完整 setup。
—
第 2 步:拿 ad account 清單
GET https://graph.facebook.com/v22.0/me/adaccounts
?fields=account_id,name,currency,account_status
&access_token=xxx
實測 response:
{
"data": [
{
"account_id": "205005516689844",
"name": "週末電商廣告帳號",
"currency": "TWD",
"account_status": 1,
"id": "act_205005516689844"
},
{
"account_id": "1483107488437143",
"name": "urban-garden",
"currency": "TWD",
"account_status": 1,
"id": "act_1483107488437143"
}
]
}
account_status=1 是 active,=2 是 disabled。記下你要查的 act_xxxxx ID。
—
第 3 步:拉 CPM 數據
最常用 query:
GET https://graph.facebook.com/v22.0/act_xxxxx/insights
?date_preset=last_90d
&fields=cpm,impressions,reach,spend
&level=campaign
&access_token=xxx
實測台灣某 act 過去 90 天 response:
{
"data": [
{
"cpm": "132.964258",
"impressions": "30888",
"reach": "20410",
"spend": "4107",
"date_start": "2026-02-07",
"date_stop": "2026-05-07"
},
{
"cpm": "405.315615",
"impressions": "1806",
"reach": "937",
"spend": "732",
"date_start": "2026-02-07",
"date_stop": "2026-05-07"
},
{
"cpm": "30.519481",
"impressions": "13860",
"reach": "7861",
"spend": "423"
}
]
}
CPM 範圍 NT$30 到 NT$405,差超過 13 倍。意思是同一個 ad account 不同 campaign 競爭程度差很多。
—
可調的參數
level:
account:整個 ad account 加總,1 筆
campaign:每個 campaign 1 筆(最常用)
adset:每個 ad set 1 筆(顆粒度細,rate limit 注意)
ad:每張廣告 1 筆
date_preset:
last_3d / last_7d / last_14d / last_28d / last_30d / last_90d
this_month / last_month / this_quarter / lifetime
today / yesterday
fields:
cpm(每千次曝光成本)
cpc(每次點擊成本)
ctr
spend
impressions
reach
frequency
actions(轉換動作數)
purchase_roas
—
按 interest 拆分 CPM
直接的 breakdowns 不支援 interest 拆。間接做法:
撈所有 ad set: GET /act_xxx/adsets?fields=id,name,targeting 過濾只勾單一 interest 的 ad set 拿那些 ad set 的 ID 後 GET /<adset_id>/insights?fields=cpm
這個邏輯可以建你自己的「私人 interest CPM 資料庫」。前提是你有刻意開「乾淨單 interest」的測試 ad set,沒有的話只能拿混合 interest 的 CPM 平均。
—
注意點
- 5/4/2026 起 AMSA 改名 Marketing API Access Tier,breakdowns + reach 同時用會 strip reach 欄位。寫 dashboard 時要避開這個組合
- Rate limit 200 calls/hr development tier,每次 query 算一次 + 重 cputime call 撞點低
- Long-lived token 60 天到期要寫 cron refresh,沒做 60 天後 dashboard 全空
- 多 act 多 query 容易破 rate limit,建議 Redis cache 結果 24 小時
—
學到的是:Meta API 2026 不給「市場 bid 推薦」這條死門,但「自己歷史數據」這條完全開放。對廣告主來說,自建一個小工具拉自己 act 過去 90 天的 CPM by campaign,3-5 小時可以做完,是個 ROI 高的方向。比起想看別人 bid 行情,先把自己的真實 CPM 資料建立起來更實用。