# Ad Library Scraper — Facebook, Meta, TikTok & Google Ads (`apivault_labs/ad-library-scraper-facebook-tiktok-google-ads`) Actor

Search competitor or niche ads across Facebook, Instagram, TikTok, Google and YouTube. Use exact brand lookup or keyword/product discovery. Get creatives, copy, landing pages and days running. No login or API keys. From $1.80/1K ads.

- **URL**: https://apify.com/apivault\_labs/ad-library-scraper-facebook-tiktok-google-ads.md
- **Developed by:** [Apivault Labs](https://apify.com/apivault_labs) (community)
- **Categories:** E-commerce, Marketing, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 1,000 ad creatives

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Ad Library Scraper — Facebook, Instagram, TikTok & Google Ads

Search public ad libraries across **Facebook, Instagram, TikTok, Google and
YouTube**. Track one exact competitor or switch to keyword discovery to find ads
from multiple advertisers in a niche. Get creatives, copy, landing pages and
days-running signals in one normalized dataset.

Built for **ecommerce, Shopify, dropshipping and DTC product research**. Find the
winning ads and winning products your competitors are scaling — *before* you spend
a dollar on your own tests. Creative research made trivial.

> ✅ **No login. No cookies. No API keys. No browser extensions.** Fast, bulk,
> pay-per-result — from $1.80/1K ads. Export CSV, JSON, Excel or via API/webhooks.

***

### 🚀 Why this one

| | This Actor | Typical ad scrapers |
|---|---|---|
| Platforms in one run | **Meta + Google + YouTube + TikTok** | One platform |
| Search modes | Exact competitor + keyword/product discovery | Usually one input type |
| Input | Domain, brand, keyword, advertiser ID or FB Page ID | Advertiser ID only |
| Media | **Playable videos & images, optional permanent copies** | Expiring raw links |
| Winning signal | **`daysRunning` on every ad** | Not available |
| Empty results | Free status row explains *why* (no ads / no match / error) | Silent zero |
| You're charged | **Only for ads actually delivered** | Often per run |

***

### 🎯 What you get per ad

- **The creative** — image or video, playable right in the results table. Optionally saved as a permanent copy that never expires.
- **The offer** — headline, ad copy, CTA, sitelinks.
- **The destination** — landing page URL and domain (Google & Meta).
- **The timing** — first shown, last shown, and `daysRunning`: the simplest winning-ad signal there is. An ad that's been live for 60 days is making money.
- **The reach** — placements (Facebook / Instagram / Messenger / Threads), TikTok impressions & audience size.
- **The provenance** — competitor mode verifies the store domain/page name;
  discovery mode labels keyword-derived rows. Both expose `matchConfidence`,
  `matchSignals` and `searchQuery` so downstream systems can audit the match.

Results are organized into six focused views: **Ads overview**, **Creatives & media**,
**Winning signals**, **Copy & offer**, **Landing pages**, and **Run status**.

***

### Quick start

#### Track an exact competitor

```json
{
  "mode": "competitor",
  "domains": ["gymshark.com"],
  "region": "US",
  "maxItems": 20
}
```

Omit `region` to search worldwide. Google and Meta search all countries, while
TikTok sweeps the countries available in its public transparency library.

No domain? A brand name works just as well:

```json
{ "mode": "competitor", "searchQuery": ["Gymshark"], "region": "US", "maxItems": 20 }
```

#### Discover products, niches and offers

```json
{
  "mode": "discovery",
  "searchQuery": ["posture corrector", "skincare bundle"],
  "region": "US",
  "maxAdvertisers": 5,
  "maxItems": 30
}
```

Discovery mode inspects several matching Google advertisers and accepts the
platform libraries' keyword results on Meta and TikTok. Competitor mode keeps
strict brand matching to reduce unrelated ads.

***

### 💡 Use cases

- **Winning-product research** — sort by `daysRunning` and see what the market has been scaling for months.
- **Fresh-launch alerts** — set `startedWithinDays: 7` to see only what competitors launched this week.
- **Creative swipe file** — download permanent copies of the best-performing creatives in your niche.
- **Landing-page teardown** — collect where every ad sends traffic and study the funnels.
- **Agency audits** — a client's (or prospect's) full live ad footprint in one run.

