Guides
Pagination
page and page_size, page_info, the maximum per route, fields for smaller responses and JSON filtering.
TikTok's lists are paginated by page number.
bash
curl --get https://tiktok-ads.mimicr.dev/open_api/v1.3/ad/get/ \
--header 'Access-Token: <token>' \
--data-urlencode 'advertiser_id=7000000013373458730' \
--data-urlencode 'filtering={"campaign_ids":["1700013373458749"]}' \
--data-urlencode 'fields=["ad_id","secondary_status"]' \
--data-urlencode 'page=1' \
--data-urlencode 'page_size=1000'json
{
"code": 0,
"message": "OK",
"request_id": "20261106124320678EF3A4FBBBB44956",
"data": {
"list": [
{ "ad_id": "1700013373458755", "secondary_status": "AD_STATUS_AUDIT" },
{ "ad_id": "1700013373458754", "secondary_status": "AD_STATUS_AUDIT" }
],
"page_info": { "page": 1, "page_size": 1000, "total_number": 2, "total_page": 1 }
}
}pagestarts at 1 (default 1);page_sizedefaults to 10.page_info.total_pagesays how many pages there are. A page past the end returnslist: []with the real totals.- A
page_sizeout of range answers40002 page_size: Must be between 1 and <max>.
| Route | Maximum page_size | Where the list is |
|---|---|---|
/campaign/get/, /adgroup/get/, /ad/get/ | 1,000 | data.list |
/report/integrated/get/ | 1,000 | data.list |
/subscription/get/ | 1,000 | data.subscriptions |
/identity/get/ | 100 (default 20) | data.identity_list |
/page/get/ | 100 | data.list |
/bc/get/ | 50 | data.list |
/pixel/list/ | 20 | data.pixels |
/oauth2/advertiser/get/ and /advertiser/info/ return everything at once, without page_info.
Walk the pages until page >= total_page. Reading only the first page with page_size=1000 works for small campaigns, but a report by ad and day goes past that quickly.
Order
- Campaigns, ad groups and ads come by descending id (newest first).
- Reports come by ascending time dimension and then by descending id, unless you pass
order_fieldandorder_type.
Smaller responses
fields(a JSON list) restricts the keys of each item. An unknown field answers40002 fields: Invalid field <f>.exclude_field_types_in_response=["NULL_FIELD"]drops keys with null values.
Filters
filtering is a JSON object on the campaign, ad group and ad lists, and a list of {field_name, filter_type, filter_value} on reports. Id lists take up to 100 items (beyond that, 40011). Deleted objects only show up with primary_status STATUS_ALL (see Edit and pause).