addetailsprompt.txt•2.1 kB
I want to make an API call to https://api.scrapecreators.com/v1/google/ad.
Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.
Here are the details:
Endpoint: GET https://api.scrapecreators.com/v1/google/ad
Description: Get the details for an ad. I'm using an OCR to get the text from the ad, so it might not be 100% accurate. If you find any errors or irregularities, please email me: adrian@thewebscrapingguy.com
Required Headers:
- x-api-key: Your API key
Parameters:
- url (string) (Required): The url of the ad
Example Response:
{
"success": true,
"advertiserId": "AR01614014350098432001",
"creativeId": "CR07443539616616939521",
"firstShown": null,
"lastShown": "2025-06-18T18:09:00.000Z",
"format": "text",
"overallImpressions": {
"min": null,
"max": null
},
"creativeRegions": [
{
"regionCode": "US",
"regionName": "United States"
}
],
"regionStats": [
{
"regionCode": "US",
"regionName": "United States",
"firstShown": null,
"lastShown": "2025-06-18T05:00:00.000Z",
"impressions": {},
"platformImpressions": []
}
],
"variations": [
{
"destinationUrl": "shop.lululemon.com/gifts-for-all",
"headline": "lululemonⓇ Official Site - Best Birthday Gifts",
"description": "Find The Perfect Gifts At lululemon . We Have You Covered . Shop Online For Your Gifts . Birthday Gifts For Everyone ...",
"allText": "Sponsored Ω lululemon shop.lululemon.com/gifts-for-all lululemonⓇ Official Site - Best Birthday Gifts Find The Perfect Gifts At lululemon . We Have You Covered . Shop Online For Your Gifts . Birthday Gifts For Everyone ...",
"imageUrl": "https://tpc.googlesyndication.com/archive/simgad/2201045439314643090"
},
{
"destinationUrl": "shop.lululemon.com",
"headline": "Work Pants, But Stretchy",
"description": "Move In Lightweight, Comfortable Work Pants That Take Your Day In New Directions."
}
]
}