Google Ads Transparency Center Scraper 如何讓 AI 智能體查看 Google 上的競爭對手廣告
How to give an AI agent a live view of competitor ads on Google
作者 Tim Zinin 示範如何使用 Google Ads Transparency Center Scraper,讓 AI 智能體取得 Google 上競爭對手目前投放的廣告資料。工具可按廣告主名稱、網域或廣告主 ID 查詢,並透過 HTTP 呼叫或 Apify 的 MCP server 接入 Agent。資料只顯示廣告有否投放及投放時間,不包含支出、點擊或成效。
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.
Google publishes ads from verified advertisers in the Ads Transparency Center. I built the Google Ads Transparency Center Scraper 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.
What an agent can do with it
- Weekly competitor brief. Pull ads for five competitor domains every Monday and ask the model to summarize only the creatives that were first shown in the last seven days.
-
Launch detection. A new video creative with a recent
firstShowndate can mark a new campaign. Treat it as a lead and open the ad before you call it a launch. -
Long-runner review. Ads with a high
daysShownhave been kept in rotation for months. Treat them as candidates for "what this advertiser keeps paying for", then open them and judge for yourself.
A real run
This is the input of a successful run (d7fi4heCuflrccCu1, build 0.3.1, November 22, 2026). It is deliberately tiny:
{
"advertisers": ["nike.com"],
"maxAdsPerAdvertiser": 2,
"maxItems": 2,
"includeRegions": false,
"region": "anywhere",
"format": "all"
}
It returned two ads and one summary row. Here are the fields an agent actually needs, copied from the output:
[
{
"advertiserName": "Nike Retail BV",
"advertiserCountry": "NL",
"format": "text",
"firstShown": "2025-10-24T05:30:16.000Z",
"lastShown": "2026-11-22T14:39:31.000Z",
"daysShown": 396,
"targetDomain": "nike.com"
},
{
"advertiserName": "INITIATIVE MEDIA B.V.",
"advertiserCountry": "NL",
"format": "video",
"firstShown": "2026-11-18T12:27:48.000Z",
"lastShown": "2026-11-22T14:38:46.000Z",
"daysShown": 5,
"targetDomain": "nike.com"
}
]
Two 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.
The third row is a summary for the input ("notFoundAnalysis": "ok", "ads": 2). Filter rows without creativeId before you hand the list to a model.
Wiring it into an agent
Any 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:
import os
from datetime import date, timedelta
import requests
URL = ("https://api.apify.com/v2/acts/zinin~google-ads-transparency-scraper"
"/run-sync-get-dataset-items")
def new_competitor_ads(domains, days=7):
since = (date.today() - timedelta(days=days)).isoformat()
payload = {
"advertisers": domains, # names, domains or AR... IDs, up to 20
"dateFrom": since, # ads shown on or after this date
"maxAdsPerAdvertiser": 50,
"includeRegions": False, # True adds one request per ad
}
resp = requests.post(
URL,
json=payload,
headers={"Authorization": f"Bearer {os.environ['APIFY_TOKEN']}"},
timeout=300,
)
resp.raise_for_status() # a refused run comes back as an HTTP error
ads = [r for r in resp.json() if r.get("creativeId")]
return [r for r in ads if (r.get("firstShown") or "")[:10] >= since]
Register 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.
Price and limits
The 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.
The limits are real, so plan around them:
- Google sometimes refuses requests. Current builds fail the run loudly when the source refuses and no ads come back, instead of reporting an empty success. In the last 30 days, 2 of 23 public runs failed.
- Some ads come without a plain preview image. Both ads in the run above have
previewImageUrl: nulland apreviewScriptUrl, which renders the ad only in a browser. - Countries per ad are only filled when
includeRegionsis on, and that makes the run slower. - The Transparency Center shows that an ad ran and when. It says nothing about spend, clicks or results, and a model should not pretend otherwise.
Try the Google Ads Transparency Center Scraper on one competitor first. If the rows are useful, put the function behind your agent and let it run weekly.
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.
來源:DEV Community · dev.to

