# Ad Library Aggregator | Google Ads + Meta Ad Library (`andok/ad-library-aggregator`) Actor

Search Google Ads Transparency Center and Meta Ad Library by advertiser, domain or keyword and get one normalized ad schema. Agent-ready JSON. $0.002/ad + $0.02 start.

- **URL**: https://apify.com/andok/ad-library-aggregator.md
- **Developed by:** [Andok](https://apify.com/andok) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 ad founds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Ad Library Aggregator (Google Ads Transparency + Meta Ad Library)

Pull public ads for any advertiser, domain or keyword from the **Google Ads Transparency Center** and the **Meta Ad Library** and get them back in a single normalized schema. Use it for competitor research, creative swipe files, agency pitch prep, brand monitoring and agent workflows that need "what ads is this company running right now?" as clean JSON.

### Sources in v1

| Source | How it works | Notes |
|---|---|---|
| Google Ads Transparency Center | Public RPC used by the Transparency website. Search by advertiser name, domain (`nike.com`) or advertiser ID (`AR...`). | No login or key required. Region filter supported. |
| Meta Ad Library | Official Ad Library API when you provide `metaAccessToken`. Without a token the Actor tries the public HTML as a best effort. | Public HTML is normally login gated, so expect a structured error row without a token. |
| LinkedIn Ad Library | **Deferred** | Not part of v1. |

### Input

| Field | Required | Description |
|---|---|---|
| advertisers | one of | Names, domains, Google advertiser IDs or numeric Facebook Page IDs |
| searchTerms | one of | Keywords for Meta (also tried as advertiser names on Google) |
| sources | no | `google`, `meta` (default: both) |
| country | no | Two-letter code, default `US` |
| maxAdsPerQuery | no | Cap per query and source (1 to 1000, default 50) |
| metaAccessToken | no | Meta Ad Library API token, strongly recommended |
| metaActiveStatus | no | `ALL`, `ACTIVE`, `INACTIVE` |

```json
{
  "sources": ["google", "meta"],
  "advertisers": ["nike.com"],
  "searchTerms": ["running shoes"],
  "country": "US",
  "maxAdsPerQuery": 50,
  "metaAccessToken": "EAAB..."
}
```

### Normalized output

Every ad has the same fields regardless of platform:

```json
{
  "record_type": "ad",
  "platform": "google",
  "query": "nike.com",
  "ad_id": "CR06104121578226712577",
  "advertiser": "Nike Retail BV",
  "advertiser_id": "AR18378488041124659201",
  "creative_text": null,
  "creative_format": "image",
  "image_url": "https://tpc.googlesyndication.com/archive/simgad/14523556093465143668",
  "landing_url": "https://nike.com",
  "first_seen": "2025-10-22T15:13:15.000Z",
  "last_seen": "2026-10-19T01:35:42.000Z",
  "url": "https://adstransparency.google.com/advertiser/AR.../creative/CR...?region=US",
  "region": "US"
}
```

If a source fails, you get a row with `record_type: "error"` and an `error` message instead of a crashed run. Error rows are never charged.

### Pricing and cost math

- Actor start: **$0.02**
- **Ad found: $0.002** per unique ad returned

Example: 200 ads across Google and Meta cost 200 x $0.002 + $0.02 = **$0.42**. Use `maxAdsPerQuery` to cap spend, and set a maximum total charge on the run for a hard limit.

### Platform specifics and limitations

- **Google:** text and video creatives are rendered client side by Google, so `creative_text` is `null` for them and a preview URL is placed in `extra.preview_url` when available. `landing_url` is the advertiser domain Google reports, not the exact click-through URL.
- **Meta:** the Ad Library API returns ads delivered in the EU and UK plus political and issue ads elsewhere. Commercial ads outside those regions are not publicly exposed by Meta. Create a token in a Meta developer account that has completed Ad Library identity verification.
- Both sources can rate limit. The Actor retries and backs off, but very large runs may need to be split.
- Only public ad transparency data is collected. Respect each platform's terms.

### Reviews

If this Actor helped, leave a short Store review.

# Actor input Schema

## `sources` (type: `array`):

Ad libraries to query. LinkedIn Ad Library is deferred and not available in v1.

## `advertisers` (type: `array`):

Advertiser names, website domains (nike.com) or Google advertiser IDs (AR...). Domains and IDs give the most precise Google results. For Meta, numeric Facebook Page IDs are supported.

## `searchTerms` (type: `array`):

Keywords for the Meta Ad Library (also tried as advertiser names on Google).

## `country` (type: `string`):

Two-letter ISO country code. Meta: ad_reached_countries. Google: region filter (unsupported codes search all regions).

## `maxAdsPerQuery` (type: `integer`):

Upper bound of ads returned per advertiser/search term per source. You pay per ad.

## `maxAdvertisersPerQuery` (type: `integer`):

When a Google query is a plain name, how many matching advertiser accounts to expand.

## `metaAccessToken` (type: `string`):

Optional but strongly recommended. Free user access token from a verified Meta developer account (Ad Library API). Without it the Meta source falls back to best-effort public HTML, which is usually login-gated.

## `metaActiveStatus` (type: `string`):

Filter Meta ads by delivery status.

## `timeoutSeconds` (type: `integer`):

HTTP timeout per request.

## `useApifyProxy` (type: `boolean`):

Route Google Ads Transparency requests through Apify residential proxy. Google rate-limits datacenter IPs (HTTP 429).

## Actor input object example

```json
{
  "sources": [
    "google",
    "meta"
  ],
  "advertisers": [
    "nike.com"
  ],
  "country": "US",
  "maxAdsPerQuery": 50,
  "maxAdvertisersPerQuery": 3,
  "metaActiveStatus": "ALL",
  "timeoutSeconds": 30,
  "useApifyProxy": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `resultsCsv` (type: `string`):

No description

## `run` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sources": [
        "google",
        "meta"
    ],
    "advertisers": [
        "nike.com"
    ],
    "country": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("andok/ad-library-aggregator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "sources": [
        "google",
        "meta",
    ],
    "advertisers": ["nike.com"],
    "country": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("andok/ad-library-aggregator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sources": [
    "google",
    "meta"
  ],
  "advertisers": [
    "nike.com"
  ],
  "country": "US"
}' |
apify call andok/ad-library-aggregator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andok/ad-library-aggregator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bkzm3mi4GmdvIiQfq/builds/wrq9vtYz8LEaIxXee/openapi.json
