curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/insights?level=ad&ids=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-21"
{
"status": "success",
"platform": "snapchat",
"level": "ad",
"startDate": "2026-11-20",
"endDate": "2026-11-21",
"insights": [
{
"date": "2026-11-20",
"level": "ad",
"id": "c3a1e2d4-0000-4000-8000-0000000000ad",
"currency": "USD",
"spend": 12.5,
"impressions": 3000,
"clicks": 30,
"cpm": 4.17,
"cpc": 0.42,
"ctr": 1,
"swipes": 30,
"spendUsd": 12.5
},
{
"date": "2026-11-21",
"level": "ad",
"id": "c3a1e2d4-0000-4000-8000-0000000000ad",
"currency": "USD",
"spend": 18,
"impressions": 4000,
"clicks": 42,
"cpm": 4.5,
"cpc": 0.43,
"ctr": 1.05,
"swipes": 42,
"spendUsd": 18
}
],
"count": 2,
"meta": { "pagination": { "hasMore": false } }
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Insights on snapchat report by ad: use level \"ad\" with the ad ids."
}
Snapchat Ads
洞察
取得透過 Ayrshare 推廣的 Snapchat 廣告即時每日指標,包括花費、曝光、上滑、CPM、CPC 和 CTR。
GET
/
ads
/
snapchat
/
insights
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/insights?level=ad&ids=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-21"
{
"status": "success",
"platform": "snapchat",
"level": "ad",
"startDate": "2026-11-20",
"endDate": "2026-11-21",
"insights": [
{
"date": "2026-11-20",
"level": "ad",
"id": "c3a1e2d4-0000-4000-8000-0000000000ad",
"currency": "USD",
"spend": 12.5,
"impressions": 3000,
"clicks": 30,
"cpm": 4.17,
"cpc": 0.42,
"ctr": 1,
"swipes": 30,
"spendUsd": 12.5
},
{
"date": "2026-11-21",
"level": "ad",
"id": "c3a1e2d4-0000-4000-8000-0000000000ad",
"currency": "USD",
"spend": 18,
"impressions": 4000,
"clicks": 42,
"cpm": 4.5,
"cpc": 0.43,
"ctr": 1.05,
"swipes": 42,
"spendUsd": 18
}
],
"count": 2,
"meta": { "pagination": { "hasMore": false } }
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Insights on snapchat report by ad: use level \"ad\" with the ad ids."
}
取得 Snapchat 廣告的即時成效,每個廣告每天一列,適用於你透過推廣貼文建立的廣告。
每一列還包含
- 數據在呼叫時從 Snapchat 讀取。每日花費記錄請使用歷史記錄。
- Snapchat 依廣告回報,因此請傳送
level=ad。其他層級會回傳code: 101。 - 日期依廣告帳戶所在時區計算。金額以廣告帳戶的貨幣計,在每一列的
currency中回傳。 - 一個請求只涵蓋一個廣告帳戶。來自多個廣告帳戶的廣告會回傳
code: 101。 - 透過 Ayrshare 為其他個人檔案建立的廣告會回傳
code: 400。 - 範圍內每 31 天,每個廣告會從 Snapchat 讀取一次,一個請求最多可進行 100 次此類讀取。例如,50 個廣告跨 62 天即為 100 次讀取。更大的請求會回傳
code: 101:請傳送較少的廣告或較短的範圍。
請求頭參數
查詢參數
以逗號分隔的 Snapchat 廣告 ID,最多 50 個。你可以省略
ids,改為傳送 accountId。這樣會回報你在該廣告帳戶中透過 Ayrshare 為此個人檔案推廣的廣告。如果該帳戶中你的廣告超過 50 個,請求會回傳 code: 101:請改為傳送它們的 ID。如果未找到任何廣告,報告為空。Snapchat 廣告帳戶 ID。省略
ids 時必填。使用 ids 時,Ayrshare 有記錄的每個廣告都必須在此帳戶中。Ayrshare 沒有記錄的 ID 會從你包含該 ID 的廣告帳戶中讀取,因此 accountId 不會限制它。要回傳的指標,以逗號分隔。省略則回傳全部。請參閱指標。
指標
| 指標 | 類型 | 意義 |
|---|---|---|
spend | number | 花費金額 |
impressions | number | 廣告曝光次數 |
clicks | number | 廣告的上滑次數 |
cpm | number 或 null | 每 1,000 次曝光的費用。無曝光的日期為 null |
cpc | number 或 null | 每次上滑的費用。無上滑的日期為 null |
ctr | number 或 null | 每次曝光的上滑率,以百分比表示。無曝光的日期為 null |
swipes(與 clicks 計數相同)以及 spendUsd(貨幣為 USD 時等於 spend,否則為 null)。
Snapchat 不依天回報 reach、actions 或 conversionValue。請求這些指標會回傳 code: 101。Snapchat 也沒有細分維度,因此傳送 breakdowns 會回傳 code: 101。
分頁
所有列都在一個回應中回傳,因此meta.pagination.hasMore 一律為 false。
錯誤
| Code | 何時 |
|---|---|
101 | 參數缺失或錯誤、level 不是 ad、指標或細分不受支援、startDate 早於 37 個月前、傳送了超過 50 個 ID、僅 accountId 就涵蓋了你超過 50 個廣告、廣告分布在多個廣告帳戶中、某個廣告不在 accountId 中,或請求需要超過 100 次讀取 |
400 | 某個廣告不屬於你,或 accountId 不是 Ayrshare 為這些廣告記錄的廣告帳戶 |
364 | 已達到 Snapchat 的速率限制。請等待一分鐘後重試 |
370 | Snapchat 無法回傳洞察資料。請重試 |
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/insights?level=ad&ids=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-21"
{
"status": "success",
"platform": "snapchat",
"level": "ad",
"startDate": "2026-11-20",
"endDate": "2026-11-21",
"insights": [
{
"date": "2026-11-20",
"level": "ad",
"id": "c3a1e2d4-0000-4000-8000-0000000000ad",
"currency": "USD",
"spend": 12.5,
"impressions": 3000,
"clicks": 30,
"cpm": 4.17,
"cpc": 0.42,
"ctr": 1,
"swipes": 30,
"spendUsd": 12.5
},
{
"date": "2026-11-21",
"level": "ad",
"id": "c3a1e2d4-0000-4000-8000-0000000000ad",
"currency": "USD",
"spend": 18,
"impressions": 4000,
"clicks": 42,
"cpm": 4.5,
"cpc": 0.43,
"ctr": 1.05,
"swipes": 42,
"spendUsd": 18
}
],
"count": 2,
"meta": { "pagination": { "hasMore": false } }
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Insights on snapchat report by ad: use level \"ad\" with the ad ids."
}