{"slug": "how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google", "title": "How to give an AI agent a live view of competitor ads on Google", "summary": "A developer built the Google Ads Transparency Center Scraper, an Apify Actor that returns live competitor ad data—advertiser name, country, format, firstShown and lastShown dates, daysShown, targetDomain and adUrl—as one row per creative, queryable by advertiser name, domain or ID. The tool can be registered as an agent tool or added to Apify's MCP server so a language model can pull current ads instead of relying on stale training data, and it charges $1.49 per 1,000 ads.", "body_md": "Ask a language model what ads a competitor is running this week and it can only guess. Its training data is months old, and without a tool it has no way to read Google's Ads Transparency Center. If you want an agent to write a competitor brief, the agent needs a tool that returns current ads as data.\n\nGoogle publishes ads from verified advertisers in the [Ads Transparency Center](https://adstransparency.google.com/). I built the [Google Ads Transparency Center Scraper](https://apify.com/zinin/google-ads-transparency-scraper?fpr=u5ov8x&utm_source=devto&utm_medium=social&utm_campaign=apify-actors&utm_content=google-ads-competitor-ads-for-ai-agents) so that an agent or a script can ask for an advertiser name, a domain or an advertiser ID and get one row per ad creative back.\n\n`firstShown` date can mark a new campaign. Treat it as a lead and open the ad before you call it a launch.`daysShown` have been kept in rotation for months. Treat them as candidates for \"what this advertiser keeps paying for\", then open them and judge for yourself.\nThis is the input of a successful run (`d7fi4heCuflrccCu1`, build 0.3.1, November 22, 2026). It is deliberately tiny:\n\n```\n{\n  \"advertisers\": [\"nike.com\"],\n  \"maxAdsPerAdvertiser\": 2,\n  \"maxItems\": 2,\n  \"includeRegions\": false,\n  \"region\": \"anywhere\",\n  \"format\": \"all\"\n}\n```\n\nIt returned two ads and one summary row. Here are the fields an agent actually needs, copied from the output:\n\n```\n[\n  {\n    \"advertiserName\": \"Nike Retail BV\",\n    \"advertiserCountry\": \"NL\",\n    \"format\": \"text\",\n    \"firstShown\": \"2025-10-24T05:30:16.000Z\",\n    \"lastShown\": \"2026-11-22T14:39:31.000Z\",\n    \"daysShown\": 396,\n    \"targetDomain\": \"nike.com\"\n  },\n  {\n    \"advertiserName\": \"INITIATIVE MEDIA B.V.\",\n    \"advertiserCountry\": \"NL\",\n    \"format\": \"video\",\n    \"firstShown\": \"2026-11-18T12:27:48.000Z\",\n    \"lastShown\": \"2026-11-22T14:38:46.000Z\",\n    \"daysShown\": 5,\n    \"targetDomain\": \"nike.com\"\n  }\n]\n```\n\nTwo details are worth noticing. The second ad for nike.com sits under the advertiser account of INITIATIVE MEDIA B.V., a media agency, so a domain search catches ads that a search for the brand name could miss. And each row carries `adUrl`, a link to the creative in the Transparency Center, so a person can check what the model is talking about.\n\nThe third row is a summary for the input (`\"notFoundAnalysis\": \"ok\", \"ads\": 2`). Filter rows without `creativeId` before you hand the list to a model.\n\nAny agent that can make an HTTP call can use it. This Python function runs the Actor synchronously through the Apify API, asks for ads shown since a given date and keeps the ones first shown in that window:\n\n``` python\nimport os\nfrom datetime import date, timedelta\n\nimport requests\n\nURL = (\"https://api.apify.com/v2/acts/zinin~google-ads-transparency-scraper\"\n       \"/run-sync-get-dataset-items\")\n\ndef new_competitor_ads(domains, days=7):\n    since = (date.today() - timedelta(days=days)).isoformat()\n    payload = {\n        \"advertisers\": domains,           # names, domains or AR... IDs, up to 20\n        \"dateFrom\": since,                # ads shown on or after this date\n        \"maxAdsPerAdvertiser\": 50,\n        \"includeRegions\": False,          # True adds one request per ad\n    }\n    resp = requests.post(\n        URL,\n        json=payload,\n        headers={\"Authorization\": f\"Bearer {os.environ['APIFY_TOKEN']}\"},\n        timeout=300,\n    )\n    resp.raise_for_status()               # a refused run comes back as an HTTP error\n    ads = [r for r in resp.json() if r.get(\"creativeId\")]\n    return [r for r in ads if (r.get(\"firstShown\") or \"\")[:10] >= since]\n```\n\nRegister the function as a tool in your agent framework and describe it in one sentence: \"Returns Google ads that these advertisers first showed in the last N days.\" The model then decides when to call it and writes the brief from rows instead of memory. You can also add the Actor to Apify's MCP server if your client speaks MCP.\n\nThe Actor charges **$1.49 per 1,000 ads** ($0.00149 per ad), with no start fee. A run that finds nothing costs nothing in Actor charges.\n\nThe limits are real, so plan around them:\n\n`previewImageUrl: null` and a `previewScriptUrl`, which renders the ad only in a browser.` includeRegions` is on, and that makes the run slower.\nTry the [Google Ads Transparency Center Scraper](https://apify.com/zinin/google-ads-transparency-scraper?fpr=u5ov8x&utm_source=devto&utm_medium=social&utm_campaign=apify-actors&utm_content=google-ads-competitor-ads-for-ai-agents) on one competitor first. If the rows are useful, put the function behind your agent and let it run weekly.\n\n*Disclosure: I maintain this Actor. Drafted with AI assistance using the cited successful run. This article contains Apify affiliate links; I may earn a commission if you sign up for a paid plan through them.*", "url": "https://wpnews.pro/news/how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google", "canonical_source": "https://dev.to/timmyzinin/how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google-1p0o", "published_at": "2026-11-23 19:32:16+00:00", "updated_at": "2026-11-23 19:42:53.779733+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "agent-protocols", "large-language-models"], "entities": ["Google Ads Transparency Center", "Apify", "Nike", "INITIATIVE MEDIA B.V.", "Google"], "also_reported_by": [], "takeaway": "Registering the scraper as an agent tool that returns one row per ad creative with creativeId, firstShown and daysShown lets a model write competitor briefs from live Ads Transparency Center data instead of stale training memory, at $1.49 per 1,000 ads.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google", "markdown": "https://wpnews.pro/news/how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google.md", "text": "https://wpnews.pro/news/how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google.txt", "jsonld": "https://wpnews.pro/news/how-to-give-an-ai-agent-a-live-view-of-competitor-ads-on-google.jsonld"}}