curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/history?adId=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-22"
{
"status": "success",
"history": [
{
"accountId": "5a0d0000-0000-4000-8000-000000000003",
"adId": "c3a1e2d4-0000-4000-8000-0000000000ad",
"adName": "Acme - Snap - 2026-11-20T15:04",
"budgetDaily": 20,
"budgetType": "",
"currency": "USD",
"deliveryStatus": null,
"goal": { "type": "brand_awareness" },
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 42,
"cpc": 0.43,
"cpp": 0,
"cpm": 4.5,
"ctr": 1.05,
"frequency": 0,
"impressions": 4000,
"reach": 0
},
"network": "snapchat",
"postId": "DE6gpw8kxlonHy6eb7L1",
"snapchatSnapId": "6f1c2d3e-0000-4000-8000-00000000000a",
"socialPostId": "6f1c2d3e-0000-4000-8000-00000000000a",
"spend": 18,
"spendDate": "2026-11-21T00:00:00.000Z",
"spendUsd": 18,
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2026-11-20T00:00:00.000Z",
"end": "2026-11-22T00:00:00.000Z",
"adId": "c3a1e2d4-0000-4000-8000-0000000000ad"
},
"metrics": {
"totalSpend": null,
"totalSpendByCurrency": { "USD": 18 },
"totalClicks": 42,
"totalImpressions": 4000,
"totalReach": 0,
"averageCTR": 1.05,
"averageFrequency": 0,
"cpm": 4.5,
"cpp": 0,
"cpc": 0.43,
"costPerResult": 0.43,
"byGoalType": {
"brand_awareness": {
"spend": 18,
"impressions": 4000,
"clicks": 42,
"reach": 0,
"count": 1,
"ctr": 1.05,
"cpm": 4.5,
"cpp": 0,
"cpc": 0.42857142857142855
}
},
"byGoalTitle": {},
"goalPerformance": {
"bestPerformingGoalType": { "type": "brand_awareness", "clicks": 42, "spend": 18, "ctr": 1.05 },
"mostEfficientGoalType": { "type": "brand_awareness", "cpc": 0.43, "spend": 18 }
},
"count": 1,
"firstDay": "2026-11-21T00:00:00.000Z",
"lastDay": "2026-11-21T00:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Invalid date format. Please use ISO 8601 format (YYYY-MM-DD)."
}
Snapchat Ads
Lịch sử
Lấy chi tiêu và hiệu quả hằng ngày của các quảng cáo Snapchat bạn đã boost qua Ayrshare, kèm tổng theo tiền tệ và bộ lọc ngày.
GET
/
ads
/
snapchat
/
history
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/history?adId=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-22"
{
"status": "success",
"history": [
{
"accountId": "5a0d0000-0000-4000-8000-000000000003",
"adId": "c3a1e2d4-0000-4000-8000-0000000000ad",
"adName": "Acme - Snap - 2026-11-20T15:04",
"budgetDaily": 20,
"budgetType": "",
"currency": "USD",
"deliveryStatus": null,
"goal": { "type": "brand_awareness" },
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 42,
"cpc": 0.43,
"cpp": 0,
"cpm": 4.5,
"ctr": 1.05,
"frequency": 0,
"impressions": 4000,
"reach": 0
},
"network": "snapchat",
"postId": "DE6gpw8kxlonHy6eb7L1",
"snapchatSnapId": "6f1c2d3e-0000-4000-8000-00000000000a",
"socialPostId": "6f1c2d3e-0000-4000-8000-00000000000a",
"spend": 18,
"spendDate": "2026-11-21T00:00:00.000Z",
"spendUsd": 18,
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2026-11-20T00:00:00.000Z",
"end": "2026-11-22T00:00:00.000Z",
"adId": "c3a1e2d4-0000-4000-8000-0000000000ad"
},
"metrics": {
"totalSpend": null,
"totalSpendByCurrency": { "USD": 18 },
"totalClicks": 42,
"totalImpressions": 4000,
"totalReach": 0,
"averageCTR": 1.05,
"averageFrequency": 0,
"cpm": 4.5,
"cpp": 0,
"cpc": 0.43,
"costPerResult": 0.43,
"byGoalType": {
"brand_awareness": {
"spend": 18,
"impressions": 4000,
"clicks": 42,
"reach": 0,
"count": 1,
"ctr": 1.05,
"cpm": 4.5,
"cpp": 0,
"cpc": 0.42857142857142855
}
},
"byGoalTitle": {},
"goalPerformance": {
"bestPerformingGoalType": { "type": "brand_awareness", "clicks": 42, "spend": 18, "ctr": 1.05 },
"mostEfficientGoalType": { "type": "brand_awareness", "cpc": 0.43, "spend": 18 }
},
"count": 1,
"firstDay": "2026-11-21T00:00:00.000Z",
"lastDay": "2026-11-21T00:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Invalid date format. Please use ISO 8601 format (YYYY-MM-DD)."
}
Lấy bản ghi chi tiêu hằng ngày của các quảng cáo Snapchat bạn đã tạo bằng Boost Bài đăng. Mỗi mục trong
history là một quảng cáo trong một ngày.
- Lịch sử là bản ghi chi tiêu hằng ngày do Ayrshare lưu, nên chi tiêu của hôm nay có thể chưa hiển thị. Để xem số liệu trực tiếp, dùng Insights.
- Một quảng cáo xuất hiện vào mỗi ngày Snapchat báo cáo số liệu cho nó. Quảng cáo tạo trong Snapchat Ads Manager không được bao gồm.
- Khi không tìm thấy ngày nào trong khoảng ngày, phản hồi vẫn thành công:
historytrống vàwarningschứa một mục có mã401. spendcủa mỗi ngày tính theo tiền tệ của tài khoản quảng cáo, hiển thị trongcurrency.totalSpendByCurrencycho tổng theo từng tiền tệ. Nếu các tài khoản quảng cáo của bạn dùng tiền tệ khác nhau, hãy lọc theoaccountId.clicksđếm số lượt swipe-up. Snapchat không báo cáo phạm vi tiếp cận hằng ngày, nênreach,frequencyvàcpplà0.spendUsdlàspendcủa ngày khi tiền tệ là USD, vànullnếu không.totalSpendluôn lànull: hãy dùngtotalSpendByCurrency.byGoalTypevàgoalPerformancenhóm số liệu theo mục tiêu của lượt boost:brand_awareness,video_viewshoặctraffic.
Tham số Header
Tham số truy vấn
Gửi tối đa một trongadId, postId, accountId và socialPostId. Nếu gửi nhiều hơn một, tham số đầu tiên theo thứ tự đó được dùng. Bỏ qua tất cả để nhận mọi quảng cáo Snapchat.
Chỉ các quảng cáo được boost từ ID bài đăng Ayrshare này.
Chỉ các quảng cáo được boost từ Snap này:
mediaId trong kết quả Snapchat của bài đăng. snapchatSnapId được chấp nhận như cùng một tham số.Ngày bắt đầu của khoảng ngày, theo định dạng ISO 8601, ví dụ
2026-11-01.Số mục hằng ngày tối đa trả về, mới nhất trước. Tối đa là 300; giá trị lớn hơn bị giới hạn ở 300.
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/history?adId=c3a1e2d4-0000-4000-8000-0000000000ad&startDate=2026-11-20&endDate=2026-11-22"
{
"status": "success",
"history": [
{
"accountId": "5a0d0000-0000-4000-8000-000000000003",
"adId": "c3a1e2d4-0000-4000-8000-0000000000ad",
"adName": "Acme - Snap - 2026-11-20T15:04",
"budgetDaily": 20,
"budgetType": "",
"currency": "USD",
"deliveryStatus": null,
"goal": { "type": "brand_awareness" },
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 42,
"cpc": 0.43,
"cpp": 0,
"cpm": 4.5,
"ctr": 1.05,
"frequency": 0,
"impressions": 4000,
"reach": 0
},
"network": "snapchat",
"postId": "DE6gpw8kxlonHy6eb7L1",
"snapchatSnapId": "6f1c2d3e-0000-4000-8000-00000000000a",
"socialPostId": "6f1c2d3e-0000-4000-8000-00000000000a",
"spend": 18,
"spendDate": "2026-11-21T00:00:00.000Z",
"spendUsd": 18,
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2026-11-20T00:00:00.000Z",
"end": "2026-11-22T00:00:00.000Z",
"adId": "c3a1e2d4-0000-4000-8000-0000000000ad"
},
"metrics": {
"totalSpend": null,
"totalSpendByCurrency": { "USD": 18 },
"totalClicks": 42,
"totalImpressions": 4000,
"totalReach": 0,
"averageCTR": 1.05,
"averageFrequency": 0,
"cpm": 4.5,
"cpp": 0,
"cpc": 0.43,
"costPerResult": 0.43,
"byGoalType": {
"brand_awareness": {
"spend": 18,
"impressions": 4000,
"clicks": 42,
"reach": 0,
"count": 1,
"ctr": 1.05,
"cpm": 4.5,
"cpp": 0,
"cpc": 0.42857142857142855
}
},
"byGoalTitle": {},
"goalPerformance": {
"bestPerformingGoalType": { "type": "brand_awareness", "clicks": 42, "spend": 18, "ctr": 1.05 },
"mostEfficientGoalType": { "type": "brand_awareness", "cpc": 0.43, "spend": 18 }
},
"count": 1,
"firstDay": "2026-11-21T00:00:00.000Z",
"lastDay": "2026-11-21T00:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Invalid date format. Please use ISO 8601 format (YYYY-MM-DD)."
}