# Facebook Ad Library Scraper: Ads, Spend & Reach, $0.49/1K (`laptime/facebook-ad-library-scraper`) Actor

$0.49/1K ads, no start fee. Big searches read several ways at once, up to 4x faster. No login. Meta Ad Library ads by keyword, advertiser, page URL or Ad Library URL: text, images, videos, spend, EU reach, payer. Country, status, media, platform, date filters. Exact maxItems.

- **URL**: https://apify.com/laptime/facebook-ad-library-scraper.md
- **Developed by:** [Laptime](https://apify.com/laptime) (community)
- **Categories:** Social media, Lead generation, Agents
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.35 / 1,000 ads

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/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

<p><strong>From Laptime.</strong> We benchmark our scrapers on Apify and date the results, and an automated check runs this Actor's example input every morning.</p>

> **Update, 19 November 2026:** **Continue from last run** finishes a run that timed out or hit your maximum cost, and the ads the first run delivered are not charged again.

### Why choose Facebook Ad Library Scraper?

<ul>
<li><strong>Faster than the Ad Library scrapers we timed.</strong> 20 "nike" ads in the United States took <strong>4.0 seconds</strong> on Apify on 18 Nov 2026, the fastest of 3 scrapers given the same input. 200 ads took 11.9 seconds.</li>
<li><strong>Your limits are hard limits.</strong> Max ads and your maximum cost per run hold even with many searches running at once. A run cut off at 338 ads and then continued delivered 500 unique ads with none charged twice (19 Nov 2026).</li>
<li><strong>You pay for ads, not runs.</strong> 1,000 ads cost $0.49, with no start fee and no proxy or platform usage on top. A monitor run that finds nothing new costs $0.</li>
</ul>

### Try it with one keyword

[![How to use Facebook Ad Library Scraper without coding: 1. Try for free 2. Type a keyword + Start 3. Ads with advertiser, dates, text, link 4. Export the Overview view to Excel](https://api.apify.com/v2/key-value-stores/uhvb1I0vozUDDdhcp/records/howto-facebook-ad-library-scraper-steps.jpg?v=4a8389a2)](https://api.apify.com/v2/key-value-stores/uhvb1I0vozUDDdhcp/records/howto-facebook-ad-library-scraper-steps.jpg?v=4a8389a2)

No code needed: click **Try for free**, keep the example input, click **Start**, then export to Excel. Or paste this into the **JSON** tab of the input:

```json
{
  "searchQueries": ["nike"],
  "country": "US",
  "maxItems": 20
}
```

That's 20 active ads that mention "nike" in the United States, from Nike and Jordan to the retailers that sell them, each with its text, call to action, landing page, images, start date and days active. The daily check of this input took 2.9 to 4.7 seconds between 19 and 25 Nov 2026. Swap in any keyword, or put a brand in **Advertisers**.

**Apify free plan:** the $5 of monthly credit covers about 10,000 ads with this Actor. No card needed.

### Pick the right ad library tool

### Using an AI assistant?

Paste this into ChatGPT, Claude, Cursor or any AI agent, then say what you want. It gives the assistant what it needs to run this Actor with your Apify account: inputs, examples, prices and a check of the results.

```text
Help me get data with the Apify Actor laptime/facebook-ad-library-scraper ("Facebook Ad Library Scraper" by Laptime). $0.49/1K ads, no start fee. Big searches read several ways at once, up to 4x faster. No login. Meta Ad Library ads by keyword, advertiser, page URL or Ad Library URL: text, images, videos, spend, EU reach, payer. Country, status, media, platform, date filters. Exact maxItems. Full docs (every input field, pricing): https://apify.com/laptime/facebook-ad-library-scraper.md; the essentials are below. If I have not said what I want yet, ask me in one question. Before the first run, show me the input and the estimated cost.
Run it: with Apify MCP tools (https://mcp.apify.com), call-actor "laptime/facebook-ad-library-scraper" with the input, then get-dataset-items with the run's dataset ID. Otherwise, with my Apify token (https://console.apify.com/settings/integrations; keep it in an environment variable, not in a URL or file): POST https://api.apify.com/v2/acts/laptime~facebook-ad-library-scraper/run-sync-get-dataset-items, header "Authorization: Bearer $APIFY_TOKEN", JSON body = the input; it returns the rows as a JSON array and waits up to 300 s (longer runs: POST /v2/acts/laptime~facebook-ad-library-scraper/runs, poll the run, then GET /v2/datasets/{defaultDatasetId}/items). No token yet: a free Apify account includes $5 of usage a month, no card.
Input (JSON; other fields in the docs): searchQueries: Keywords to search the Meta Ad Library for (ads on Facebook, Instagram, Messenger, Threads and Audience Network); advertisers: all ads of these advertisers. A brand name ("Nike": we look up the advertiser in the Ad Library, verified pages first), a Facebook page URL…; maxItems (default 100): Hard cap on ads delivered (and charged) by the whole run, never exceeded, even with many searches running at once; country (default "ALL"): Ads shown in this country: a two-letter code (US, GB, CA, AU, DE, FR, NL…) or ALL; mediaType (one of all|image|video|meme|image_and_meme|none, default "all"): Meta's own media filter: all, image, video, meme (image with text), image_and_meme, or none (text only); startedBefore: Keep only ads that started on or before this date or relative time (e.g. "90 days" for long-running ads); sortBy (one of relevance|impressions|most_recent): relevance (Meta's default order), impressions (most impressions first: the ads with the biggest reach), or most_recent (newest first); includeAdDetails (default false): Adds, per ad: EU total reach, reach by country, age and gender, targeted ages, gender and locations, payer and beneficiary (ads shown in the EU), UK reach, and the…; onlyNew (default false): Skip ads this monitor delivered in earlier runs, so a scheduled run returns only new ads; monitorName: Names the "Only new ads" memory, e.g. "competitors-weekly".
Example (the input the Store form opens with): {"searchQueries":["nike"],"maxItems":20,"country":"US"}
Example (monitor competitors' new Facebook and Instagram ads): {"advertisers":["Nike","Adidas","On Running"],"country":"US","onlyNew":true,"monitorName":"sportswear","maxItems":500}
Example (find winning video ads in a niche): {"searchQueries":["protein powder"],"country":"US","mediaType":"video","sortBy":"impressions","startedBefore":"30 days","maxItems":200}
Cost: pay per result, no start fee (Free-plan prices; paid Apify plans pay less): Ad $0.49 per 1,000, Ad details $0.25 per 1,000, AI creative analysis $1.50 per 1,000. To cap a run's charge, add ?maxTotalChargeUsd=<dollars> to the API URL (MCP: callOptions.maxTotalChargeUsd).
Output: Main fields: adArchiveId, pageName, isActive, startDate, daysActive, mediaType, title, body, ctaText, linkUrl, thumbnailUrl, publisherPlatforms.
After the run: tell me how many rows came back and what they cost, then show the first 5 rows as a table (adArchiveId, pageName, isActive, startDate, daysActive, mediaType). If nothing came back, read the run's statusMessage (API: GET /v2/acts/laptime~facebook-ad-library-scraper/runs/last; MCP: get-actor-run) and suggest one change to the input.
```

### What can Facebook Ad Library Scraper do?

- **Read the whole Meta Ad Library.** Ads on Facebook, Instagram, Messenger, Threads, WhatsApp and Audience Network, by keyword, advertiser name, page URL, page ID or any Ad Library link. No Facebook account, cookies or API token.
- **Find a brand's page for you.** Type "Nike" in **Advertisers** and it looks the page up in the Ad Library, verified pages first.
- **Find winning creatives.** Sort by impressions, keep ads running for 30 days or more, or creatives used in 3 or more ads. Ads these filters drop are free.
- **Search several countries in one run.** List country codes or `EU` for all 27 member states; an ad shown in several is delivered once.
- **Monitor competitors.** **Only new ads** remembers what earlier runs delivered, so a daily schedule returns only new ads.
- **Get EU transparency and political data.** **Include ad details** adds EU reach by country, age and gender, targeting, payer and beneficiary. Political and issue ads come with spend and impression ranges as numbers.
- **Finish an interrupted run.** **Continue from last run** delivers only the ads a timed-out, aborted or capped run missed.
- **Label the creatives with AI.** Optional: ad category, offer type, hook, angle, offer, audience, funnel stage, tone and a summary per ad, plus your own questions.

### How to scrape the Facebook Ad Library

Paste one of these into the **JSON** tab of the input, or send it through the API.

#### Monitor competitors' new ads every day

```json
{
  "advertisers": ["Nike", "Adidas", "On Running"],
  "country": "US",
  "onlyNew": true,
  "monitorName": "sportswear",
  "maxItems": 500
}
```

Save it as a task and add a daily schedule. At about 50 new ads a day, a month costs about $0.74. A day with nothing new costs $0.

#### Find proven winners across three markets

```json
{
  "searchQueries": ["skincare"],
  "countries": ["US", "GB", "DE"],
  "minDaysActive": 30,
  "minCollationCount": 3,
  "sortBy": "impressions",
  "maxItems": 300
}
```

Only ads running for 30 days or more whose creative is used in 3 or more ads. On 19 Nov 2026 a 60-ad version of this run took 32 seconds and dropped 604 ads for free. 300 ads cost $0.15.

#### Collect long-running video ads in a niche

```json
{
  "searchQueries": ["protein powder"],
  "country": "US",
  "mediaType": "video",
  "sortBy": "impressions",
  "startedBefore": "30 days",
  "maxItems": 200
}
```

Video ads that started more than 30 days ago, most impressions first, with HD video links. 200 ads cost $0.10.

#### Build an EU transparency dataset

```json
{
  "searchQueries": ["insurance"],
  "country": "DE",
  "includeAdDetails": true,
  "maxItems": 300
}
```

Each ad gets EU reach, the split by country, age and gender, targeting, payer and beneficiary. 300 ads with details cost $0.22.

#### Track political ad spend

```json
{
  "searchQueries": ["climate"],
  "country": "US",
  "adType": "political_and_issue_ads",
  "activeStatus": "all",
  "maxItems": 500
}
```

Political and issue ads, active and past, with `spendLower`, `spendUpper`, `impressionsLower` and `impressionsUpper` as numbers. 500 ads cost $0.25.

### Input parameters

Give **Search keywords**, **Advertisers** or **Start URLs** (or a mix); all of them run. Everything else is optional. `maxItems` caps the whole run; `maxItemsPerSource` caps each keyword, advertiser or URL.

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `searchQueries` | array | | Words to search ad text for |
| `advertisers` | array | | Brand names, page URLs or page IDs |
| `startUrls` | array | | Ad Library searches (with every filter in them), single ads or pages |
| `country` | string | `ALL` | One of 49 countries, or `ALL` |
| `countries` | array | | Several countries (any two-letter code, or `EU`); overrides `country` |
| `activeStatus` | string | `active` | `active`, `inactive`, `all` |
| `adType` | string | `all` | `all`, `political_and_issue_ads`, `housing_ads`, `employment_ads`, `credit_ads`, `financial_products_and_services_ads` |
| `mediaType` | string | `all` | `all`, `image`, `video`, `meme`, `image_and_meme`, `none` |
| `exactPhrase` | boolean | `false` | Match the keyword as a phrase |
| `platforms` | array | | `facebook`, `instagram`, `messenger`, `threads`, `audience_network`, `whatsapp` |
| `languages` | array | | Two-letter language codes (`en`, `de`) |
| `ranFrom` / `ranTo` | string | | Ran on or after / before (Meta's own date filter) |
| `startedAfter` / `startedBefore` | string | | Only ads launched after / before a date or span (`30 days`) |
| `sortBy` | string | `relevance` | `relevance`, `impressions`, `most_recent` |
| `includeKeywords` / `excludeKeywords` | array | | Ad text must contain any of / must not contain |
| `minDaysActive` | integer | `0` | Only ads running for at least this many days |
| `minCollationCount` | integer | `0` | Only creatives used in at least this many ads |
| `excludeAdvertisers` | array | | Page names or IDs to skip |
| `maxItems` | integer | `100` | Ads in the whole run |
| `maxItemsPerSource` | integer | `0` (no limit) | Ads per keyword, advertiser or URL |
| `includeAdDetails` | boolean | `false` | EU reach and demographics, targeting, payer, beneficiary, advertiser info |
| `expandCollations` | boolean | `false` | Every ad of each creative group, not one row per creative |
| `onlyNew` / `monitorName` | boolean / string | `false` | Deliver only ads that earlier runs with this monitor name didn't |
| `continueFromLastRun` | boolean | `false` | Deliver only what an interrupted run with the same input missed |
| `countOnly` | boolean | `false` | One row per source with the number of ads |
| `runTag` | string | | A label copied to every row |
| `outputFormat` | string | `laptime` | `laptime`, `curious_coder` or `apify` row shape |
| `fastMode` | boolean | `true` | Read big searches several ways at once |
| `maxConcurrency` | integer | `8` | Requests in parallel (up to 32) |
| `aiAnalysis`, `aiCustomLabels`, `aiContext` | | off | AI labels per ad, your own questions, a sentence about your business |
| `aiApiKey`, `aiModel` | string | | Your own OpenRouter, OpenAI, Anthropic or Gemini key and model (no AI events charged) |
| `telemetry` | boolean | `true` | Anonymous error reports (what is sent: see the FAQ) |

Input names from other Ad Library scrapers work as they are; see [Switch from another Ad Library scraper](#switch-from-another-ad-library-scraper).

### Output

One row per ad, with more than 80 fields, each documented in the Output tab's schema. Views: **Overview**, **Spend and EU transparency** and **AI analysis**.

[![Facebook Ad Library Scraper results in Apify: Meta ads with Library ID, advertiser, start date, days active, media type, headline, text, call to action and landing page](https://api.apify.com/v2/key-value-stores/uhvb1I0vozUDDdhcp/records/howto-facebook-ad-library-scraper-output.jpg?v=c535acb8)](https://api.apify.com/v2/key-value-stores/uhvb1I0vozUDDdhcp/records/howto-facebook-ad-library-scraper-output.jpg?v=c535acb8)

*A real run of the example input ("nike" ads in the United States): one row per ad with the Library ID, advertiser, active flag, start date, days active, media type, headline, text, call to action and landing page.*

| Group | Fields |
|---|---|
| Ad | `adArchiveId`, `url`, `body`, `title`, `caption`, `linkUrl`, `linkDomain`, `ctaText`, `ctaType`, `displayFormat`, `mediaType` |
| Media | `imageUrls`, `videoUrls`, `videoPreviewImageUrls`, `thumbnailUrl`, carousel and dynamic `cards` |
| Run time | `isActive`, `startDate`, `endDate`, `daysActive`, `publisherPlatforms`, `collationCount` |
| Advertiser | `pageId`, `pageName`, `pageUrl`, `pageLikeCount`, `pageCategories` |
| Political | `spendLower`, `spendUpper`, `impressionsLower`, `impressionsUpper` |
| EU details | `euTotalReach`, `euAgeMin`, `euAgeMax`, `euReachByCountryAgeGender`, `payer`, `beneficiary` |
| Search | `source`, `searchTotalResults`, `runTag` |

#### Example ad (shortened)

```json
{
  "dataType": "ad",
  "adArchiveId": "1550534860016399",
  "url": "https://www.facebook.com/ads/library/?id=1550534860016399",
  "pageId": "115939511520844",
  "pageName": "Perfect themes",
  "pageLikeCount": 18509,
  "isActive": true,
  "startDate": "2026-05-19T07:00:00.000Z",
  "daysActive": 189,
  "publisherPlatforms": ["facebook", "instagram", "audience_network", "messenger", "threads"],
  "displayFormat": "IMAGE",
  "mediaType": "image",
  "body": "🔥🍭Themepack is a FREE and personalized APP😍 various styles of Theme💎 ...",
  "caption": "play.google.com",
  "linkUrl": "http://play.google.com/store/apps/details?id=com.iconchanger.widget.theme.shortcut",
  "linkDomain": "play.google.com",
  "ctaText": "Install now",
  "ctaType": "INSTALL_MOBILE_APP",
  "imageUrls": ["https://scontent.fntr1-1.fna.fbcdn.net/v/t39.35426-6/..."],
  "detailsStatus": "not-requested",
  "source": "nike"
}
```

With **Include ad details**, an ad shown in the EU also carries, for example, `"euTotalReach": 2875906`, `"euAgeMin": 18`, `"euAgeMax": 65`, `"payer": "Sneakerjagers B.V."` and `euReachByCountryAgeGender` rows like `{"country": "DE", "ageRange": "25-34", "male": 305731, "female": 294162}`.

Meta's image and video links expire after a few days: download the media you want to keep soon after the run.

#### Export to Excel or CSV

Open the run's **Export** button and pick a view before you download: the dialog starts on **All fields**, which spreads the cards, platforms and EU reach lists over dozens of columns. **Overview** gives one readable line per ad, and **Spend and EU transparency** the political and EU numbers. Choose JSON when you want the carousel cards and reach breakdowns kept intact.

### Benchmarks

Measured on Apify with the same input for every Actor (keyword "nike", United States, active ads). All three returned the same ads in the same order. Time is the run's total time as Apify reports it, start-up included.

| Task | Facebook Ad Library Scraper | Next best we tested | Date |
|---|---|---|---|
| 20 ads | **4.0 s** | 4.8 s | 18 Nov 2026 |
| 200 ads | **11.9 s** | 26.6 s | 18 Nov 2026 |

Compared with jmlp/meta-ad-library-scraper and curious_coder/facebook-ads-library-scraper (6.4 s for 20 ads). Bigger jobs on 18 Nov 2026: 50 ads of one advertiser page in 5.8 to 9.5 s, 500 ads of that page with EU details in 41 s, and 2,000 "shopify" ads in 77 s.

### How much does it cost to scrape the Facebook Ad Library?

Pay per event. There is no start fee, proxies and platform usage are included, and empty runs are free.

| Event | Price |
|---|---|
| Ad (also one Count only row) | **$0.49 per 1,000** |
| Ad details (only with **Include ad details**) | $0.25 per 1,000 |
| AI creative analysis (only with AI on, never with your own key) | $1.50 per 1,000 |

| Job | Cost |
|---|---|
| 1,000 ads | $0.49 |
| 10,000 ads | $4.90 |
| 1,000 ads with EU details | $0.74 |
| A daily monitor of 5 competitors for a month (about 50 new ads a day) | about $0.74 |
| A monitor run that finds nothing new | $0 |

You are never charged for ads your filters drop, duplicates, ads a monitor or an interrupted run already delivered, details that failed, or runs that return nothing. Set **Max ads** or Apify's **Maximum cost per run** to cap a bill.

### Integrations

Save your input as a task, give it a schedule, and send the rows to Google Sheets, Make, n8n, Zapier or Slack. New to schedules? Apify's one-minute video shows how:

https://www.youtube.com/watch?v=1jI7WcVQmwM

- **Google Sheets:** `=IMPORTDATA("https://api.apify.com/v2/actor-tasks/<TASK_ID>/runs/last/dataset/items?format=csv&view=overview&status=SUCCEEDED&token=<API_TOKEN>")` loads the last run. Anyone who can open the sheet sees the token, so use it only in private sheets.
- **n8n, Make, Zapier:** the Apify node or app, "Run an Actor and get dataset", Actor `laptime/facebook-ad-library-scraper`.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("laptime/facebook-ad-library-scraper").call(run_input={
    "advertisers": ["Nike"],
    "country": "US",
    "maxItems": 100,
})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad["pageName"], ad["daysActive"], ad["body"])
```

#### One HTTP call

```bash
curl -X POST "https://api.apify.com/v2/acts/laptime~facebook-ad-library-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchQueries": ["running shoes"], "country": "GB", "maxItems": 20}'
```

#### Claude, ChatGPT, Cursor and other MCP clients

Add `https://mcp.apify.com?tools=laptime/facebook-ad-library-scraper` as a remote MCP server, then ask: "Which Meta ads has Gymshark been running for more than 30 days in the UK? Show the text and landing pages."

Notes for agents: `maxItems` caps the run; brand names go in `advertisers`, words in `searchQueries`; `country` defaults to all countries; spend exists only for political and issue ads; cost ≈ ads × $0.00049 (+ $0.00025 per ad with details).

### Switch from another Ad Library scraper

Change only the Actor ID. Their field names win over ours when both are set, so a saved input from another scraper runs as it did there (checked 18 Nov 2026).

- **curious_coder/facebook-ads-library-scraper:** `urls`, `count`, `limitPerSource`, `scrapeAdDetails` and `scrapePageAds.*` (activeStatus, countryCode, sortBy, period) are read as they are. Set `"outputFormat": "curious_coder"` for Meta's snake_case objects (`ad_archive_id`, `snapshot.body.text`, `start_date`) with `url` and formatted dates.
- **apify/facebook-ads-scraper:** `startUrls`, `resultsLimit`, `isDetailsPerAd`, `onlyTotal` and `onlyAdsNewerThan`/`onlyAdsOlderThan` work. Set `"outputFormat": "apify"` for camelCase rows with `adArchiveID`, `pageID` and `inputUrl`.
- **jmlp/meta-ad-library-scraper:** `keyword`, `keywords`, `searchType`, `pageID`, `pageIDs`, `adLibraryUrls`, `adLibraryUrl`, `minDate`/`maxDate`, `maxAds`, `maxAdsPerTarget`, `euTransparency` and `continueFromLastRun` work.
- **automation-lab/facebook-ads-library:** `searchQueries`, `pageUrls`, `adsLibraryUrls`, `maxAds` and `onlyAdsNewerThan` work.

To switch safely, run both Actors on the same input for a week and compare `adArchiveId`s. With no start fee, a daily shadow run costs cents.

### FAQ

#### Do I need a Facebook account or the Ad Library API?

No. It reads the public Ad Library logged out, without the Ad Library API (which covers only political and EU ads and needs identity verification).

#### Why are spend and impressions empty for most ads?

Meta publishes them only for political and issue ads. For other ads shown in the EU, turn on **Include ad details** to get EU reach and the age and gender split.

#### Why do I get fewer ads than the Ad Library's count?

Meta's count is an estimate, and it counts every ad of a creative group. Turn on **Every ad of each creative group** to get those too.

#### Can I get every ad of an advertiser, including past ones?

Yes: put the brand in **Advertisers** and set **Active status** to `all`.

#### A run timed out or hit my maximum cost. Do I pay twice to finish it?

No. Start the same input again with **Continue from last run**: the ads the interrupted run delivered are skipped and not charged, and the new run delivers only what it missed, within the same Max ads.

#### Is it reliable?

Facebook's rate limits are absorbed by switching to a fresh residential IP at once, and a search that fails falls back to the ads embedded in the Ad Library page. An automated check runs the default input on Apify every morning and alerts us when it returns nothing or a key field goes empty.

#### Does it send any data back?

When a run hits an error, the Actor sends us a small anonymous report (the error type, which step failed, the HTTP status and a few counts) so we can fix breakages before you notice them. It never includes your input, your results, URLs, your Apify account or your IP address. To turn it off, untick **Anonymous error reports** in the input (or set `"telemetry": false`).

#### Is it legal to scrape the Facebook Ad Library?

Meta publishes the Ad Library for anyone to read without a login, and this Actor reads only that public data. Ads can name people (political candidates, page owners), so GDPR and similar laws may apply to how you store and use the data. Use it in line with your local law and Meta's terms; when in doubt, ask a lawyer. Apify's overview: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

### More Laptime scrapers

- [Google Ads Transparency Scraper](https://apify.com/laptime/google-ads-transparency-scraper): every Google ad of a company, with ad text and YouTube links.
- [Google Trends Scraper](https://apify.com/laptime/google-trends-scraper): interest over time, regions and related queries for your brand and keywords.
- [Reddit Scraper](https://apify.com/laptime/reddit-scraper): what people say about a brand, with every comment.
- [Contact Details Scraper](https://apify.com/laptime/contact-details-scraper): the email, phone and social profiles of each advertiser's website, $0.99 per 1,000 websites.

### Support

Found a bug, or missing a field? Open an issue and we'll answer within a day. Fixes and new fields are listed on the **Changelog** tab.

If it saved you time, a short review on the Actor page helps other people find it.

*Unofficial. Not affiliated with, endorsed by or sponsored by Meta Platforms, Inc. Facebook and Instagram are trademarks of Meta Platforms, Inc.*

# Changelog

This Actor's version history is a separate document: https://apify.com/laptime/facebook-ad-library-scraper/changelog.md

# Actor input Schema

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

Keywords to search the Meta Ad Library for (ads on Facebook, Instagram, Messenger, Threads and Audience Network). Each keyword is a separate search. Use "Exact phrase" for phrase matching. Keywords, Advertisers and Start URLs are separate lists, not filters of each other: all of them run. For an advertiser's ads that mention a word, use Advertisers with "Ad text must contain".

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

Optional. A separate list, not a filter of Search keywords: all ads of these advertisers. A brand name ("Nike": we look up the advertiser in the Ad Library, verified pages first), a Facebook page URL (https://www.facebook.com/nike) or a numeric page ID (15087023444). Filters below apply (country, active status, media type, dates).

## `startUrls` (type: `array`):

Optional. A separate list, not a filter: Ad Library links, one per row. A search (https://www.facebook.com/ads/library/?q=nike\&country=US...) runs with every filter in the URL (the URL wins over the filters below); an ad link (?id=123...) returns that ad; a page link (view_all_page_id=... or facebook.com/brand) returns the advertiser's ads. Also read from "urls" (curious_coder) and "startUrls" (apify).

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

Hard cap on ads delivered (and charged) by the whole run, never exceeded, even with many searches running at once. Also read from "count" (curious_coder) and "resultsLimit" (apify).

## `maxItemsPerSource` (type: `integer`):

Cap per search. 0 (default) = only the run-wide Max ads applies. Also read from "limitPerSource" (curious_coder).

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

Ads shown in this country: a two-letter code (US, GB, CA, AU, DE, FR, NL…) or ALL. EU countries carry EU transparency data with "Include ad details". Applies to keywords and advertisers, not to pasted Ad Library URLs. The form starts on US; an API call or task without "country" searches ALL.

## `countries` (type: `array`):

Run every keyword and advertiser once per country, e.g. \["US", "GB", "DE"]; any two-letter code, or EU for the 27 member states. An ad shown in several of them is delivered once (with the first country). Empty = the single Country above.

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

active = ads running now (default), inactive = ads that stopped, all = both.

## `adType` (type: `string`):

all (default) = every ad; political_and_issue_ads = ads about social issues, elections or politics (these carry spend and impression ranges, kept for 7 years); housing_ads, employment_ads, credit_ads, financial_products_and_services_ads = the special categories Meta lists separately.

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

Meta's own media filter: all, image, video, meme (image with text), image_and_meme, or none (text only). Dynamic (DCO) ads that contain a video or image match too; their mediaType column says "dynamic" and videoUrls or imageUrls hold the media.

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

true = keywords match as an exact phrase ("running shoes" in that order); false (default) = all words in any order.

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

Only ads that ran on these platforms: facebook, instagram, messenger, threads, audience_network, whatsapp. Empty = all platforms.

## `languages` (type: `array`):

Only ads in these languages, as two-letter codes (en, de, es). Empty = all languages.

## `ranFrom` (type: `string`):

Meta's date filter: ads that ran (had impressions) on or after this day. A date (2026-10-01) or a relative time ("30 days"). Empty = no limit.

## `ranTo` (type: `string`):

Meta's date filter: ads that ran on or before this day. A date or a relative time. Empty = up to today.

## `startedAfter` (type: `string`):

Keep only ads whose start date (ad launch) is on or after this: a date (2026-11-01) or relative ("7 days"). Use it to find new creatives; ads left out are not charged. Also read from apify's "onlyAdsNewerThan".

## `startedBefore` (type: `string`):

Keep only ads that started on or before this date or relative time (e.g. "90 days" for long-running ads). Ads left out are not charged.

## `sortBy` (type: `string`):

relevance (Meta's default order), impressions (most impressions first: the ads with the biggest reach), or most_recent (newest first).

## `includeKeywords` (type: `array`):

Keep only ads whose text (advertiser, headline, body, cards) contains at least one of these words. Case-insensitive. Ads left out are not charged.

## `excludeKeywords` (type: `array`):

Drop ads whose text contains any of these words. Ads left out are not charged.

## `minDaysActive` (type: `integer`):

Keep only ads that ran at least this many days (launch to last day shown; today for active ads). 30 = long-running ads, usually the winners. 0 (default) = no limit. Ads left out are not charged.

## `minCollationCount` (type: `integer`):

Keep only creatives the advertiser runs as at least this many ads (Meta's "N ads use this creative"; collationCount). Scaled creatives are usually the proven ones. 0 or 1 (default) = no limit. Ads left out are not charged.

## `excludeAdvertisers` (type: `array`):

Drop ads from these advertisers: page names ("Nike", case-insensitive, exact) or page IDs. Use it to leave your own brand or known resellers out of a keyword search. Ads left out are not charged.

## `includeAdDetails` (type: `boolean`):

Adds, per ad: EU total reach, reach by country, age and gender, targeted ages, gender and locations, payer and beneficiary (ads shown in the EU), UK reach, and the advertiser's about text, category, verification, Instagram username and followers. One extra request per ad; charged as ad-details. Also read from "scrapeAdDetails" and "isDetailsPerAd".

## `expandCollations` (type: `boolean`):

Meta lists one ad per creative group ("N ads use this creative and text"; collationCount). true = also deliver every other ad of each group (each charged as an ad; maxItems applies), like the Ad Library's "See summary details". false (default) = one row per creative. Also read from "expandVariants".

## `onlyNew` (type: `boolean`):

Skip ads this monitor delivered in earlier runs, so a scheduled run returns only new ads. A run with nothing new costs nothing. The memory is per Monitor name (or per task / set of inputs).

## `monitorName` (type: `string`):

Names the "Only new ads" memory, e.g. "competitors-weekly". Runs with the same name share it. Empty = one memory per task or input.

## `continueFromLastRun` (type: `boolean`):

true = if the last run with exactly this input was cut short (timeout, abort, platform restart, your maximum cost, or a search that failed), deliver only the ads it missed: its ads are skipped and not charged, and maxItems counts them. Those earlier ads stay in that run's dataset. If the last run finished normally, everything is scraped again. false (default) = a full run.

## `countOnly` (type: `boolean`):

One row per keyword, advertiser or URL with the number of ads Meta reports (totalResults), instead of the ads. Each count row is charged as one ad. Also read from apify's "onlyTotal".

## `runTag` (type: `string`):

Optional label copied to every row as runTag, e.g. "q4-competitors", to tell runs apart in one sheet or database. Also curious_coder's field name.

## `outputFormat` (type: `string`):

laptime (default) = flat documented rows. curious_coder = Meta's own snake_case objects as curious_coder's Actor returns them (ad_archive_id, snapshot.body.text...). apify = the same in camelCase with adArchiveID, pageID and inputUrl, like apify/facebook-ads-scraper.

## `fastMode` (type: `boolean`):

true (default) = a search asked for more than 120 ads is also read under Meta's other sort orders and media types at once and de-duplicated: up to 4× faster. false = one list in Meta's exact order (slower for big jobs).

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

Requests in parallel (IPs used at once). 8 is fast and gentle; up to 32.

## `aiAnalysis` (type: `boolean`):

Adds per ad: ad category, offer type, hook, hook type, persuasion angle, offer, target audience, funnel stage, tone, product category, language and a one-line summary (aiStatus "ok"). Charged as ai-creative-analysis per analysed ad; ads without text are skipped and not charged. Off by default.

## `aiCustomLabels` (type: `array`):

Your own questions per ad, as "name: question" (e.g. "usesUgc: yes/no: the creative is user-generated content style", "competitor: the competitor brand named, or none"). Starting with yes/no gives true/false. Answers land in aiLabels. Up to 10.

## `aiContext` (type: `string`):

Optional context for the AI, e.g. "We sell running shoes; label competitor ads by angle". Up to 500 characters.

## `aiApiKey` (type: `string`):

Optional: an OpenRouter (sk-or-), OpenAI, Anthropic (sk-ant-) or Gemini (AIza) key. With your own key AI analysis is not charged by us. Empty = our hosted model.

## `aiModel` (type: `string`):

Model name for your own key, e.g. gpt-4.1-mini or anthropic/claude-haiku-5.5. Empty = a sensible default for the key.

## `telemetry` (type: `boolean`):

Sends the Actor's author an anonymous report when a run hits an error (error type, failing step, HTTP status, counts). Never your input, results, URLs or account. Untick to turn it off.

## Actor input object example

```json
{
  "searchQueries": [
    "running shoes",
    "crm software"
  ],
  "advertisers": [
    "Nike",
    "https://www.facebook.com/footlocker",
    "15087023444"
  ],
  "maxItems": 20,
  "maxItemsPerSource": 0,
  "country": "US",
  "countries": [
    "US",
    "GB",
    "DE"
  ],
  "activeStatus": "active",
  "adType": "all",
  "mediaType": "all",
  "exactPhrase": false,
  "languages": [
    "en"
  ],
  "ranFrom": "30 days",
  "startedAfter": "7 days",
  "sortBy": "relevance",
  "minDaysActive": 0,
  "minCollationCount": 0,
  "includeAdDetails": false,
  "expandCollations": false,
  "onlyNew": false,
  "continueFromLastRun": false,
  "countOnly": false,
  "outputFormat": "laptime",
  "fastMode": true,
  "maxConcurrency": 8,
  "aiAnalysis": false,
  "aiCustomLabels": [
    "hasDiscount: yes/no: the ad offers a discount or coupon"
  ],
  "telemetry": true
}
```

# Actor output Schema

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

Every ad row, in the order scraped.

## `overview` (type: `string`):

The Overview view: advertiser, text, media, dates and platforms.

## `transparency` (type: `string`):

Spend, impressions, EU reach, payer and beneficiary columns.

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

RUN_STATS: ads, seconds, requests, per-source totals, errors and why the run stopped.

# 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"
    ],
    "maxItems": 20,
    "country": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("laptime/facebook-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"],
    "maxItems": 20,
    "country": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("laptime/facebook-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"
  ],
  "maxItems": 20,
  "country": "US"
}' |
apify call laptime/facebook-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,laptime/facebook-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/dih8b9Nl1ob5rWbXs/builds/rLoUv8NgB9oYy2UXo/openapi.json
