# Facebook Ads Library Scraper - Meta & Instagram Ads, No Login (`adintel-labs/meta-ad-library-scraper`) Actor

Facebook Ad Library scraper for Meta & Instagram ads by keyword or Page: ad copy, headlines, CTAs, landing pages, images & videos, platforms, run dates, plus spend & reach where Meta discloses it. No login; optional official API token mode. $2 / 1,000 ads.

- **URL**: https://apify.com/adintel-labs/meta-ad-library-scraper.md
- **Developed by:** [Abi Fadeyi](https://apify.com/adintel-labs) (community)
- **Features:** Limited permissions
- **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 scrapeds

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

## Facebook Ads Library Scraper — Meta & Instagram ads with copy, CTAs, landing pages & spend

**Scrape the Facebook Ad Library (Meta Ad Library) without a Facebook account: every Facebook & Instagram ad for a keyword or Page, with ad copy, headline, CTA, landing page, images/videos, platforms and run dates — ready for spreadsheets, BI tools or AI.**

Extract ads from the public **[Meta Ad Library](https://www.facebook.com/ads/library/)** (Facebook, Instagram, Messenger, Audience Network, Threads) by **keyword** or **Facebook Page** — no Facebook login. Get clean, normalized JSON: **body text, headline, CTA, landing page, images & videos, carousel cards, platforms, start/end dates, active status**, plus **spend and impressions** where Meta discloses them (political/issue ads, EU).

Optional **official API mode**: paste your own free Meta Ad Library API token to use the Graph API `ads_archive` endpoint instead.

### What can you do with it?

- **Facebook ad spy / competitor research** — see every creative, hook and offer a rival is running right now and how long each has run.
- **Creative swipe files** — bulk-export image & video URLs, carousel cards and copy for a niche keyword.
- **Agency pitches & audits** — pull a prospect's and its competitors' Meta ads in minutes.
- **E-commerce & dropshipping research** — find which products and landing pages brands are pushing on Facebook and Instagram.
- **Political & EU transparency research** — spend and impression ranges where Meta discloses them.

### Quick start

1. Click **Try for free** (or *Start*) — the input is pre-filled with a small, fast example.
2. Change the brand / keyword, set *Max results*, and press **Start**.
3. Download the ads as JSON, CSV, Excel or HTML, or fetch them via API / integrations below.

```json
{
  "searchQueries": ["nike"],
  "country": "US",
  "activeStatus": "active",
  "maxResults": 20
}
```

Use `searchQueries` (keywords) or `pages` (Page IDs/URLs). Residential proxy is the default because Meta rate-limits pagination from datacenter IPs.

### Why this Meta Ad Library scraper?

- **Clean schema, not raw GraphQL** — dynamic creative (DCO) `{{product.name}}` placeholders are resolved to the real card copy; carousel cards are split out; dates are ISO.
- **Fast** — first 30 ads for a query in ~5 s; reads the server-rendered results directly, then pages through Meta's own pagination query.
- **Resilient** — passes Meta's JS challenge automatically, rotates residential sessions on rate limits and resumes from the same cursor.
- **Fair pricing** — pay per ad delivered.

### Data fields

`adArchiveId`, `pageId`, `pageName`, `pageUrl`, `pageLikeCount`, `startDate`, `endDate`, `isActive`, `platforms`, `creativeType` (IMAGE / VIDEO / DCO / CAROUSEL…), `headline`, `bodyText`, `ctaText`, `ctaType`, `linkCaption`, `landingPageUrl`, `mediaUrls`, `imageUrls`, `videoUrls`, `cards[]`, `collationCount`, `spendRange`, `impressionsRange`, `categories`, `targetedOrReachedCountries`, `adLibraryUrl`, `scrapedAt`, optional `aiAnalysis`.

### Full input example

```json
{
  "searchQueries": ["running shoes"],
  "pages": ["20409006880", "https://www.facebook.com/nike"],
  "country": "US",
  "activeStatus": "active",
  "adCategory": "all",
  "mediaType": "all",
  "maxResults": 200
}
```

### Sample output (real record, trimmed)

```json
{
  "platform": "meta",
  "adArchiveId": "952162490977746",
  "pageId": "20409006880",
  "pageName": "Shopify",
  "pageUrl": "https://www.facebook.com/shopify/",
  "pageLikeCount": 4559940,
  "startDate": "2026-11-01",
  "isActive": true,
  "platforms": ["FACEBOOK", "INSTAGRAM"],
  "creativeType": "DCO",
  "headline": "Imaginez votre boutique, Shopify la crée",
  "bodyText": "Vous avez quelque chose à vendre ? Créez une boutique en ligne en quelques secondes avec notre éditeur de boutique par IA.",
  "ctaText": "Sign up",
  "landingPageUrl": "https://www.shopify.com/se/gratis-trial",
  "adLibraryUrl": "https://www.facebook.com/ads/library/?id=952162490977746",
  "scrapedAt": "2026-11-19T21:13:02.000Z"
}
```

### Proxy & limits

Meta returns the first 30 results to most visitors but **rate-limits pagination from datacenter IPs**. The Actor therefore defaults to Apify **RESIDENTIAL** proxy, rotating sessions and resuming from the same cursor when throttled. With datacenter proxy you will reliably get ~30 ads per query.

### Pricing (pay per event — no subscription)

You pay only for results. With Apify pay-per-event pricing there is no separate compute charge for this Actor — just the events below.

| Event | Price | Per 1,000 | When |
|---|---|---|---|
| `ad-scraped` | $0.002 | $2.00 | Each ad written to your dataset (primary) |
| `ai-ad-analysis` | $0.02 | $20.00 | Optional, only when enabled and successful |
| Actor start | $0.00005 | — | Apify standard start event, once per run |

Example: 1,000 Facebook/Instagram ads = **$2.00**; 100 ads = $0.20.

Set **Max cost per run** (or `maxTotalChargeUsd` via the API) and the run stops cleanly at your budget. New Apify accounts get free monthly platform credit, which you can use to try this Actor.

### FAQ

**Do I need a Facebook account?** No. Web mode uses the public Ad Library exactly like a logged-out visitor.

**What does API mode add?** Official, stable data via your own token, including spend/impressions/demographics for ads Meta covers in the API (EU-delivered ads and political/issue ads). It does not include commercial ads outside the EU — that's what web mode is for.

**How do I find a Page ID?** Open the Page's ads in the Ad Library — the URL contains `view_all_page_id=…`. You can also paste the Page URL; slug URLs are matched by keyword + page filter.

**Is it legal?** The Meta Ad Library is a public transparency tool. The Actor collects advertiser-level ad data only. Check your use case and local law.

**Can I run it on a schedule?** Yes. Create an Apify Schedule (daily, weekly, cron) for this Actor or a saved task. To get alerts only when something changes, use the [Competitor Ad Tracker](https://apify.com/adintel-labs/competitor-ad-tracker).

**Can I use it from an AI agent or my own app?** Yes — via the Apify API, the `apify-client` SDKs, n8n, Make, Zapier or the Apify MCP server. See *Integrations & API* below.

**Something broke or a field is missing?** Open an issue on the Issues tab with your run ID. We run automated health checks on every AdIntel Labs Actor daily and fix breakages as quickly as we can.

### Integrations & API

Use this Actor from code, no-code tools or AI agents:

- **REST API** — `POST https://api.apify.com/v2/acts/adintel-labs~meta-ad-library-scraper/run-sync-get-dataset-items?token=<APIFY_TOKEN>` with the input JSON as the body returns the ads directly (waits up to 5 minutes; use `/runs` + webhooks for longer jobs).
- **n8n** — Apify node (`@apify/n8n-nodes-apify`) → *Run an Actor and get dataset*, Actor `adintel-labs/meta-ad-library-scraper`.
- **Make** — Apify app → *Run an Actor* (run synchronously) → *Get Dataset Items*, or trigger on *Watch Actor Runs*.
- **Zapier** — Apify app → *Run Actor* action, or *Finished Actor Run* trigger + *Fetch Dataset Items* (for runs longer than Zapier's 30 s sync limit).
- **AI agents (MCP)** — add `https://mcp.apify.com?tools=adintel-labs/meta-ad-library-scraper` to Claude, Cursor, VS Code or any MCP client; the Actor appears as the tool `adintel-labs--meta-ad-library-scraper`.
- **Schedules & webhooks** — run it daily/weekly with Apify Schedules and push results to Slack, Google Sheets, Airtable, S3 and more.

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('adintel-labs/meta-ad-library-scraper').call({"searchQueries": ["nike"], "country": "US", "activeStatus": "active", "maxResults": 20}, { maxTotalChargeUsd: 1 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

```python
import os
from apify_client import ApifyClient  # pip install apify-client
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("adintel-labs/meta-ad-library-scraper").call(run_input={"searchQueries": ["nike"], "country": "US", "activeStatus": "active", "maxResults": 20})
for ad in client.dataset(run.default_dataset_id).iterate_items():  # apify-client 1.x: run["defaultDatasetId"]
    print(ad)
```

### More AdIntel Labs ad-library Actors

All built for the same job — competitor ad research — with a similar clean JSON schema and pay-per-ad pricing:

- [Google Ads Transparency Scraper](https://apify.com/adintel-labs/google-ads-transparency-scraper) — Search, Display & YouTube ads from the Google Ads Transparency Center
- [LinkedIn Ad Library Scraper](https://apify.com/adintel-labs/linkedin-ad-library-scraper) — B2B ads with EU impressions & targeting
- [TikTok Ads Scraper](https://apify.com/adintel-labs/tiktok-ad-library-scraper) — Creative Center Top Ads + EU Ad Library (Beta)
- [Bing / Microsoft Ad Library Scraper](https://apify.com/adintel-labs/microsoft-ad-library-scraper) — Bing search & shopping ads shown in the EU/EEA
- [Snapchat Ads Library Scraper](https://apify.com/adintel-labs/snapchat-ad-library-scraper) — Snap Ads Gallery creatives & impressions (EU + TR)
- [Pinterest Ads Library Scraper](https://apify.com/adintel-labs/pinterest-ad-repository-scraper) — Pinterest Ads Repository: reach & targeting (EU, NO, BR, TR)
- [Competitor Ad Tracker](https://apify.com/adintel-labs/competitor-ad-tracker) — scheduled alerts when competitors launch or stop ads on all 7 libraries

Browse them all at [apify.com/adintel-labs](https://apify.com/adintel-labs).

# Actor input Schema

## `searchQueries` (type: `array`):

Search terms as you would type them in the Ad Library search box (brand, product, phrase).

## `pages` (type: `array`):

Numeric Page IDs (most reliable) or facebook.com page URLs. Slug URLs fall back to a keyword search filtered to that Page.

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

2-letter ISO code where ads were delivered (US, GB, DE...) or ALL.

## `activeStatus` (type: `string`):

Filter by delivery status.

## `adCategory` (type: `string`):

Special ad categories expose spend & impressions.

## `mediaType` (type: `string`):

Filter by creative media.

## `exactPhrase` (type: `boolean`):

Match the keyword as an exact phrase.

## `dateFrom` (type: `string`):

YYYY-MM-DD

## `dateTo` (type: `string`):

YYYY-MM-DD

## `maxResults` (type: `integer`):

Maximum ads returned for EACH keyword or Page.

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

If set, uses the official Graph API ads_archive endpoint (EU-delivered & political ads only, per Meta's rules) instead of the public web library.

## `metaApiVersion` (type: `string`):

Graph API version for API mode.

## `includeAiAnalysis` (type: `boolean`):

Adds aiAnalysis (angle, hook, offer, audience, emotional triggers, funnel stage) to each ad. Charged per successfully analysed ad only.

## `llmApiKey` (type: `string`):

OpenAI-compatible API key. Leave empty to use the Actor's built-in key (if configured).

## `llmModel` (type: `string`):

Model name for the OpenAI-compatible endpoint.

## `llmBaseUrl` (type: `string`):

OpenAI-compatible base URL (OpenAI, OpenRouter, Groq, xAI...).

## `pageDelayMs` (type: `integer`):

Politeness delay (with jitter) between pagination requests.

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

Meta serves the first 30 results to most IPs but rate-limits pagination from datacenter IPs. RESIDENTIAL (default) is required for >30 ads per query.

## Actor input object example

```json
{
  "searchQueries": [
    "nike"
  ],
  "country": "US",
  "activeStatus": "active",
  "adCategory": "all",
  "mediaType": "all",
  "exactPhrase": false,
  "maxResults": 50,
  "metaApiVersion": "v23.0",
  "includeAiAnalysis": false,
  "llmModel": "gpt-4o-mini",
  "llmBaseUrl": "https://api.openai.com/v1",
  "pageDelayMs": 2500,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `ads` (type: `string`):

Dataset of all Meta Ad Library ads collected in this run.

## `runStats` (type: `string`):

Key-value store record with row counts, proxy details, and finish time.

# 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 = {
    "searchQueries": [
        "nike"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("adintel-labs/meta-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 = {
    "searchQueries": ["nike"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adintel-labs/meta-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/aBOsFh5059fPZElaJ/builds/Ew2KHdAb9BCJeFhBx/openapi.json