***

### ⚙️ Input

| Field | Type | Description |
|---|---|---|
| `mode` | string | `competitor` for exact-brand matching; `discovery` for niche/product keyword search |
| `domains` | array | Competitor domains (e.g. `nike.com`) |
| `searchQuery` | array | Brand names or discovery keywords |
| `advertiserIds` | array | Exact Google advertiser IDs (`AR…`) |
| `metaPageIds` | array | Exact Facebook Page IDs |
| `region` | string | Country code (US, GB, DE…) or empty for anywhere |
| `startedWithinDays` | int | Only ads launched in the last N days (0 = all) |
| `maxAdvertisers` | int | Google advertisers per discovery keyword (default 5) |
| `maxItems` | int | Max ads per advertiser/source query (default 100) |
| `includeMeta` | bool | Facebook & Instagram ads (default on) |
| `includeTikTok` | bool | TikTok ads, EU/EEA + UK + CH + TR (default on) |
| `includeAdvertiserInfo` | bool | Verified advertiser name + country |
| `rehostGoogleVideos` / `rehostMetaMedia` / `rehostTikTokMedia` | bool | Optional permanent media copies; off by default for fast first runs |
| `maxRehostVideos` | int | Max media files to save per run (default 0) |
| `maxConcurrency` | int | Parallel competitors (default 2, benchmarked) |

***

### 💰 Pricing

Pay per result — **only for ads actually delivered** to your dataset:

- **$1.80 per 1,000 ads** on any paid Apify plan
- $5.00 per 1,000 ads on the Free plan
- Status rows (explaining why a competitor has no ads) are always **free**

Cap any run's spend with **Max total charge** in the run options — the actor stops
cleanly at your budget and keeps everything already delivered.

***

### ❓ FAQ

**Where does the data come from?**
The platforms' own public ad-transparency libraries — the same pages anyone can
browse, returned structured and in bulk.

**Which regions does TikTok cover?**
TikTok publishes its ad library only for the EU/EEA, UK, Switzerland and Türkiye
(EU transparency law). US TikTok ads aren't published by TikTok anywhere.
Meta and Google/YouTube work worldwide.

**Do TikTok ads include landing pages?**
TikTok doesn't publish destination URLs, so TikTok ads are matched by advertiser
name and carry the video, dates, impressions and audience size instead of a
landing link.

**How fresh is the data?**
Live. Every run queries the libraries in real time.

**Do I need a Facebook/Google/TikTok account?**
No. Nothing to connect, nothing to configure.

***

### MCP and AI agents

Use this Actor when an agent needs structured public ad intelligence rather than
general web search. Prefer a small `maxItems` (10–30) for interactive calls.

Decision rules:

- Known store, brand or Page ID → `mode: "competitor"`.
- Product, niche, hook or offer → `mode: "discovery"` with `maxAdvertisers: 3–5`.
- US-only request → set `region: "US"`; TikTok returns a free
  `region_unsupported` status row because its public library does not cover US ads.
- Enable media rehosting only if permanent creative files are required.
- Rows with `_status: true` are free diagnostics, not ads. Inspect `status` and
  `detail`; retry only `fetch_failed`. Do not retry `no_ads`,
  `no_advertiser_found`, `no_confirmed_match` or `region_unsupported` unchanged.

Example agent prompt: `Find active skincare offer ads in the US, return 20 rows,
rank by daysRunning, and summarize recurring hooks and landing-page domains.`

***

### ⚖️ Use responsibly

This tool structures publicly available advertising transparency data. It is not
affiliated with or endorsed by Meta, Google or TikTok. Use the data in line with
applicable laws and platform terms.

# Actor input Schema

## `mode` (type: `string`):

