1. Insights
Cosmic Agency Ad Accounts API
  • Auth
    • 获取 tenant_access_token
      POST
    • Bearer probe
      GET
  • AdAccounts
    • List ad accounts (token-bound client only)
      GET
  • TopUpsList
    • List top-ups for token-bound client
      GET
    • Get one top-up (404 if other tenant)
      GET
  • FundTransfersList
    • List clear/deduct tickets for token-bound client
      GET
    • Get one fund transfer (404 if other tenant)
      GET
  • Insights
    • Daily spend for Meta ad accounts
      GET
    • Daily spend by country for Meta ad accounts
      GET
  • TopupAndBalance
    • Submit topup (aligns with New Top-up modal)
      POST
    • Balance clear → wallet (pending approval)
      POST
    • Partial deduct → wallet (pending approval)
      POST
  1. Insights

Daily spend for Meta ad accounts

GET
/api/v1/ad-accounts/daily-spend
Insights
Scope: ad_accounts:read.
Hard rate limit: 5 requests / second per API client, shared by both daily-spend endpoints (insights bucket).
ad_account_ids are Meta account ids (ad_account.meta_id / insights account_id). Optional act_ prefix is stripped.
Repeat the query param or pass a comma-separated list. Max 20 unique ids.
start_date and end_date are inclusive YYYY-MM-DD, max 30 days.
Any id outside the token tenant or allowed_meta_ids returns 403 FORBIDDEN_ACCOUNT.
Only stored spend rows are returned; zero-spend days are omitted.
Source: fb_ad_account_insights. Items are { account_id, date_start, spend }.

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Query 参数

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://www.cosmicads.app/api/v1/ad-accounts/daily-spend?ad_account_ids=&start_date=2026-10-01&end_date=2026-10-07' \
--header 'Authorization: Bearer <token>'

返回响应

🟢200
application/json
Daily spend rows in the requested range
Bodyapplication/json

示例
{
    "code": 0,
    "msg": "ok",
    "data": {
        "items": [
            {
                "account_id": "123456789012345",
                "date_start": "2026-10-01",
                "spend": 12.34
            }
        ]
    },
    "request_id": "string"
}
🟠400
🟠403
🟠429
修改于 2026-10-28 03:27:46
上一页
Get one fund transfer (404 if other tenant)
下一页
Daily spend by country for Meta ad accounts
Built with