Get a TikTok ad's details and reach
curl --request POST \
--url https://api.stophy.dev/v1/tiktok/ads/ad \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ad: '<string>'})
};
fetch('https://api.stophy.dev/v1/tiktok/ads/ad', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/tiktok/ads/ad"
payload = { "ad": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"ad": {
"url": "<string>",
"id": "<string>",
"advertiser": {
"id": "<string>",
"name": "<string>",
"country": "<string>"
},
"headline": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"reach": {
"min": 0,
"max": 0
},
"video": "<string>",
"thumbnail": "<string>",
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"paidBy": "<string>",
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"caption": "<string>"
},
"cta": {
"text": "<string>",
"type": "<string>"
},
"objective": "<string>",
"category": "<string>",
"targeting": {
"audienceSize": {
"min": 0,
"max": 0
},
"impressions": {
"min": 0,
"max": 0
},
"countries": [
"<string>"
],
"languages": [
"<string>"
],
"interests": "<string>",
"regions": [
{
"country": "<string>",
"impressions": {
"min": 0,
"max": 0
},
"ages": [
"<string>"
],
"genders": [
"<string>"
],
"breakdown": [
{
"age": "<string>",
"gender": "<string>",
"impressions": {
"min": 0,
"max": 0
}
}
]
}
]
}
}
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}TikTok
TikTok ad API
Call the TikTok ad API to get advertiser, headline, first shown at, last shown at, reach and video, as JSON or markdown. 1 credit.
POST
/
v1
/
tiktok
/
ads
/
ad
Get a TikTok ad's details and reach
curl --request POST \
--url https://api.stophy.dev/v1/tiktok/ads/ad \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ad: '<string>'})
};
fetch('https://api.stophy.dev/v1/tiktok/ads/ad', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/tiktok/ads/ad"
payload = { "ad": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"ad": {
"url": "<string>",
"id": "<string>",
"advertiser": {
"id": "<string>",
"name": "<string>",
"country": "<string>"
},
"headline": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"reach": {
"min": 0,
"max": 0
},
"video": "<string>",
"thumbnail": "<string>",
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"paidBy": "<string>",
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"caption": "<string>"
},
"cta": {
"text": "<string>",
"type": "<string>"
},
"objective": "<string>",
"category": "<string>",
"targeting": {
"audienceSize": {
"min": 0,
"max": 0
},
"impressions": {
"min": 0,
"max": 0
},
"countries": [
"<string>"
],
"languages": [
"<string>"
],
"interests": "<string>",
"regions": [
{
"country": "<string>",
"impressions": {
"min": 0,
"max": 0
},
"ages": [
"<string>"
],
"genders": [
"<string>"
],
"breakdown": [
{
"age": "<string>",
"gender": "<string>",
"impressions": {
"min": 0,
"max": 0
}
}
]
}
]
}
}
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}- Endpoint:
tiktok.ads.ad - Returns:
datahasad. - Cost: 1 credit. Failed calls cost nothing.
- Paging: No.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.tiktok.ads.ad({ ad: "1234567890123456" });
console.log(result.data.ad);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.tiktok.ads.ad(ad="1234567890123456")
print(result["data"]["ad"])
curl -X POST https://api.stophy.dev/v1/tiktok/ads/ad \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"ad":"1234567890123456"}'
stophy tiktok ads ad 1234567890123456
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json