Get a Meta ad's details
curl --request POST \
--url https://api.stophy.dev/v1/meta/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/meta/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/meta/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>",
"isActive": true,
"versions": 0,
"id": "<string>",
"page": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"categories": [
"<string>"
],
"likes": 0
},
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"platforms": [
"<string>"
],
"format": "<string>",
"text": "<string>",
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"caption": "<string>"
},
"cta": {
"text": "<string>",
"type": "<string>"
},
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>",
"thumbnail": "<string>"
}
],
"cards": [
{
"text": "<string>",
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"caption": "<string>"
},
"cta": {
"text": "<string>",
"type": "<string>"
},
"image": "<string>",
"video": {
"url": "<string>",
"thumbnail": "<string>"
}
}
],
"categories": [
"<string>"
],
"paidBy": "<string>",
"spend": {
"min": 0,
"max": 0
},
"currency": "<string>",
"impressions": {
"min": 0,
"max": 0
},
"reach": {
"min": 0,
"max": 0
},
"countries": [
"<string>"
]
},
"details": {
"advertiser": {
"description": "<string>",
"category": "<string>",
"likes": 0,
"verification": "<string>",
"instagram": "<string>",
"instagramFollowers": 0
},
"audience": {
"ageGender": [
{
"female": 123,
"male": 123,
"unknown": 123,
"age": "<string>"
}
],
"regions": [
{
"share": 123,
"region": "<string>"
}
]
},
"euReach": {
"total": 0,
"byCountry": [
{
"female": 0,
"male": 0,
"unknown": 0,
"country": "<string>",
"age": "<string>"
}
]
},
"payers": [
{
"paidBy": "<string>",
"beneficiary": "<string>"
}
]
}
},
"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
}
}Meta
Meta ad API
Call the Meta ad API to get ad and details, as JSON or markdown. 2 credits.
POST
/
v1
/
meta
/
ads
/
ad
Get a Meta ad's details
curl --request POST \
--url https://api.stophy.dev/v1/meta/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/meta/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/meta/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>",
"isActive": true,
"versions": 0,
"id": "<string>",
"page": {
"id": "<string>",
"name": "<string>",
"url": "<string>",
"avatar": "<string>",
"categories": [
"<string>"
],
"likes": 0
},
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"platforms": [
"<string>"
],
"format": "<string>",
"text": "<string>",
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"caption": "<string>"
},
"cta": {
"text": "<string>",
"type": "<string>"
},
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"videos": [
{
"url": "<string>",
"thumbnail": "<string>"
}
],
"cards": [
{
"text": "<string>",
"link": {
"url": "<string>",
"title": "<string>",
"description": "<string>",
"caption": "<string>"
},
"cta": {
"text": "<string>",
"type": "<string>"
},
"image": "<string>",
"video": {
"url": "<string>",
"thumbnail": "<string>"
}
}
],
"categories": [
"<string>"
],
"paidBy": "<string>",
"spend": {
"min": 0,
"max": 0
},
"currency": "<string>",
"impressions": {
"min": 0,
"max": 0
},
"reach": {
"min": 0,
"max": 0
},
"countries": [
"<string>"
]
},
"details": {
"advertiser": {
"description": "<string>",
"category": "<string>",
"likes": 0,
"verification": "<string>",
"instagram": "<string>",
"instagramFollowers": 0
},
"audience": {
"ageGender": [
{
"female": 123,
"male": 123,
"unknown": 123,
"age": "<string>"
}
],
"regions": [
{
"share": 123,
"region": "<string>"
}
]
},
"euReach": {
"total": 0,
"byCountry": [
{
"female": 0,
"male": 0,
"unknown": 0,
"country": "<string>",
"age": "<string>"
}
]
},
"payers": [
{
"paidBy": "<string>",
"beneficiary": "<string>"
}
]
}
},
"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:
meta.ads.ad - Returns:
datahasad,details. - Cost: 2 credits. 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.meta.ads.ad({ ad: "1234567890123456" });
console.log(result.data.ad);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.meta.ads.ad(ad="1234567890123456")
print(result["data"]["ad"])
curl -X POST https://api.stophy.dev/v1/meta/ads/ad \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"ad":"1234567890123456"}'
stophy meta ads ad 1234567890123456
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json