Get a Microsoft ad's details
curl --request POST \
--url https://api.stophy.dev/v1/microsoft/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/microsoft/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/microsoft/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": {
"id": "<string>",
"advertiser": {
"id": "<string>",
"name": "<string>"
},
"headline": "<string>",
"text": "<string>",
"link": {
"url": "<string>",
"caption": "<string>"
},
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"paidBy": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"impressions": {
"min": 0,
"max": 0
},
"countries": [
{
"country": "<string>",
"share": 123
}
],
"targeting": [
{
"isExcluded": true,
"type": "<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
}
}Microsoft
Microsoft ad API
Call the Microsoft ad API to get advertiser, headline, text, link, images and paid by, as JSON or markdown. 1 credit.
POST
/
v1
/
microsoft
/
ads
/
ad
Get a Microsoft ad's details
curl --request POST \
--url https://api.stophy.dev/v1/microsoft/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/microsoft/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/microsoft/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": {
"id": "<string>",
"advertiser": {
"id": "<string>",
"name": "<string>"
},
"headline": "<string>",
"text": "<string>",
"link": {
"url": "<string>",
"caption": "<string>"
},
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"paidBy": "<string>",
"firstShownAt": "2023-11-07T05:31:56Z",
"lastShownAt": "2023-11-07T05:31:56Z",
"impressions": {
"min": 0,
"max": 0
},
"countries": [
{
"country": "<string>",
"share": 123
}
],
"targeting": [
{
"isExcluded": true,
"type": "<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:
microsoft.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.microsoft.ads.ad({ ad: "1234567890123" });
console.log(result.data.ad);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.microsoft.ads.ad(ad="1234567890123")
print(result["data"]["ad"])
curl -X POST https://api.stophy.dev/v1/microsoft/ads/ad \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"ad":"1234567890123"}'
stophy microsoft ads ad 1234567890123
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Pattern:
^\d{1,20}$