# Ad Library Scraper \[$2/1K💰] | Meta+Google+TikTok+LinkedIn Ads (`ahmed_jasarevic/ad-library-scraper`) Actor

Scrape Meta Ad Library, Google Ads Transparency Center, TikTok and LinkedIn ads in one run: ad copy, CTAs, destination URLs, creative assets, run dates and publisher platforms in one unified dataset. Built for competitor ad research, creative intelligence and campaign monitoring. $2 per 1,000 ads.

- **URL**: https://apify.com/ahmed_jasarevic/ad-library-scraper.md
- **Developed by:** [Ahmed Jasarevic](https://apify.com/ahmed_jasarevic) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.95 / 1,000 ad scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Scraper

Extract ads from four transparency libraries — Meta Ad Library, Google Ads Transparency Center, TikTok and LinkedIn — with one query, into one unified dataset: ad copy, headlines, CTAs, destination URLs, creative assets, run dates and publisher platforms, at $2 per 1,000 ads.

**Built for:**

- Competitor ad research and creative intelligence
- Tracking which offers and angles rivals are running
- Agency reporting and market-monitoring dashboards
- Ad compliance and brand-safety checks across platforms
- Building an ads database for a brand, keyword or domain

### Research Competitor Ads Across Meta, Google, TikTok & LinkedIn

Enter one brand, keyword or domain (e.g. `nike`, `nike.com`, or a Google `AR...` advertiser id) and choose the platforms to scrape — all four by default. Each platform paginates until it reaches `maxItems`, and every ad lands as one row with a `platform` tag plus normalized fields: advertiser, title, body, CTA, destination URL, image/video URLs, first/last shown dates and the ad-library URL. Platform extras come along too: Meta `publisherPlatforms`, EU spend/reach ranges and `isActive`; TikTok performance metrics (CTR, likes, objective, industry) outside the EU/UK/CH library; Google `AR...` advertiser ids; LinkedIn format labels.

### How It Works

![How the Ad Library Scraper works: one query fans out to Meta, Google, TikTok and LinkedIn, then normalizes every ad into one dataset.](https://api.apify.com/v2/key-value-stores/oeuA0kLOyhbRM4fzt/records/how-it-works-ad-library.webp)

Each library is read through its own public, unauthenticated surface — no developer app, no access token, no approval queue:

| Platform | Access path |
| --- | --- |
| Meta | Direct HTTP: server-rendered first page + GraphQL cursor pagination (no browser; residential proxy for pages 2+) |
| Google | Internal JSON RPC executed inside the transparency site's own page context |
| TikTok | Signed HTTP for keyword search (EU/UK/CH: the Commercial Content Library via page search; elsewhere: Creative Center Top Ads) |
| LinkedIn | Headless browser, server-rendered result cards parsed from the DOM |

Meta serves its first page from any IP, but its GraphQL pagination needs a residential-class exit; Google and TikTok throttle anonymous datacenter traffic, and LinkedIn throttles datacenter ranges. A residential proxy is therefore strongly recommended for runs above 30 Meta ads and for repeated or large runs (`proxyConfiguration`). No private account data is read; the optional TikTok cookie session is used only to reach the same public Creative Center results, and no CAPTCHA solving is performed.

### Input Parameters

| Field | Type | Required | Default | Notes |
| --- | --- | --- | --- | --- |
| `query` | string | Yes | — | Brand, keyword or domain: `nike`, `nike.com`, `meal prep`, or a Google `AR...` advertiser id. |
| `platforms` | array | No | all four | Subset of `meta`, `google`, `tiktok`, `linkedin`. |
| `country` | string | No | `US` | ISO 3166-1 alpha-2 code (US, GB, DE, FR, RS…). TikTok uses its full Commercial Content Library for EU/UK/CH countries and Top Ads elsewhere. |
| `maxItems` | integer | No | `10` | Max ads **per platform**; each platform paginates until it is reached. Raise it for full exports. |
| `metaActiveOnly` | boolean | No | `true` | Only currently running Meta ads; turn off to include inactive ones. |
| `metaMediaType` | string | No | `all` | `all`, `image`, `video`, `meme`, `none`. |
| `tiktokOrderBy` | string | No | `for_you` | `for_you`, `ctr`, `like` (Top Ads countries only). |
| `tiktokPeriodDays` | integer | No | `30` | `7`, `30` or `180` — anonymous Top Ads sweep only. |
| `tiktokIndustry` | string | No | — | Creative Center industry key, e.g. `label_23110000000`. |
| `tiktokObjective` | string | No | — | Creative Center objective key, e.g. `campaign_objective_conversion`. |
| `proxyConfiguration` | object | No | — | Apify proxy. Recommended: Meta pagination needs a residential exit, and Google, TikTok and LinkedIn throttle anonymous traffic. |

### Output Fields

One dataset row per ad, with `platform` marking the source:

- **Common:** `platform`, `id`, `advertiser`, `advertiserId`, `domain`, `title`, `body`, `cta`, `destinationUrl`, `format`, `imageUrl`, `videoUrl`, `videoPreviewUrl`, `firstShown`, `lastShown`, `scrapedAt`, `adLibraryUrl`
- **Meta:** `pageUrl`, `publisherPlatforms`, `countries`, `isActive`, `spend` / `reachEstimate` (EU transparency data when Meta publishes it; `null` for US commercial ads)
- **TikTok:** `metrics` (`ctr`, `likes`, `costBucket`, `objective`, `industry` outside EU/UK/CH; `auditStatus` / `showMode` inside the library), `metrics.matchMethod` (`keyword`, `top-ads-filter`, `top-ads`)
- **Google:** `advertiserId` in `AR...` form, `firstShown` / `lastShown` from the transparency feed
- **LinkedIn:** `format` derived from the card label (image/video/carousel/text)

### Example Input

```json
{
  "query": "nike",
  "platforms": ["meta", "google", "tiktok", "linkedin"],
  "country": "US",
  "maxItems": 10
}
```

### Example Output

```json
{
  "platform": "meta",
  "id": "3928550510773109",
  "advertiser": "VYBS",
  "advertiserId": "431524636713229",
  "pageUrl": "https://www.facebook.com/61566942027285/",
  "domain": "play.google.com",
  "title": "Get paid to play. Cash out daily.",
  "body": "Why aren't you getting paid to game yet? ...",
  "cta": "Install now",
  "destinationUrl": "http://play.google.com/store/apps/details?id=co.vybs.app",
  "format": "image",
  "imageUrl": "https://scontent...",
  "videoUrl": null,
  "firstShown": "2026-06-30T07:00:00.000Z",
  "lastShown": "2026-10-17T19:00:00.000Z",
  "isActive": true,
  "publisherPlatforms": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK"],
  "countries": ["US"],
  "spend": null,
  "reachEstimate": null,
  "adLibraryUrl": "https://www.facebook.com/ads/library/?id=3928550510773109",
  "scrapedAt": "2026-10-18T12:00:00.000Z"
}
```

### Automate Competitor Ad Monitoring With Schedules & Webhooks

- **New-ads alerts:** schedule a daily run per competitor brand and diff rows by `id` against the previous run — flag anything new.
- **Launch tracking:** run with `metaActiveOnly: false` weekly to see when ads start and stop (`firstShown` / `lastShown`).
- **Cross-platform reporting:** one scheduled run with all four platforms feeds a single dashboard dataset; attach a dataset webhook to Slack or a warehouse.
- Scheduled, recurring runs also improve this actor's Store recommendation signals.

### Related Actors

- [Facebook Ads Library Scraper](https://apify.com/apify/facebook-ads-scraper) — the most-used ad-library actor on the Store, focused on Meta.
- [Facebook (Meta) Ads Library Scraper](https://apify.com/igolaizola/facebook-ad-library-scraper) — Meta-focused alternative with a large install base.
- [Google Ads Transparency Center Scraper & API](https://apify.com/scrapesage/google-ads-transparency-scraper) — Google transparency coverage as a standalone tool.
- [LinkedIn Ads Scraper](https://apify.com/silva95gustavo/linkedin-ad-library-scraper) — LinkedIn ad-library coverage on its own.
- [TikTok Ads Scraper](https://apify.com/lexis-solutions/tiktok-ads-scraper) — TikTok advertising data as a standalone tool.

### Frequently Asked Questions

#### Why use this actor instead of the official APIs?

Each platform's official route is limited or gated. Meta's official Ad Library API requires a Meta developer app plus identity confirmation, and outside the EU/UK its keyword search effectively covers only political and issue ads — ordinary commercial ads in most countries are not returned. Google publishes no official API for the Ads Transparency Center (its official `google_political_ads` feed is political-only). LinkedIn does expose an official Ad Library API, but access is requested through its developer portal under approval. This actor reads the public surfaces of all four platforms — the optional TikTok cookie session only unlocks the same public Creative Center keyword search — with no developer app, no access token and no approval step, including commercial ads in countries the official APIs do not cover.

#### Is there an official Google Ads Transparency API?

Not for general use. Google's transparency data can be browsed in the Ads Transparency Center (it exists because of EU transparency rules), and Google publishes a `google_political_ads` BigQuery dataset, but there is no documented API for arbitrary commercial-ads lookup. This actor reads the transparency center's own data directly — no login, no key — by advertiser name, domain or `AR...` id.

#### Do I need a login, cookies or an API key?

Not to run. Meta, Google, LinkedIn and the TikTok EU/UK/CH library work without any account, cookie or API key. Optionally, the Actor owner can store TikTok cookies (`TIKTOK_COOKIES` secret) to unlock server-side keyword search on Creative Center outside the EU/UK/CH, where the anonymous API has no keyword search. The cookies are used only by the TikTok adapter, are never written to the dataset, and the Actor falls back to anonymous Top Ads when they expire.

#### How long does the TikTok keyword session last?

TikTok's `sid_guard` cookie is valid for about 180 days (6 months) from login. TikTok does not issue a refresh token, so the only way to extend it is to log in again and re-import the cookies; the Actor cannot renew it silently. It reads the expiry date and notifies the owner 7 days before it lapses, then falls back to anonymous Top Ads if it expires. The other three platforms never need cookies.

#### Which countries are covered?

Meta, Google and LinkedIn filter by country natively, and TikTok uses its full Commercial Content Library for the EU/UK/CH countries and Creative Center Top Ads elsewhere (e.g. the US). Set `country` as an ISO alpha-2 code; Google maps it to its numeric region enum and drops the filter for unknown codes.

#### How is this different from a Facebook-only ads scraper?

It runs Meta, Google, TikTok and LinkedIn in one run and returns one normalized schema, so a single query gives you a competitor's whole visible ad footprint instead of four separate scrapes with four different output shapes.

#### Can I track when a competitor launches new ads?

Yes — schedule the actor daily per brand, then diff new rows by `id` (or `adLibraryUrl`). `firstShown` / `lastShown` and `isActive` tell you flight dates; `metaActiveOnly: false` keeps historical Meta ads in the mix.

### For AI Agents & LLM Apps

**Purpose:** returns ad rows from the Meta Ad Library, Google Ads Transparency Center, TikTok and LinkedIn for one query — unified schema, keyless.

**Minimal input:**

```json
{ "query": "nike", "country": "US", "maxItems": 50 }
```

**Single-platform variant:**

```json
{ "query": "nike.com", "platforms": ["google"], "maxItems": 100 }
```

**Output fields:** platform, id, advertiser, advertiserId, domain, title, body, cta, destinationUrl, format, imageUrl, videoUrl, videoPreviewUrl, firstShown, lastShown, isActive, publisherPlatforms, countries, spend, reachEstimate, adLibraryUrl, metrics, scrapedAt.

**Behaviors an agent should know:**

- `query` is required; `platforms` defaults to all four — restrict it to cut cost and runtime.
- `maxItems` is a **per-platform** cap (default `10`), so four platforms can return up to `4 × maxItems` rows. The default is intentionally small for quick test runs; raise it for exports.
- `metaActiveOnly` defaults to `true`; set it to `false` for historical Meta ads.
- `tiktokOrderBy` / `tiktokPeriodDays` apply only to Creative Center countries (e.g. US), not to EU/UK/CH library search.
- Set `proxyConfiguration` for Meta pagination and repeated or large runs — Meta's GraphQL pages need a residential exit, and Google, TikTok and LinkedIn throttle anonymous datacenter traffic.
- `spend` / `reachEstimate` are populated only where the platform publishes them (political/issue ads and EU transparency data); `null` is normal.

**Billing:** pay-per-event — `ad-scraped` at $0.002 per saved ad, plus a run-start event.

### Legal & Compliance Disclaimer

This actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Meta, Google, TikTok or LinkedIn. It reads publicly visible ad-library pages; when the owner configures optional TikTok cookies, those are used only to query the public Creative Center keyword search. No private account data is collected, and no CAPTCHA solving is performed. Ad libraries can contain personal data (e.g. payer names in political ads), which may be subject to GDPR or similar regimes; users are responsible for their own compliance with each platform's Terms of Service and applicable data-protection law when storing, redistributing or automating access to the collected data.

### SEO Keywords

ad library scraper, meta ad library api, facebook ads library scraper, google ads transparency center scraper, google ads transparency api, tiktok ad library, linkedin ad library api, scrape facebook ads, ad library api alternative, competitor ad research, ad transparency data, creative intelligence tool, competitor ads database, social media ads dataset, ad campaign monitoring, ad library without api key, commercial ads database, instagram ads scraper, ad library data export, competitor advertising research, ad spy data, multi-platform ad scraper

# Actor input Schema

## `query` (type: `string`):

Brand name, domain or keyword, e.g. "nike", "nike.com", "meal prep", "temu". Meta, Google and LinkedIn match on this. TikTok uses its full EU/UK/CH ad library for those countries; elsewhere (e.g. US) it searches Creative Center Top Ads when logged-in cookies are provided, otherwise it filters Top Ads client-side.

## `platforms` (type: `array`):

Which ad libraries to scrape. Meta uses direct HTTP; Google, TikTok and LinkedIn use a headless browser.

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

ISO 3166-1 alpha-2 country code (US, GB, DE, FR, RS, HR...). Filters ads by country on all four platforms. TikTok uses the full Commercial Content Library for EU/UK/CH countries and Creative Center Top Ads elsewhere.

## `maxItems` (type: `integer`):

Each platform paginates automatically until it reaches this many ads (or runs out of results). Default 10 keeps test runs quick and cheap; raise it (up to 10000) for full exports.

## `metaActiveOnly` (type: `boolean`):

When on, only ads that are currently running are returned. Turn off to include inactive ads too.

## `metaMediaType` (type: `string`):

Filter Meta ads by media type.

## `tiktokOrderBy` (type: `string`):

Top Ads ranking metric for countries without a full TikTok ad library (e.g. US). "for_you" is TikTok's default mix; "ctr" and "like" sort by that metric. Each sort also acts as a separate result set. Ignored for EU/UK/CH, which use the Commercial Content Library.

## `tiktokPeriodDays` (type: `integer`):

How far back Top Ads are taken from: 7, 30 or 180. Used in the anonymous Top Ads sweep only; ignored for EU/UK/CH (Commercial Content Library always searches the last 30 days) and in logged-in keyword mode (always uses the widest 180-day window, which contains the shorter periods).

## `tiktokIndustry` (type: `string`):

Industry key as used by Creative Center, e.g. "label_23110000000". Leave empty for all industries.

## `tiktokObjective` (type: `string`):

Campaign objective key, e.g. "campaign_objective_conversion". Leave empty for all objectives.

## `proxyConfiguration` (type: `object`):

Apify proxy. Strongly recommended: Meta's GraphQL pagination beyond the first 30 ads needs a residential exit, and Google, TikTok and LinkedIn throttle anonymous/datacenter traffic.

## Actor input object example

```json
{
  "query": "nike",
  "platforms": [
    "meta",
    "google",
    "tiktok",
    "linkedin"
  ],
  "country": "US",
  "maxItems": 10,
  "metaActiveOnly": true,
  "metaMediaType": "all",
  "tiktokOrderBy": "for_you",
  "tiktokPeriodDays": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Unified dataset rows: advertiser, ad copy, assets, run dates, publisher platforms and TikTok metrics.

# 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 = {
    "query": "nike",
    "platforms": [
        "meta",
        "google",
        "tiktok",
        "linkedin"
    ],
    "country": "US",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahmed_jasarevic/ad-library-scraper").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 = {
    "query": "nike",
    "platforms": [
        "meta",
        "google",
        "tiktok",
        "linkedin",
    ],
    "country": "US",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("ahmed_jasarevic/ad-library-scraper").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 '{
  "query": "nike",
  "platforms": [
    "meta",
    "google",
    "tiktok",
    "linkedin"
  ],
  "country": "US",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call ahmed_jasarevic/ad-library-scraper --silent --output-dataset

```

## MCP server setup

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

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/laCFpNmPhBODwctpH/builds/ADrZzKADRcTFfGJFk/openapi.json
