Psst... Dessert Data connects all your marketing data into a neatly organized database. You can use the same query to pull spend for Bing, TikTok, or Google.
Don't worry about APIs changes or database uptime. We handle all that for you.
GET STARTED FREEhttps://business-api.tiktok.com/portal/auth?app_id={{ your app id}}&state=your_custom_params&redirect_uri=http%3A%2F%2Flocalhost%3A3000
http://localhost:3000/?auth_code={{ ignore this code }}&code={{ copy this code }}&state=your_custom_params
POST https://business-api.tiktok.com/open_api/v1.3/oauth2/access_token/
Content-Type:application/json
{
"secret": "{{$dotenv TIKTOK_SECRET}}",
"app_id": "{{$dotenv TIKTOK_APP_ID}}",
"auth_code": "{{ code copied from redirect URL }}"
}
{
"code": 0,
"message": "OK",
"request_id": "202309171942383471EF9E07779EA8057D",
"data": {
"access_token": "{{ save your access token }}",
"advertiser_ids": [
"{{ also note your advertiser ID }}"
],
"scope": [
4
]
}
}
GET https://business-api.tiktok.com/open_api/v1.3/report/integrated/get/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Access-Token: {{ your access token }}
metrics=["spend", "impressions"]
&data_level=AUCTION_CAMPAIGN
&end_date=2023-09-30
&page_size=10
&start_date=2023-09-01
&advertiser_id={{ YOUR ADVERTISER ID }}
&service_type=AUCTION
&report_type=BASIC
&page=1
&dimensions=["campaign_id", "stat_time_day"]
The response
{
"code": 0,
"message": "OK",
"request_id": "202309241836164B1BB5FF1A45D79D5D4B",
"data": {
"list": [
{
"metrics": {
"impressions": "635",
"spend": "5.00"
},
"dimensions": {
"stat_time_day": "2023-09-15 00:00:00",
"campaign_id": "1774149501261857"
}
},
{
"metrics": {
"impressions": "1004",
"spend": "5.00"
},
"dimensions": {
"stat_time_day": "2023-09-16 00:00:00",
"campaign_id": "1774149501261857"
}
},
...
],
"page_info": {
"total_number": 3,
"page": 1,
"total_page": 1,
"page_size": 3
}
}
}