# Facebook Ad Library Scraper - Active Ads & Creatives (`thirdwatch/fb-ad-library-scraper`) Actor

Scrape Facebook's public Ad Library for any brand. Returns active ad count, per-creative text, CTA, start date, and platform mix (Facebook, Instagram, Messenger, Audience Network).

- **URL**: https://apify.com/thirdwatch/fb-ad-library-scraper.md
- **Developed by:** [Thirdwatch](https://apify.com/thirdwatch) (community)
- **Categories:** Social media, SEO tools
- **Stats:** 13 total users, 6 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $22.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 public Meta Ad Library results for brands, keywords, and ad categories. The actor talks to Meta Ad Library's public GraphQL surface directly, so it avoids browser rendering while still returning ad IDs, page details, creative text, CTA/link fields, media URLs, dates, and platform mix where Meta exposes the data.

### Value prop

Meta's Ad Library is one of the most accessible public sources for seeing which ads are currently active for a brand or keyword. This actor packages that public Ad Library view into Apify dataset rows so growth teams, agencies, researchers, and compliance teams can monitor ad activity without manually searching the Library one brand at a time.

Best fit:

- Growth teams tracking competitor creative angles and CTAs.
- Agencies building swipe files and pitch research.
- Brand teams auditing their own active ad inventory.
- Researchers monitoring political, issue, housing, employment, or credit ads.
- Compliance teams checking regulated ad categories.

### What's new

- Brand and keyword search against Meta Ad Library's public GraphQL responses.
- Country filtering with `ALL` or ISO country codes such as `US`, `IN`, `GB`, `CA`, and `AU`.
- Ad category targeting for all ads, political and issue ads, housing ads, employment ads, and credit ads where available.
- Optional creative capture limit so you can run count-only checks or collect sample ads.

### What data you get

| Field | Description |
|-------|-------------|
| `brand` | Brand or keyword searched |
| `country` | Country filter applied, or `ALL` |
| `adType` | Ad category requested |
| `url` | Meta Ad Library search URL |
| `active` | Whether active matching ads were detected |
| `adCount` | Matching ad count reported by Meta when available |
| `creatives` | Array of captured ad rows |
| `creativeCount` | Number of ad rows captured |

#### Creative fields

| Field | Description |
|-------|-------------|
| `ad_archive_id` | Meta Ad Library ID |
| `page_id` / `page_name` | Advertiser page details |
| `is_active` | Whether Meta marks the ad as active |
| `start_date` / `end_date` | Unix timestamps returned by Meta |
| `publisher_platform` | Platforms such as Facebook, Instagram, Messenger, Threads, or Audience Network |
| `body_text` | Primary creative text when available |
| `cta_text` / `link_url` | CTA and destination link when available |
| `image_url` / `video_url` | First detected media URL when available |

### Quick-start input examples

#### Track active ads for brands worldwide

```json
{
  "brands": ["allbirds", "hoka", "on running"],
  "country": "ALL",
  "adType": "all",
  "maxCreatives": 20
}
````

#### Check one country

```json
{
  "brands": ["nykaa", "myntra"],
  "country": "IN",
  "adType": "all",
  "maxCreatives": 50
}
```

#### Political or issue ad monitoring

```json
{
  "brands": ["climate policy", "election campaign"],
  "country": "US",
  "adType": "political_and_issue_ads",
  "maxCreatives": 100
}
```

#### Count-only monitoring

```json
{
  "brands": ["example brand"],
  "country": "ALL",
  "adType": "all",
  "maxCreatives": 0
}
```

### Sample output snippet

```json
{
  "brand": "allbirds",
  "country": "US",
  "adType": "all",
  "url": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&q=allbirds",
  "active": true,
  "adCount": 17,
  "creatives": [
    {
      "ad_archive_id": "2351811061967398",
      "page_id": "1770436946575287",
      "page_name": "Clove & Twine",
      "is_active": true,
      "start_date": 1775113200,
      "end_date": 1781679600,
      "publisher_platform": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK"],
      "body_text": "Custom merch made simple.",
      "cta_text": "Shop now",
      "link_url": "https://example.com",
      "image_url": "https://..."
    }
  ],
  "creativeCount": 1
}
```

### Use cases

- **Competitor ad monitoring:** See whether a brand is running active ads and collect examples of visible copy.
- **Creative research:** Build a swipe file of CTAs, hooks, platform mix, and messaging angles.
- **Brand auditing:** Check your own active ads by country and category.
- **Agency research:** Prepare pitches with public competitor ad examples.
- **Political and issue monitoring:** Track active political or issue ad visibility in supported countries.
- **Regulated category checks:** Review housing, employment, and credit ad examples where Meta exposes them.

### Pricing examples

This actor uses pay-per-result pricing on Apify. In the standard output, one dataset item is returned per searched brand or keyword, with creatives nested inside that row.

Example cost formula:

```text
number of searched brands or keywords x current price per result = estimated run cost
```

Example at a hypothetical $0.002 per result:

| Brands or keywords searched | Example cost |
|-----------------------------|--------------|
| 25 | $0.05 |
| 100 | $0.20 |
| 1,000 | $2.00 |

Check the actor pricing tab for the current live price. If you need pricing per captured creative instead of per searched brand, ask for a custom output shape.

### Limitations

- Coverage varies by country and ad category because Meta controls what the public Ad Library exposes.
- In some regions, commercial ads may be less visible than political, issue, housing, employment, or credit ads.
- Meta can change the public GraphQL document IDs or response shape; the actor keeps the request isolated so this can be refreshed quickly.
- Apify cloud direct egress can return false zero-count responses from Meta, so the default uses residential proxy while still avoiding browser compute.
- Text snippets and media URLs depend on what Meta includes in the public snapshot payload.
- Spend, impression, demographic, and disclaimer fields are not consistently available for standard commercial ads.
- A brand active in one country can return no results in another country filter.

### Competitor and comparison notes

- **Compared with Meta's Ad Library UI:** This actor is better for repeatable monitoring, exports, and multiple-brand checks. The UI is better for manual review of a small number of ads.
- **Compared with Meta APIs:** API access and field availability depend on Meta's permissions and ad category rules. This actor is designed for public Ad Library pages and self-serve Apify workflows.
- **Compared with social post scrapers:** This actor focuses on active paid ads, not organic posts.
- **Compared with full creative intelligence platforms:** This actor is a lightweight data extraction tool. It does not include built-in spend estimation, creative scoring, or dashboard analytics.

Pairs well with [Instagram Scraper](https://apify.com/thirdwatch/instagram-scraper?fpr=9m2cd6) for organic post monitoring and [TikTok Scraper](https://apify.com/thirdwatch/tiktok-scraper?fpr=9m2cd6) for cross-platform competitor tracking.

### FAQ

**Do I need a Facebook account?**
No. The actor uses public Meta Ad Library GraphQL responses.

**Why do results differ by country?**
Meta shows different ad inventory by region, and availability can vary by ad category and local rules.

**Can I get ad spend data?**
Not reliably for standard commercial ads. Spend ranges are most commonly exposed for regulated categories such as political or issue ads where Meta provides disclosures.

**Can I get images or videos?**
Yes when Meta includes media URLs in the public snapshot payload. Some ads expose only partial creative metadata.

**Can I monitor the same brands every day?**
Yes. Schedule the actor in Apify and compare counts or creative snippets over time.

### Support and custom builds

Need media capture, spend/disclaimer fields where available, deduplication, daily monitoring, Slack alerts, Looker/Sheets exports, or a custom ad intelligence workflow? Contact Thirdwatch at [thirdwatch.dev](https://thirdwatch.dev) or through the Apify actor support channel.

Last verified: 2026-06

# Actor input Schema

## `brands` (type: `array`):

Brand names or pages to search the Facebook Ad Library for. Each brand returns one dataset item with the active ad count, country, and up to N creative samples (text, CTA, start date, platforms).

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

ISO country code or 'ALL' for worldwide. Default: ALL. Common codes: US, IN, GB, CA, AU.

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

Category of ads to search. Default: all.

## `maxCreatives` (type: `integer`):

Maximum number of individual ad creatives to capture per brand (text + start date + CTA). Set to 0 to return count only.

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

Apify Proxy settings. The default uses residential proxy for reliable Meta Ad Library GraphQL responses from Apify cloud.

## Actor input object example

```json
{
  "brands": [
    "allbirds"
  ],
  "country": "ALL",
  "adType": "all",
  "maxCreatives": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# 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 = {
    "brands": [
        "allbirds"
    ],
    "country": "ALL",
    "maxCreatives": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thirdwatch/fb-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 = {
    "brands": ["allbirds"],
    "country": "ALL",
    "maxCreatives": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thirdwatch/fb-ad-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 '{
  "brands": [
    "allbirds"
  ],
  "country": "ALL",
  "maxCreatives": 20
}' |
apify call thirdwatch/fb-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Ad Library Scraper - Active Ads & Creatives",
        "description": "Scrape Facebook's public Ad Library for any brand. Returns active ad count, per-creative text, CTA, start date, and platform mix (Facebook, Instagram, Messenger, Audience Network).",
        "version": "1.0",
        "x-build-id": "vjfnZuXNauU8jdVfg"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/thirdwatch~fb-ad-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-thirdwatch-fb-ad-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/thirdwatch~fb-ad-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-thirdwatch-fb-ad-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/thirdwatch~fb-ad-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-thirdwatch-fb-ad-library-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "brands"
                ],
                "properties": {
                    "brands": {
                        "title": "Brand names",
                        "type": "array",
                        "description": "Brand names or pages to search the Facebook Ad Library for. Each brand returns one dataset item with the active ad count, country, and up to N creative samples (text, CTA, start date, platforms).",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "ISO country code or 'ALL' for worldwide. Default: ALL. Common codes: US, IN, GB, CA, AU.",
                        "default": "ALL"
                    },
                    "adType": {
                        "title": "Ad type",
                        "enum": [
                            "all",
                            "political_and_issue_ads",
                            "housing_ads",
                            "employment_ads",
                            "credit_ads"
                        ],
                        "type": "string",
                        "description": "Category of ads to search. Default: all.",
                        "default": "all"
                    },
                    "maxCreatives": {
                        "title": "Max creatives per brand",
                        "minimum": 0,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of individual ad creatives to capture per brand (text + start date + CTA). Set to 0 to return count only.",
                        "default": 20
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. The default uses residential proxy for reliable Meta Ad Library GraphQL responses from Apify cloud.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "apifyProxyCountry": "US"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
