Get a Google ad's details
curl --request POST \
--url https://api.stophy.dev/v1/google/ads/ad \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad": "<string>",
"advertiser": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ad: '<string>', advertiser: '<string>'})
};
fetch('https://api.stophy.dev/v1/google/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/google/ads/ad"
payload = {
"ad": "<string>",
"advertiser": "<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>",
"advertiser": {
"url": "<string>",
"id": "<string>",
"name": "<string>",
"country": "<string>",
"isVerified": true
},
"format": "text",
"id": "<string>",
"domain": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"daysShown": 0,
"preview": "<string>",
"image": "<string>",
"paidBy": "<string>",
"variations": [
{
"preview": "<string>",
"image": "<string>",
"video": "<string>"
}
],
"impressions": {
"min": 0,
"max": 0
},
"regions": [
{
"country": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"impressions": {
"min": 0,
"max": 0
},
"platforms": [
{
"platform": "play",
"impressions": {
"min": 0,
"max": 0
}
}
]
}
],
"targeting": {
"demographics": {
"isIncluded": true,
"isExcluded": true
},
"geography": {
"isIncluded": true,
"isExcluded": true
},
"contextual": {
"isIncluded": true,
"isExcluded": true
},
"interests": {
"isIncluded": true,
"isExcluded": true
},
"customerLists": {
"isIncluded": true,
"isExcluded": true
}
}
}
},
"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
}
}Google
Google ad API
Call the Google ad API to get advertiser, domain, format, first shown at, last shown at and days shown, as JSON or markdown. 1 credit.
POST
/
v1
/
google
/
ads
/
ad
Get a Google ad's details
curl --request POST \
--url https://api.stophy.dev/v1/google/ads/ad \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad": "<string>",
"advertiser": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ad: '<string>', advertiser: '<string>'})
};
fetch('https://api.stophy.dev/v1/google/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/google/ads/ad"
payload = {
"ad": "<string>",
"advertiser": "<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>",
"advertiser": {
"url": "<string>",
"id": "<string>",
"name": "<string>",
"country": "<string>",
"isVerified": true
},
"format": "text",
"id": "<string>",
"domain": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"daysShown": 0,
"preview": "<string>",
"image": "<string>",
"paidBy": "<string>",
"variations": [
{
"preview": "<string>",
"image": "<string>",
"video": "<string>"
}
],
"impressions": {
"min": 0,
"max": 0
},
"regions": [
{
"country": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"impressions": {
"min": 0,
"max": 0
},
"platforms": [
{
"platform": "play",
"impressions": {
"min": 0,
"max": 0
}
}
]
}
],
"targeting": {
"demographics": {
"isIncluded": true,
"isExcluded": true
},
"geography": {
"isIncluded": true,
"isExcluded": true
},
"contextual": {
"isIncluded": true,
"isExcluded": true
},
"interests": {
"isIncluded": true,
"isExcluded": true
},
"customerLists": {
"isIncluded": true,
"isExcluded": true
}
}
}
},
"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:
google.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.google.ads.ad({ ad: "1234567890123456" });
console.log(result.data.ad);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.google.ads.ad(ad="1234567890123456")
print(result["data"]["ad"])
curl -X POST https://api.stophy.dev/v1/google/ads/ad \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"ad":"1234567890123456"}'
stophy google ads ad 1234567890123456
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.