Competitor lookup finds one exact brand. Keyword discovery finds ads from several matching advertisers for a niche, product or offer.

## `domains` (type: `array`):

Website domains to spy on, e.g. nike.com. Each is matched to its advertiser and all live ads are returned.

## `searchQuery` (type: `array`):

Brand name in competitor mode (e.g. Gymshark), or a niche/product keyword in discovery mode (e.g. posture corrector or skincare).

## `advertiserIds` (type: `array`):

Exact Google advertiser IDs (start with AR…) if you already have them.

## `metaPageIds` (type: `array`):

Spy specific Facebook Page IDs on Meta Ad Library (more precise than a brand keyword). If empty, the domains/brand queries above are used.

## `region` (type: `string`):

Two-letter country code to filter ads by where they ran. Leave empty for worldwide (default) — all countries are searched.

## `startedWithinDays` (type: `integer`):

Return only ads that started running within the last N days, e.g. 7 for this week's launches. 0 = all ads.

## `maxAdvertisers` (type: `integer`):

Discovery mode only: how many matching Google advertisers to inspect per keyword.

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

How many creatives to return per advertiser. For a quick test keep it small (5-10).

## `includeMeta` (type: `boolean`):

Also return the competitor's live Meta Ad Library ads alongside Google/YouTube. Uses the same competitors above.

## `includeTikTok` (type: `boolean`):

Also search the TikTok Ad Library. Note: it covers EU/EEA + UK + CH + TR only (EU transparency law) — US ads are not published there.

## `includeAdvertiserInfo` (type: `boolean`):

Add the verified advertiser name and country to each ad.

## `rehostGoogleVideos` (type: `boolean`):

ON: videos are downloaded into run storage — playable forever, but the run is slower. OFF: direct links only — faster, but Google video links expire within hours (the ad page link always works).

## `rehostMetaMedia` (type: `boolean`):

ON: Facebook/Instagram images and videos are downloaded into run storage — links live forever, but the run is slower. OFF: direct Facebook CDN links — faster, but they expire in ~5 days.

## `rehostTikTokMedia` (type: `boolean`):

ON: TikTok videos/images are downloaded into run storage — links live forever. OFF: direct signed links — faster, but they expire in ~24 hours.

## `maxRehostVideos` (type: `integer`):

Maximum Google + Meta media files to save per run when downloads are on (100 MB per file limit).

## `maxConcurrency` (type: `integer`):

How many Meta competitors to fetch in parallel. Higher is faster but may increase rate limits. Recommended: 2.

## Actor input object example

```json
{
  "mode": "competitor",
  "domains": [
    "nike.com"
  ],
  "region": "",
  "startedWithinDays": 0,
  "maxAdvertisers": 5,
  "maxItems": 20,
  "includeMeta": false,
  "includeTikTok": false,
  "includeAdvertiserInfo": false,
  "rehostGoogleVideos": true,
  "rehostMetaMedia": true,
  "rehostTikTokMedia": true,
  "maxRehostVideos": 0,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

Normalized ad creatives across Google, YouTube, Facebook, Instagram and TikTok, plus free source-level status rows. Filter rows with \_status=true from ads.

## `summary` (type: `string`):

Run totals: advertisers resolved, ads delivered per platform, media files saved, charge-limit flag.

## `savedMedia` (type: `string`):

Permanent copies of ad creatives saved when the download options are on (MEDIA-\* records).

# 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 = {
    "domains": [
        "nike.com"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("apivault_labs/ad-library-scraper-facebook-tiktok-google-ads").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 = {
    "domains": ["nike.com"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("apivault_labs/ad-library-scraper-facebook-tiktok-google-ads").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 '{
  "domains": [
    "nike.com"
  ],
  "maxItems": 20
}' |
apify call apivault_labs/ad-library-scraper-facebook-tiktok-google-ads --silent --output-dataset

```

## MCP server setup

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

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/9gQOeVrfq8gbqm6ei/builds/Z1WR7u5GoUMTUYoFz/openapi.json
