# Facebook & Meta Ads Library Scraper (`spectre_scrape/facebook-ads-library-scraper`) Actor

Extract competitor ads from the Meta Ads Library -> no login, no browser, no cookies. Competitor ad intelligence via API at $1/1k results.

- **URL**: https://apify.com/spectre\_scrape/facebook-ads-library-scraper.md
- **Developed by:** [Spectre](https://apify.com/spectre_scrape) (community)
- **Categories:** E-commerce, Social media, Lead generation
- **Stats:** 5 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.00 / 1,000 results

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/platform/actors/running/actors-in-store#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 Ad Library Scraper

Scrape ads from Meta's Ad Library at scale. Search by keyword, filter by country, or pull every ad running on a specific Facebook page. This actor hits Meta's internal GraphQL APIs directly, so there's no login, no cookies, and no browser automation overhead. Feed the output into your competitive research workflow, ad monitoring dashboard, or automation pipeline.

### Who is this for?

- **Media buyers and performance marketers** monitoring competitor creatives
  across Facebook and Instagram.
- **Marketing agencies** automating weekly competitor ad reports for clients.
- **Developers and automation builders** (n8n, Make, Zapier) who need
  Meta ad data programmatically without managing a browser instance.
- **Ecommerce brands** researching what ads competitors are running
  before launching their own campaigns.

### How to use it

#### Scraping search results

1. Go to [Meta Ad Library](https://www.facebook.com/ads/library/) and run a search.
2. Copy the full URL from your browser's address bar.
3. Open [Facebook Ad Library Scraper](https://apify.com/spectre_scrape/facebook-ads-library-scraper) on Apify.
4. Paste the URL into the **Input URLs / Keywords** field.
5. Set your **Max ads** limit and pick a **Proxy** (datacenter works for most cases).
6. Click **Start**.
7. When the run finishes, click **Export** to download your data as JSON, CSV, or Excel.

#### Scraping a specific Facebook page

Paste the Facebook page URL directly into the input field. The scraper will extract all ads currently running (or previously run) by that page.

#### Input options

| Field | Description | Default |
| :--- | :--- | :--- |
| Input URLs / Keywords | Ad Library search URLs or Facebook page URLs | — |
| Max ads to scrape | Cap on total ads extracted. Leave empty for all. | 100 |
| Deep Scrape | Extract EU transparency data, spend estimates, and reach (slower) | Off |
| Active status | Filter: all, active, or inactive | all |
| Country | 2-letter ISO code (e.g. US, IN, GB) or ALL for global | ALL |
| Proxy configuration | Datacenter recommended. Use residential if blocked. | Datacenter |

### Why this scraper?

- **No login or cookies required.** Hits Meta's internal APIs directly.
- **No browser overhead.** Faster and cheaper than Playwright-based alternatives.
- **Active and inactive ads.** Pull currently running ads or historical ones.
- **Full creative data.** Ad copy, images, CTAs, page info, spend signals
  in one structured output.
- **Scheduled runs.** Automate weekly competitor monitoring via Apify's
  built-in scheduler.
- **JSON, CSV, Excel export.** One click from the Apify console.

### Data fields

- `ad_archive_id`
- `page_id` & `page_name`
- `is_active` (active/inactive status)
- `start_date` & `end_date`
- `snapshot` (ad copy, CTA, image/video URLs, card data)
- `publisher_platform` (Facebook, Instagram, Audience Network)
- `spend` & `impressions`
- `political_countries`
- `reach_estimate`

### Sample output

```json
[
  {
    "ad_archive_id": "975498021164030",
    "collation_count": 1,
    "collation_id": "390607310753339",
    "is_active": false,
    "page_id": "104542139222761",
    "page_name": "Book More Showings",
    "snapshot": {
      "page_id": "104542139222761",
      "page_profile_uri": "https://www.facebook.com/bookmoreshowings/",
      "page_name": "Book More Showings",
      "caption": "WWW.BOOKMORESHOWINGS.COM",
      "cta_text": "Learn more",
      "cards": [
        {
          "body": "🚀 Ready to Transform Your Business?\nAgents are closing $100K+ GCI annually with BMS...",
          "cta_text": "Learn More",
          "link_url": "https://www.bookmoreshowings.com/learn",
          "title": "🔥 Agents Closing $100K GCI Use BMS. Be Next!"
        }
      ],
      "display_format": "DCO"
    },
    "publisher_platform": [
      "FACEBOOK",
      "INSTAGRAM",
      "AUDIENCE_NETWORK"
    ],
    "start_date_formatted": "2025-02-03 08:00:00",
    "end_date_formatted": "2025-07-15 07:00:00",
    "ad_library_url": "https://www.facebook.com/ads/library/?id=975498021164030"
  }
]
```

### API access

Trigger runs programmatically and retrieve results via the Apify API. Works with any HTTP client, cURL, or SDK.

```bash
curl --request POST \
  --url https://api.apify.com/v2/acts/spectre_scrape~facebook-ads-library-scraper/runs?token=YOUR_TOKEN \
  --header 'Content-Type: application/json' \
  --data '{
    "searchQueries": ["marketing"],
    "maxAds": 100,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
  }'
```

Fetch results after the run completes:

```bash
curl --request GET \
  --url https://api.apify.com/v2/acts/LcR8loRYD3Rx1bFET/runs/last/dataset/items?token=YOUR_TOKEN
```

Full API docs: [Apify API reference](https://docs.apify.com/api/v2)

### Integrations

Connect this scraper to your existing stack:

- **Make (Integromat)** and **Zapier**: Use the Apify integration to trigger runs and process results automatically.
- **n8n**: Use the HTTP Request node or the Apify node to build custom workflows.
- **Google Sheets**: Export results directly from the Apify console.
- **Slack / Email**: Set up Apify webhooks to get notified when a run finishes.

### Pricing

This actor costs **$1.00 per 1,000 results** in Apify usage credits. Deep Scrape mode uses more credits due to additional API requests per ad. You can scrape up to 25,000 ads per month on the Apify Starter plan.

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

Meta's Ad Library is a public transparency tool. This scraper does not extract private user data. It only collects information that Meta has made publicly available. That said, your results may contain personal data (advertiser names, page info). Personal data is protected by GDPR in the EU and by similar regulations elsewhere. If you're unsure whether your use case is compliant, consult a lawyer.

### Feedback

Found a bug or have a feature request? Open an issue on the actor's **Issues** tab in the Apify Console. We read every report.

***

**Try it free on Apify. No credit card required for the first run.**

👉 [Launch Facebook Ad Library Scraper](https://apify.com/spectre_scrape/facebook-ads-library-scraper)

***

### Part of the Spectre Scrape Ad Intelligence Suite

- [TikTok Ads Library Scraper](https://apify.com/spectre_scrape/tiktok-ads-scraper-v2)
- Google Ads Transparency Scraper (coming soon)

***

**Keywords**: facebook ads scraper, meta ads scraper, facebook ads library scraper, scrape facebook ads, competitor ad analysis, facebook ad intelligence, instagram ads scraper, meta ads API, ad creative scraper, facebook page ads

# Actor input Schema

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

Enter Facebook Ad Library search URLs or Facebook Page URLs.

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

Limit the total number of ads extracted. Leave empty to scrape all.

## `deepScrape` (type: `boolean`):

Enable to extract EU transparency, spend estimates, and reach. Slower as it makes an extra request per ad.

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

Filter ads by active status.

## `countryCode` (type: `string`):

2-letter ISO country code (e.g. US, IN, GB). Use ALL for global.

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

DATACENTER is recommended for cost efficiency. Use RESIDENTIAL only if blocked by Meta.

## Actor input object example

```json
{
  "searchQueries": [
    "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&q=marketing&search_type=keyword_unordered"
  ],
  "maxAds": 100,
  "deepScrape": false,
  "activeStatus": "all",
  "countryCode": "ALL",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

List of Ads scraped from Facebook

# 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": [
        "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&q=marketing&search_type=keyword_unordered"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("spectre_scrape/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": ["https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&q=marketing&search_type=keyword_unordered"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("spectre_scrape/facebook-ads-library-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&q=marketing&search_type=keyword_unordered"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call spectre_scrape/facebook-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=spectre_scrape/facebook-ads-library-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/LcR8loRYD3Rx1bFET/builds/RlTSEdhjey6ppOrca/openapi.json
