Google Ad Library API — Authentication — FetchLayer Docs
Documentation menu
FetchLayer FetchLayer API

Authentication

All requests use your FetchLayer API key as a Bearer token. No Google account, Cloud project, OAuth flow, or Google Ads API developer token is involved.

Sending requests

bash
curl -X POST https://api.fetchlayer.dev/google-ad-library/search-advertisers \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"Nike","region":"US"}'

Keep your key secret

Only use API keys in server-side code and rotate a key immediately if it is exposed.

Downloading media

The media download endpoint is a GET, and carries the same Bearer header. Because the key travels in a header rather than the URL, a media URL cannot be shared without also sharing the key.

bash
curl -X GET "https://api.fetchlayer.dev/google-ad-library/media?url=https%3A%2F%2Ftpc.googlesyndication.com%2F...&filename=nike-ad.mp4" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Range: bytes=0-65535" \
  --output nike-ad.mp4

Authentication errors

A missing or invalid key returns HTTP 401.

json
{
  "error": "Invalid API key"
}