# Google Ad Library API (ScrapeIO)

3 endpoints for public Google Ad Library data. Same response format and field names as every other platform.

## Basics

- Base URL: `https://scrapeio.com`
- Auth: send your key in the `x-api-key` header. Get a key at https://scrapeio.com/login (100 free credits, no card).
- Every endpoint is a GET with query parameters and returns JSON:
  `{ "success": true, "cached": false, "credits_used": 1, "credits_remaining": 99, "data": { ... } }`
- Field names are the same on every platform (`handle`, `followers`, `plays`, `likes`, `comments`, `created_at`).
- Lists return `data.items`, `data.cursor` and `data.has_more`. Pass `cursor` back to get the next page.
- Each endpoint has one listed price. Cached repeats, failed calls, private and not-found answers cost 0.
- Limit: 300 requests a minute per key.

## Errors

| Status | Meaning | Charged |
| --- | --- | --- |
| 200 | Success | Yes, unless cached |
| 400 | A parameter is missing or wrong | No |
| 401 | The key is missing or invalid | No |
| 402 | Not enough credits | No |
| 403 | The account or post is private | No |
| 404 | Not found on the platform | No |
| 429 | More than 300 requests a minute | No |
| 502 | Every source is down; retry shortly | No |

### GET /v1/google/ad

Ad Details Price: 5 credits. MCP tool: `google_ad`.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | yes | The url of the ad |
| `cache_max_age` | string (1d, 3d, 7d, 14d, 30d) | no | If we have a response in the cache that is this many days old or newer, return the cached response (0 credits, with "cached": true and a "ca |

```bash
curl "https://scrapeio.com/v1/google/ad?url=..." -H "x-api-key: $SCRAPEIO_API_KEY"
```

### GET /v1/google/adLibrary/advertisers/search

Advertiser Search Price: 5 credits. MCP tool: `google_adlibrary_advertisers_search`.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | yes | The query to search for |
| `region` | string | no | 2-letter country code to search in. |

```bash
curl "https://scrapeio.com/v1/google/adLibrary/advertisers/search?query=coffee" -H "x-api-key: $SCRAPEIO_API_KEY"
```

### GET /v1/google/company/ads

Company Ads Price: up to 125 credits. MCP tool: `google_company_ads`.

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | no | The domain of the company |
| `advertiser_id` | string | no | The advertiser id of the company |
| `topic` | string (all, political) | no | The topic to search for. |
| `region` | string | no | The region to search for. |
| `start_date` | string | no | Start date to search for. |
| `end_date` | string | no | End date to search for. |
| `platform` | string (google_maps, google_play, google_search, google_shopping, youtube) | no | Platform to search for. |
| `format` | string (text, image, video) | no | Ad format to search for. |
| `get_ad_details` | string | no | Set to true to get the ad details. |
| `cursor` | string | no | Cursor to paginate through results |

```bash
curl "https://scrapeio.com/v1/google/company/ads" -H "x-api-key: $SCRAPEIO_API_KEY"
```
