# Facebook & Meta Ads Library Scraper — Ad Intelligence Tool (`aiscraperdev/facebook-meta-ads-library-scraper`) Actor

Scrape Facebook & Instagram ads by keyword, brand, or country. Extract ad copy, creatives, CTA, video URLs & advertiser data. No login required.

- **URL**: https://apify.com/aiscraperdev/facebook-meta-ads-library-scraper.md
- **Developed by:** [Randeep Dhillon](https://apify.com/aiscraperdev) (community)
- **Categories:** Social media, Lead generation, Developer tools
- **Stats:** 61 total users, 7 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

### Meta Ads Library Scraper — Facebook & Instagram Ad Intelligence

Extract structured ad data from the **Meta (Facebook & Instagram) Ads Library**
at scale. Search by keyword, brand name, or paste any Ad Library URL directly.
No Meta account, cookies, or API key required.

***

#### What you can do with this scraper

- **Competitor research** — see every ad your competitors are running right now
- **Creative inspiration** — build a swipe file of winning image and video ads
- **Dropshipping & ecommerce** — find trending products being heavily advertised
- **Agency reporting** — pull client competitor data in minutes, not hours
- **Market research** — track ad trends by keyword, country, or industry
- **Lead generation** — identify brands actively spending on paid ads

***

#### How to use

**Step 1 — Add your search queries**

The `Search Queries / URLs` field accepts three types of input (you can mix them):

| Input type | Example |
|---|---|
| Keyword | `skincare`, `dropshipping`, `fitness app` |
| Facebook Page URL | `https://www.facebook.com/nike` |
| Ad Library URL | `https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=IN&q=example` |

You can add multiple queries at once — the actor will scrape all of them in a single run.

**Step 2 — Set your filters**

| Filter | Options | Default |
|---|---|---|
| **Country** | Any 2-letter code: `US`, `IN`, `UK`, `ALL` | `ALL` |
| **Ad Status** | All / Active / Inactive | `All` |
| **Ad Type** | All / Political & Issue / Housing / Employment | `All` |
| **Media Type** | All / Image / Video / Meme | `All` |
| **Platform** | All / Facebook / Instagram / Messenger / Audience Network | `All` |
| **Max Results** | Any number, or `-1` to scrape everything | `100` |

**Step 3 — Run and export**

Click **Start** and wait for the run to complete. Download your results in **JSON, CSV, or Excel**.

***

#### Sample output

```json
{
  "ad_id": "1555263375851429",
  "ad_format": "video",
  "ad_body_text": "Vintage and new Pokémon cards starting at $1 ⚡️",
  "ad_headline": "Live on Whatnot",
  "cta_text": "Install Now",
  "landing_page_url": "https://...",
  "image_url": "https://...",
  "video_url": "https://...",
  "page_name": "Whatnot",
  "page_country": "US",
  "ad_status": "Active",
  "ad_active_duration_days": 238,
  "start_date": "2025-01-15",
  "publisher_platforms": ["facebook", "instagram"]
}
```

***

#### Input schema reference

```json
{
  "searchQueries": ["nike", "https://www.facebook.com/adidas"],
  "countryCode": "US",
  "adStatus": "active",
  "adType": "all",
  "mediaType": "video",
  "platform": "instagram",
  "maxResults": 500
}
```

***

#### Who uses this

- **Digital marketers** tracking competitor campaigns
- **Dropshippers** validating winning products before investing in inventory
- **Marketing agencies** building pitch decks and client reports
- **Growth hackers** identifying high-spend advertisers in any niche
- **Researchers** studying political and issue-based ad campaigns

***

#### Pricing

This actor uses **Pay-Per-Result** pricing — you only pay for ads actually scraped.
**$3.00 per 1,000 ads** on the free plan.

***

#### Tips for best results

- Use **residential proxies** for maximum coverage — without proxies Meta limits results heavily
- Set `adStatus` to `active` to focus only on currently running campaigns
- Sort by impressions using an Ad Library URL to find the highest-performing ads first
- Use `maxResults: -1` carefully — popular keywords can return thousands of ads

***

#### Limitations

- Spend and impressions data is only available for **EU/political/special category ads** — Meta does not expose this for standard commercial ads
- Media URLs (images, videos) are **temporary CDN links** — download them promptly after scraping
- Results may vary without proxy configuration

***

#### Related scrapers

- Facebook Page Scraper
- Instagram Profile Scraper
- TikTok Ads Scraper

# Actor input Schema

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

Keywords, Facebook Page URLs, or paste Ad Library URLs directly.

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

2-letter country code (e.g., US, IN, ALL).

## `adStatus` (type: `string`):

Filter ads by their current delivery status.

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

Filter by the type of ad campaign.

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

Filter by the type of media used in the ad.

## `platform` (type: `string`):

Filter by the Meta platform where the ad is displayed.

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

Maximum number of ads to scrape per query (-1 for all).

## Actor input object example

```json
{
  "searchQueries": [
    "all"
  ],
  "countryCode": "ALL",
  "adStatus": "all",
  "adType": "all",
  "mediaType": "all",
  "platform": "all",
  "maxResults": 100
}
```

# Actor output Schema

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

No description

# 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": [
        "all"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aiscraperdev/facebook-meta-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": ["all"] }

# Run the Actor and wait for it to finish
run = client.actor("aiscraperdev/facebook-meta-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": [
    "all"
  ]
}' |
apify call aiscraperdev/facebook-meta-ads-library-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/61ZxN9vWi0KEZ4pOz/builds/ETF0FWv82oEkfGlAp/openapi.json
