Most public scrapers for the Google Ads Transparency Center launch a full Playwright or Puppeteer Chromium browser, navigate to the search page, and wait for client-side custom elements to hydrate. In production, that approach hits three bottlenecks: high memory overhead per run, frequent HTTP 302 redirects to /sorry/index captcha pages, and empty previewUrl fields because ad previews are injected asynchronously via octal-escaped content.js payloads.

In RevClamp AdPulse (@revclamp/google-ads-transparency-mcp - an independent intelligence tool by RevClamp, not affiliated with or endorsed by Google LLC), we replaced headless browser rendering with a pure Node.js (undici) two-stage Protobuf-JSON RPC pipeline.

1. Two-Stage Protobuf-JSON RPC (SearchSuggestions to SearchCreatives)

Instead of loading the frontend application, query the internal RPC endpoints directly with application/x-www-form-urlencoded payloads containing serialized f.req JSON:

const SUGGESTIONS_URL = 'https://adstransparency.google.com/anji/_/rpc/SearchService/SearchSuggestions?authuser='; const CREATIVES_URL = 'https://adstransparency.google.com/anji/_/rpc/SearchService/SearchCreatives?authuser='; export async function resolveAdvertiserEntity(queryText) { const body = new URLSearchParams({ 'f.req': JSON.stringify({ '1': queryText, '2': 50, '3': 10 }), }); const res = await fetch(SUGGESTIONS_URL, { method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' }, body, }); const json = await res.json(); // Tuple [1][1] = Advertiser Name, [1][2] = AR... Advertiser ID const match = (json?.['1'] ?? []).find((item) => item?.['1']?.['2']); return match ? { name: match['1']['1'], advertiserId: match['1']['2'] } : null; } 

2. Decoding Octal-Escaped content.js Previews Without Executing Remote Scripts

Text and image creatives frequently return a dynamically generated content.js script URL inside tuple [3][1][4]. Rather than executing third-party JavaScript inside a browser context, decode \xNN hex and \000 octal byte sequences deterministically over a bounded 512-kilobyte response stream to extract verified creative asset URLs and YouTube video IDs.

3. Fail-Closed Per-Creative Billing Parity (PAY_PER_EVENT)

When running on Apify (revclamp/google-ads-transparency-mcp) or via x402 USDC micropayments ($0.0012 per creative, $1.20 per 1,000 creatives), our billing state machine verifies that every charged creative ID is a unique member of the delivered batch before emitting settlement receipts. On warm containers (256 MB memory allocation), a 5-creative resolution and extraction batch completes in 775 milliseconds.