# Facebook Ads Library Scraper · No Login · $0.5/1k (`alfalfa/facebook-ads-library-scraper`) Actor

Facebook Ads Library scraper: search Meta ads by keyword, advertiser page or Ad Library URL, export to Excel, CSV or JSON, no login. Ad text, creatives, call to action, dates, platforms, EU reach, advertiser info. Same fields as the official Facebook Ads Scraper. $0.50 per 1,000 ads, no start fee.

- **URL**: https://apify.com/alfalfa/facebook-ads-library-scraper.md
- **Developed by:** [Alfalfa](https://apify.com/alfalfa) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

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

## Facebook Ads Library Scraper (No Login)

Search the **Meta Ad Library** (Facebook, Instagram, Messenger, Audience Network, Threads ads) by **keyword, advertiser page or Ad Library URL** and get every ad as a clean record: ad text, title, call to action, landing page, images, videos and carousel cards, start and end dates, platforms, advertiser page and, on request, the EU transparency data (total reach and the reach by country, age and gender) and advertiser details. No Facebook account, login or cookies needed. **Same output fields as the official Facebook Ads Scraper** at **$0.50 per 1,000 ads**, with **no start fee** and **ad details included**.

Export to JSON, CSV or Excel, read the dataset through the API, or run it on a schedule from n8n, Make or Zapier.

### What you can do with Facebook ad data

- **Competitor monitoring**: pull every active ad of a competitor's page each week and see what they promote, which landing pages they push and how long each ad has been running.
- **Creative research and swipe files**: search a niche keyword ("running shoes", "meal prep", "CRM software") and collect the ads with their images, videos, hooks and calls to action.
- **Lead generation**: advertisers in your niche are businesses with a marketing budget. Get their page names, page IDs, likes, Instagram handles and landing pages in one table.
- **Agency reporting**: track a client's ads and the competition, with the EU reach breakdown by age, gender and country for European campaigns.
- **Political, housing, employment and credit ads**: filter the special ad categories Facebook keeps for years, with spend and impression ranges where Facebook publishes them.
- **Brand protection**: find ads that use your brand name in their text, including ads from resellers and scammers.

### What data do you get

| Field | Example |
|---|---|
| `adArchiveID`, `url`, `isActive`, `startDateFormatted`, `endDateFormatted` | `1785179045778580`, the Ad Library URL, `true`, `2026-05-07T07:00:00.000Z` |
| `pageName`, `pageID`, `snapshot.pageProfileUri`, `snapshot.pageLikeCount`, `snapshot.pageCategories` | advertiser page, its likes and categories |
| `snapshot.body.text`, `snapshot.title`, `snapshot.caption`, `snapshot.linkDescription` | the ad copy |
| `snapshot.ctaText`, `snapshot.ctaType`, `snapshot.linkUrl` | `Shop now`, `SHOP_NOW`, the landing page |
| `snapshot.images`, `snapshot.videos`, `snapshot.cards`, `snapshot.displayFormat` | creatives with original and resized image URLs, HD and SD video URLs, carousel cards |
| `publisherPlatform`, `collationCount`, `categories`, `targetedOrReachedCountries` | `["FACEBOOK", "INSTAGRAM"]`, number of ad versions, special ad categories |
| `spend`, `impressionsWithIndex`, `currency`, `reachEstimate` | ranges Facebook publishes for political and issue ads |
| `ad_details` (with *Include ad details*) | advertiser About text, likes, Instagram followers and verification; payer and beneficiary; `eu_transparency` with `eu_total_reach` and the reach by country, age and gender; spend of political advertisers |
| `inputUrl` | the keyword, page ID or URL the ad was found from |

### How to scrape the Facebook Ad Library

1. Type one or more **Keywords** (one per line), paste **Advertiser page IDs**, or paste **Ad Library URLs** copied from your browser (keyword searches, advertiser pages or single ads).
2. Pick the **Country**, and optionally the ad status, media type, category, platforms and start date range.
3. Set **Max ads per search**, switch on **Include ad details** if you need the EU reach data or advertiser info, and click **Start**. Ads stream into the dataset as they are found.

### Input

| Field | Type | Description |
|---|---|---|
| `searchQueries` | array of strings | Keywords to search for, each one is a separate search. |
| `pageIds` | array of strings | Numeric advertiser page IDs (`view_all_page_id` in Ad Library URLs). All ads of the page. |
| `startUrls` | array of `{ "url": ... }` | Ad Library URLs in the same form as the official Facebook Ads Scraper: `?q=...`, `?view_all_page_id=...` or `?id=...`. Filters in the URL override the fields below. |
| `country` | string | ISO code (`US`, `GB`, `DE`...) or `ALL`. Default `ALL`. |
| `activeStatus` | `all` / `active` / `inactive` | Default `all`. |
| `mediaType` | `all` / `image` / `video` / `meme` / `image_and_meme` / `none` | Default `all`. |
| `adType` | `all` / `political_and_issue_ads` / `housing_ads` / `employment_ads` / `credit_ads` | Default `all`. |
| `publisherPlatforms` | array | `facebook`, `instagram`, `audience_network`, `messenger`, `whatsapp`, `threads`. Empty = all. |
| `searchType` | `keyword_unordered` / `keyword_exact_phrase` | How keywords are matched. |
| `startDateMin`, `startDateMax` | `YYYY-MM-DD` | Only ads that started in this range. |
| `maxAds` | integer | Max ads per keyword, page or URL (default 100). `resultsLimit` works too. |
| `scrapeAdDetails` | boolean | Add `ad_details` to every ad (advertiser info, payer and beneficiary, EU reach breakdown). No surcharge. |
| `maxConcurrency` | integer | Searches run in parallel (default 5). |
| `proxyConfiguration` | object | Residential proxies by default, included in the price. Optionally pick a country or use your own proxy servers. |

Example:

```json
{
  "searchQueries": ["running shoes"],
  "pageIds": ["15087023444"],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "video",
  "maxAds": 200,
  "scrapeAdDetails": true
}
```

### Output

One record per ad (trimmed):

```json
{
  "adArchiveID": "1785179045778580",
  "adArchiveId": "1785179045778580",
  "pageID": "721404351056614",
  "pageId": "721404351056614",
  "pageName": "IControl: Easy Widgets Themes",
  "isActive": false,
  "startDate": 1778137200,
  "endDate": 1782716400,
  "startDateFormatted": "2026-05-07T07:00:00.000Z",
  "endDateFormatted": "2026-06-29T07:00:00.000Z",
  "publisherPlatform": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK", "MESSENGER", "THREADS"],
  "collationCount": 1,
  "collationId": "974017695598335",
  "categories": ["UNKNOWN"],
  "isAaaEligible": true,
  "snapshot": {
    "body": { "text": "❤️Aesthetic presets for your phone✨" },
    "title": "🥰a FREE and personalized APP for you",
    "caption": "play.google.com",
    "ctaText": "Install now",
    "ctaType": "INSTALL_MOBILE_APP",
    "linkUrl": "http://play.google.com/store/apps/details?id=com.icontrol.easy.widgets.themes",
    "displayFormat": "IMAGE",
    "images": [{ "originalImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/...", "resizedImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/..." }],
    "videos": [],
    "cards": [],
    "pageName": "IControl: Easy Widgets Themes",
    "pageProfileUri": "https://www.facebook.com/people/IControl-Easy-Widgets-Themes/61575866489402/",
    "pageLikeCount": 4601,
    "pageCategories": ["App page"]
  },
  "ad_details": {
    "advertiser": {
      "page": { "about": { "text": "iControl: Simple Widget Theme is a professional theme application..." } },
      "ad_library_page_info": {
        "page_info": { "likes": 4601, "ig_followers": null, "page_verification": "NOT_VERIFIED", "page_category": "App page" },
        "page_spend": { "is_political_page": false }
      }
    },
    "aaa_info": { "targets_eu": true, "payer_beneficiary_data": [{ "payer": "BEIJING XINMEI HUTONG TECHNOLOGY CO., LTD.", "beneficiary": "BEIJING XINMEI HUTONG TECHNOLOGY CO., LTD." }] },
    "transparency_by_location": {
      "eu_transparency": {
        "eu_total_reach": 1208452,
        "age_audience": { "min": 25, "max": 64 },
        "gender_audience": "All",
        "location_audience": [{ "name": "Czech Republic", "type": "countries", "excluded": false }],
        "age_country_gender_reach_breakdown": [{ "country": "CZ", "age_gender_breakdowns": [{ "age_range": "25-34", "male": 25656, "female": 29841, "unknown": 1632 }] }]
      }
    }
  },
  "url": "https://www.facebook.com/ads/library/?id=1785179045778580",
  "inputUrl": "nike"
}
```

`ad_details` is present only with *Include ad details* on. Political and issue ads carry `spend`, `impressionsWithIndex` and `currency` in every run.

### Pricing

**$0.50 per 1,000 ads** ($0.0005 per ad), **no start fee**, ad details included, platform usage and residential proxies included. You pay only for records written to the dataset. Set the maximum budget per run in the Actor settings; the scraper stops when it is reached and never overshoots the number you typed.

| Monthly spend | Ads |
|---|---|
| $5, which is what the free plan includes | about 10,000 |
| $49 | about 98,000 |
| $499 | about 998,000 |

For comparison, the official Facebook Ads Scraper charges $5.80 per 1,000 ads on the free plan. Discounts for Starter, Scale and Business plans apply automatically.

### Switching from the official Facebook Ads Scraper

1. Replace the Actor ID in your integration and keep your `startUrls` and `resultsLimit`; the URL formats are the same (keyword search, `view_all_page_id`, single ad `id`).
2. Output field names are the same, including `snapshot` with `body.text`, `ctaText`, `linkUrl`, `images`, `videos` and `cards`, and the `ad_details` block with `isDetailsPerAd` replaced by `scrapeAdDetails`.
3. Keywords and page IDs can be typed directly (`searchQueries`, `pageIds`) instead of building URLs.

### Limitations

- Only what the Ad Library shows to a visitor without a login: ads Facebook has removed from the library are not returned, and reach or spend ranges exist only for political and issue ads (plus the EU transparency block for ads targeting the EU).
- Facebook ranks search results itself; there is no sorting option. Use the date range, status and media filters to narrow a search.
- A single ad by `id=` returns that ad; the `isActive` flag and dates reflect the moment of the run.

### FAQ

#### Can I scrape the Facebook Ad Library without logging in?

Yes. Everything the public Ad Library shows is collected without a Facebook account. Nothing is posted, liked or followed, and no cookies of yours are used.

#### How do I get all ads of one advertiser?

Paste the page ID into *Advertiser page IDs* (or the Ad Library URL with `view_all_page_id=`) and pick the country. Set *Max ads per search* high enough; large brands run thousands of ads.

#### What is the EU transparency data?

For ads shown in the European Union, Facebook publishes the total reach and the reach by country, age range and gender, plus who paid for the ad and who benefits. Switch on *Include ad details* and read `ad_details.transparency_by_location.eu_transparency`.

#### Can I run it every day and get only new ads?

Yes. Use *Started after* with yesterday's date, or filter on `startDateFormatted` in your workflow. Schedules and webhooks are built into Apify.

#### How fast is it?

About 10 to 20 ads per second per search when details are off, and 3 to 5 per second with details on. Searches run in parallel, so five keywords with 100 ads each finish in well under a minute.

#### Is scraping the Facebook Ad Library legal?

The Ad Library is public data Meta publishes for transparency. Scraping publicly available data is generally legal, but you are responsible for how you use it: respect Meta's terms, copyright of the creatives and privacy laws such as GDPR. This Actor is not affiliated with Meta.

### Use it from n8n, Make, Zapier or an AI agent

- **n8n, Make, Zapier**: add the Apify node, pick `alfalfa/facebook-ads-library-scraper` as the Actor, paste the same JSON input as above and read the run's dataset in the next step. A workflow that scrapes a competitor's ads every Monday and appends the new ones to Google Sheets takes three nodes. See the [Apify integrations docs](https://docs.apify.com/platform/integrations).
- **AI agents and MCP (Claude, Cursor, VS Code, ChatGPT)**: connect the Apify MCP server with this Actor as a tool, `https://mcp.apify.com/?tools=alfalfa/facebook-ads-library-scraper`, and the agent can search the Ad Library by describing what it wants in plain language. See [Apify MCP docs](https://docs.apify.com/platform/integrations/mcp).
- **API and scheduling**: every run is available through the [Apify API](https://docs.apify.com/api/v2) and the Apify CLI; schedules, webhooks and dataset exports (JSON, CSV, Excel, XML) are built into the platform.

### More Facebook scrapers by Alfalfa

| Actor | What it does | Price |
|---|---|---|
| [Facebook Posts Scraper](https://apify.com/alfalfa/facebook-posts-scraper) | posts of any public page or profile with reactions, comment counts, media, optional video transcripts | $2 per 1,000 posts |
| [Facebook Comments Scraper](https://apify.com/alfalfa/facebook-comments-scraper) | comments and replies of any public post | $0.50 per 1,000 comments |
| [Facebook Pages Scraper](https://apify.com/alfalfa/facebook-pages-scraper) | page details with email, phone, address, followers, rating, About text | from $3.50 per 1,000 pages |
| [LinkedIn Jobs Scraper](https://apify.com/alfalfa/linkedin-jobs-scraper) | public LinkedIn job postings by keyword, location, date, company or URL, with full description, salary, applicants, seniority and poster | $0.50 per 1,000 jobs |
| [YouTube Scraper](https://apify.com/alfalfa/youtube-scraper) | videos of a search, channel, playlist or URL list with views, likes, date, tags, plus transcripts and comments; no API key | $0.50 per 1,000 rows |
| [Facebook Events Scraper](https://apify.com/alfalfa/facebook-events-scraper) | events by search, city, page or URL, with organizer email | $5 per 1,000 events |

Same field names as the official Actors, no login, no start fees, one flat price each.

### Not working?

Open an issue in the **Issues** tab of this Actor with your input and the run ID. Facebook changes its pages often; fixes usually ship within a day.

# Actor input Schema

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

Words or phrases to search for in ad texts and advertiser names, one per line, e.g. <code>running shoes</code> or <code>Nike</code>. Each keyword is one search. Combine with <b>Country</b> and the filters below.

## `pageIds` (type: `array`):

Numeric Facebook page IDs of advertisers whose ads you want, e.g. <code>15087023444</code> (Nike). Find the ID in the Ad Library URL after <code>view\_all\_page\_id=</code>. Returns every ad of the page in the selected country.

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

URLs copied from the Facebook Ad Library, in the same form the official Facebook Ads Scraper takes: a keyword search (<code>...?q=nike\&country=US...</code>), an advertiser page (<code>...?view\_all\_page\_id=15087023444...</code>) or a single ad (<code>...?id=1785179045778580</code>). Filters in the URL (country, active status, media type, dates, platforms) override the fields below.

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

Two-letter ISO country code of the audience, e.g. <code>US</code>, <code>GB</code>, <code>DE</code>, or <code>ALL</code> for every country.

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

<b>All</b> ads, only ads that are <b>Active</b> now, or only <b>Inactive</b> ones.

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

Only ads with this kind of creative.

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

All ads, or only the special categories Facebook keeps for years: political and issue ads, housing, employment or credit ads.

## `publisherPlatforms` (type: `array`):

Only ads shown on these Meta platforms. Empty = all platforms.

## `searchType` (type: `string`):

<b>Unordered</b> finds ads containing all the words in any order (Facebook's default); <b>Exact phrase</b> needs the words together, in order.

## `startDateMin` (type: `string`):

Only ads that started running on or after this date, <code>YYYY-MM-DD</code>.

## `startDateMax` (type: `string`):

Only ads that started running on or before this date, <code>YYYY-MM-DD</code>.

## `maxAds` (type: `integer`):

Maximum number of ads per keyword, page or URL. Each ad is one record; you pay only for records written.

## `scrapeAdDetails` (type: `boolean`):

Add the <code>ad\_details</code> block to every ad: advertiser page info (About text, likes, Instagram followers, verification), payer and beneficiary, EU transparency with total reach and the reach by country, age and gender, plus spending for political advertisers. Slower (one extra lookup per ad), no surcharge.

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

How many keywords, pages or URLs are searched in parallel (default 5). Results of one search are always read in order.

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

Residential proxies are included in the price per ad. Leave the default unless you want to route the traffic through your own proxy servers.

## Actor input object example

```json
{
  "searchQueries": [
    "nike"
  ],
  "country": "US",
  "activeStatus": "all",
  "mediaType": "all",
  "adType": "all",
  "publisherPlatforms": [],
  "searchType": "keyword_unordered",
  "maxAds": 100,
  "scrapeAdDetails": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped ads as JSON (same fields as the official Facebook Ads Scraper). Append ?format=csv for CSV.

# 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"
    ],
    "country": "US",
    "maxAds": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("alfalfa/facebook-ads-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"],
    "country": "US",
    "maxAds": 100,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("alfalfa/facebook-ads-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"
  ],
  "country": "US",
  "maxAds": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call alfalfa/facebook-ads-library-scraper --silent --output-dataset

```

## MCP server setup

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