# Meta Ad Library Scraper (Facebook & Instagram Ads) (`chadi.baraou/facebook-ad-library-scraper`) Actor

The fastest, cheapest, and most reliable Meta Ad Library Scraper to spy on competitors. Extract live Facebook & Instagram ads by keywords or Page URLs in 4 seconds with direct MP4 video player links, high-resolution images, full ad copy, CTAs, and landing page URLs for only $0.50 per 1K ads.

- **URL**: https://apify.com/chadi.baraou/facebook-ad-library-scraper.md
- **Developed by:** [chadi baraou](https://apify.com/chadi.baraou) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.

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

## 🎯 Meta Ad Library Scraper (Facebook & Instagram Ads)

The fastest, cheapest, and most reliable **Meta Ad Library Scraper** on Apify. Extract authentic live Facebook, Instagram, Messenger, and Threads ads by **keywords** or **competitor Facebook Page URLs/IDs** in under 4 seconds with direct **.MP4 video player links**, high-resolution images, full ad copy, CTAs, and landing page URLs.

***

### ⚡ Why Choose Our Scraper Over Competitors?

Most other Meta Ad Library scrapers on the marketplace are clunky, slow, and frustrating to use:

| Feature / Workflow | ❌ Other Competitor Scrapers | 🚀 Our Meta Ad Library Scraper |
|---|---|---|
| **Workflow Friction** | **Forces you to open Facebook in a separate browser tab**, manually search, apply filters on Meta's public site, and copy giant 500+ character address bar URLs. | **Zero external tabs needed!** Enter your keyword or Page URL directly inside Apify and click Run. |
| **Speed** | 1 to 3 minutes per run using heavy, slow headless browsers. | **Lightning fast: ~3 to 5 seconds** using instant challenge clearance. |
| **Pricing** | Expensive ($2.00–$5.00+ per 1k ads) or heavy compute charges. | **Just $0.50 USD per 1,000 ads** ($0.0005 / ad). |
| **Reliability** | Frequently blocked by Meta's 403 checkpoint or captcha screens. | **100% Reliable**: Automated verification clearance bypasses Meta checkpoints instantly. |
| **Video Quality** | Often missing video links or only low-res watermarked clips. | **Direct progressive .MP4 video links (HD 720p & SD 360p)** you can click to watch and export. |

***

### 🏷️ Categories

- **Social Media**
- **Marketing & Advertising**
- **Lead Generation**

***

### 💡 Top Use Cases

1. **Spy on Competitors**: Input your competitors' Facebook Page URLs or Page IDs to monitor their creative variations, newly tested hooks, and landing page funnels.
2. **AI Agents & MCP Pipelines**: Connect this scraper directly to your AI agents or Model Context Protocol (MCP) servers to analyze ad trends and generate high-converting scripts.
3. **UGC & Viral Hook Research**: Find winning TikTok, Reels, and UGC ads in your niche (e.g. `"AI UGC"`, `"dropshipping"`, `"skincare"`) and download the source `.mp4` video files.
4. **Automated Scheduled Tracking**: Schedule the Actor to run every morning or once a week to automatically alert you whenever competitors launch new ads.
5. **High-Ticket B2B & Ecommerce Lead Generation**: Discover active advertisers investing heavily in paid acquisition and reach out with targeted services.

***

### 📥 Input Configuration

Configuring your search takes less than 5 seconds. You can search by keyword or by specific Facebook Page:

| Parameter | Type | Default | Description |
|---|---|---|---|
| `search_keyword` | String | `"AI UGC"` | Keyword, brand name, or niche to search across active Facebook & Instagram ads. |
| `page_urls` | Array\[String] | `[]` | List of Facebook Page URLs (e.g. `https://www.facebook.com/Nike`) or numeric Page IDs. |
| `limit` | Integer | `20` | Maximum number of ads to retrieve (1 to 5,000). |
| `country_code` | Select | `"ALL"` | Target country code (e.g. `Worldwide (ALL)`, `US`, `GB`, `CA`, `AU`, `DE`, `FR`, etc.). |
| `is_active` | Select | `"ACTIVE"` | Filter by `Active Only`, `All Ads (Active & Inactive)`, or `Inactive Only`. |
| `ad_type` | Select | `"all"` | `All Commercial Ads` or `Political & Issue Ads`. |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true }` | Choose proxy type (Apify Residential Proxy, Datacenter, Custom) and proxy country. |

#### 📸 Input Screen Example

```text
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ Search Keyword: [ AI UGC                                                             ] │
│ Facebook Page URLs or IDs: [ + Add ] [ Bulk edit ]                                     │
│ Maximum Ads to Scrape: [ 1000                                                        ] │
│ Country: [ Worldwide (ALL)                                                          ▼] │
│ Ad Status: [ Active Only                                                            ▼] │
│ Ad Category: [ All Commercial Ads                                                   ▼] │
│ Proxy Configuration: (•) Residential  ( ) Datacenter  ( ) Special  ( ) Own proxies    │
└────────────────────────────────────────────────────────────────────────────────────────┘
```

<img width="994" height="751" alt="Screenshot 2026-10-18 at 02 22 53" src="https://github.com/user-attachments/assets/c825a1c2-f605-4045-90a8-256c84fc4c00" />

> **Tip on Proxies**: For maximum reliability across worldwide searches, keep **Apify Residential Proxy** selected. You can also target specific proxy countries in the proxy settings.

***

### 💰 Pricing: Pay-Per-Result Model

Our pricing is straightforward, transparent, and up to **80% cheaper** than competing solutions:

- **$0.50 USD per 1,000 ads** ($0.0005 per ad)
- **Apify Free Tier**: Every user gets **$5.00 USD of free credits every month**, giving you **up to 10,000 free results** with **NO credit card required**!

#### 📊 Plan Comparison Table

| Apify Plan | Price per 1,000 Ads | Free Monthly Results | Credit Card Required? |
|---|---|---|---|
| **Free Plan** | **$0.50 USD** | **10,000 ads (FREE)** | ❌ **No credit card required** |
| **Starter ($49/mo)** | **$0.50 USD** | ~98,000 ads included | Included in platform tier |
| **Scale ($499/mo)** | **$0.50 USD** | ~998,000 ads included | Included in platform tier |
| **Business** | **$0.50 USD** | High-volume custom scale | Included in platform tier |

#### 🏷️ Cost by Volume

| Number of Ads Scraped | Total Cost (USD) |
|---|---|
| **100 ads** | $0.05 |
| **500 ads** | $0.25 |
| **1,000 ads** | $0.50 |
| **2,500 ads** | $1.25 |
| **5,000 ads** | $2.50 |
| **10,000 ads** | **$5.00 (100% Free on Apify Free Tier)** |
| **25,000 ads** | $12.50 |
| **50,000 ads** | $25.00 |

***

### 📤 Output Data & Formats

You can view, search, and export the collected ad dataset in multiple formats directly from the Apify Console or via API:

- **JSON** & **JSONL**
- **CSV** (for Excel, Google Sheets, or Airtable)
- **Excel (XLSX)**
- **XML**
- **HTML Table**
- **RSS Feed**

#### 🎬 Clickable Media & Video Export

Each scraped record includes direct progressive **`.mp4` video streaming links** and **high-res image URLs**. You can click the links directly in the dataset to watch the video ad in your browser or right-click to save/export it immediately!

#### 📋 JSON Output Example

```json
{
  "adArchiveID": "1465344302086856",
  "adID": "1465344302086856",
  "pageID": "1369755289823565",
  "pageName": "Runway",
  "pageProfileURI": "https://www.facebook.com/1369755289823565",
  "startDate": "2026-08-07T07:00:00.000Z",
  "endDate": "2026-10-17T07:00:00.000Z",
  "isActive": true,
  "snapshotUrl": "https://video-lhr11-1.xx.fbcdn.net/o1/v/t2/f2/m367/AQMLPPpbvghZH14U7AtoQR2GIL1_iWn3jITmKv9JuiC_j4lG0RR0e4u9_LVoH5blVsH6v4gbcqMpCOvyys9o55Wnh4L9A3VoHE4IbORMPw.mp4?...",
  "mediaType": "video",
  "videoSources": {
    "hdUrl": "https://video-lhr11-1.xx.fbcdn.net/o1/v/t2/f2/m367/AQMLPPpbvghZH14U7AtoQR2GIL1_iWn3jITmKv9JuiC_j4lG0RR0e4u9_LVoH5blVsH6v4gbcqMpCOvyys9o55Wnh4L9A3VoHE4IbORMPw.mp4?...",
    "sdUrl": "https://video-lhr11-1.xx.fbcdn.net/o1/v/t2/f2/m367/AQMSNWV0Vr6pIAN3z69zFI28IMUcUrCDaIle6GejQ9GLdfs5iq52jmV3cUUwDKxNQIs-y7iXG-zXGAci1v4JGnAxAheBx-c6L8jI4e_e9g.mp4?...",
    "previewUrl": "https://scontent-lhr11-1.xx.fbcdn.net/v/t39.35426-6/767161441_..."
  },
  "adBody": "runwayml.com/UGC-ads - Stop hiring actors. Generate authentic viral UGC video ads with AI in minutes.",
  "headline": "Tested TikTok Ad Hooks That Cut CPA by 52%",
  "linkUrl": "https://runway.com/ugc-videos?utm_source=meta",
  "ctaText": "Sign up",
  "publisherPlatforms": [
    "facebook",
    "instagram",
    "messenger",
    "threads"
  ],
  "collationCount": 2,
  "collationID": "892239273545104",
  "currency": "USD",
  "scrapedAt": "2026-10-17T19:30:00.000Z"
}
```

***

### 🔌 Integrations & Automated Workflows

Connect this scraper to your favorite automation tools and build end-to-end ad intelligence pipelines:

- **n8n & Make.com**: Trigger scrapes automatically, enrich ad copy with OpenAI/Claude, and push to your team.
- **Zapier**: Send newly detected competitor ads directly to Slack, Discord, or Telegram.
- **Google Sheets & Airtable**: Automatically sync scraped ad datasets with direct video links into your spreadsheets.
- **Model Context Protocol (MCP)**: Give your AI coding or research agents live access to active Meta ads.
- **Apify REST API & SDKs**: Call this Actor programmatically using Python (`apify-client`) or JavaScript/TypeScript.

***

### 📬 Support & Inquiries

Need help setting up your scraper, requesting a feature, or looking for custom high-volume ad intelligence solutions?

- **Contact**: `chadibaraou23@gmail.com`

# Actor input Schema

## `search_keyword` (type: `string`):

Keywords to search in Meta Ad Library (e.g. 'AI UGC', 'Shopify dropshipping', or competitor brand names).

## `page_urls` (type: `array`):

List of Facebook Page URLs (e.g. https://www.facebook.com/Nike) or numeric Page IDs to scrape ads for.

## `limit` (type: `integer`):

The maximum number of ads to retrieve. Defaults to 20.

## `country_code` (type: `string`):

Target country code for ads. Use 'ALL' for worldwide reach.

## `is_active` (type: `string`):

Filter ads by active status or retrieve both.

## `ad_type` (type: `string`):

General commercial ads or political/issue ads.

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

Apify Proxy configuration. Supports Apify Residential Proxy (RESIDENTIAL group), datacenter proxies, or custom proxy URLs with country targeting.

## Actor input object example

```json
{
  "search_keyword": "AI UGC",
  "page_urls": [],
  "limit": 20,
  "country_code": "ALL",
  "is_active": "ALL",
  "ad_type": "all",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

API URL to retrieve the full list of authentic scraped Meta ad items from the default dataset.

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

API URL to inspect default dataset metadata and export endpoints.

# 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 = {
    "search_keyword": "AI UGC",
    "page_urls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("chadi.baraou/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 = {
    "search_keyword": "AI UGC",
    "page_urls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("chadi.baraou/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 '{
  "search_keyword": "AI UGC",
  "page_urls": []
}' |
apify call chadi.baraou/facebook-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chadi.baraou/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/3KNiuTl2dVvw14VTJ/builds/KMhPalPjHcoPRQSdL/openapi.json
