# Facebook Ad Library Scraper - Competitor Ad Intelligence (`makework36/facebook-adlib-scraper`) Actor

Scrape Meta Ad Library by keyword or advertiser, any country. Returns ad creative (image), copy, CTA, landing URL + domain, platforms and dates, plus an optional competitor summary grouped by advertiser. Spend/impressions when Meta exposes them. No login.

- **URL**: https://apify.com/makework36/facebook-adlib-scraper.md
- **Developed by:** [deusex machine](https://apify.com/makework36) (community)
- **Categories:** Social media, Lead generation, AI
- **Features:** Limited permissions
- **Stats:** 24 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.65 / 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/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

## Facebook Ad Library Scraper

Scrape the Meta Ad Library for any keyword, brand, or advertiser name. Returns structured data for every ad: creative text, call-to-action, landing page, platforms, spend and impression ranges (when available), and media URLs.

Works across all countries supported by the Ad Library. No Facebook login required.

### 📤 Output fields

For each ad, you get a JSON object like this (from a "nike" search):

```json
{
    "adArchiveID": "582019374031826",
    "status": "ACTIVE",
    "startDate": "2026-03-15",
    "endDate": null,
    "pageName": "Nike",
    "pageID": "15087023444",
    "adText": "Just satisfying enough. The Pegasus Premium with ReactX foam returns energy like nothing else. Available now.",
    "callToAction": "Shop Now",
    "link": "https://www.nike.com/running/pegasus-premium",
    "platforms": ["facebook", "instagram"],
    "spend": null,
    "impressions": null,
    "versions": 3,
    "mediaUrl": "https://scontent.xx.fbcdn.net/v/t45.1600-4/example_image.jpg"
}
```

| Field | Type | Description |
|-------|------|-------------|
| adArchiveID | string | Unique ad identifier in Meta's Ad Library |
| status | string | ACTIVE or INACTIVE |
| startDate | string | Date the ad started running (YYYY-MM-DD) |
| endDate | string | Date the ad stopped, or null if still running |
| pageName | string | Name of the page running the ad |
| pageID | string | Facebook page ID |
| adText | string | Primary text of the ad creative |
| callToAction | string | CTA button text (Shop Now, Learn More, Sign Up, etc.) |
| link | string | Landing page URL |
| platforms | array | Where the ad runs: facebook, instagram, messenger, audience_network |
| spend | object | Spend range with lower_bound/upper_bound. See note below. |
| impressions | object | Impression range with lower_bound/upper_bound. See note below. |
| versions | integer | Number of creative variations |
| mediaUrl | string | URL to the ad image or video thumbnail |

### 📥 Input

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| query | string | Yes | - | Keyword or advertiser name to search |
| country | string | No | US | 2-letter country code, or ALL for global |
| maxAds | integer | No | 50 | Max ads to return (up to 10,000) |

### 🎯 Use cases

- **Competitive ad intelligence** — track every active ad a competitor is running, who they target and which creative is currently in market.
- **Creative inspiration** — pull thousands of ads from top brands in your vertical to study hooks, CTAs and visual formats that are working right now.
- **Brand monitoring** — watch for unauthorized resellers or affiliates running ads in your name and feed alerts to your legal or brand team.
- **Political and social-issue ad transparency** — surface spend and impression ranges for political ads, election ads and issue ads in any supported country.
- **Agency reporting** — show clients what their competitors are spending on at the creative level instead of just channel-level totals.
- **Trend research** — search a keyword across all advertisers in a region to see how a category, product or messaging style evolves over time.

### 💵 Pricing

Runs cost approximately **$0.70 per 1,000 ads** scraped based on typical Apify platform compute usage. Actual cost depends on your subscription plan.

### ❓ FAQ

**Why are spend and impressions null?**

Meta only discloses spend and impression data for ads about social issues, elections, or politics. For regular commercial ads (which is the vast majority), these fields will be null. This is a Meta policy, not a scraper limitation.

**What countries are supported?**

Every country available in the Meta Ad Library. Use standard ISO 3166-1 alpha-2 codes: US, GB, DE, FR, BR, MX, IN, JP, AU, etc. Set country to "ALL" to search globally across all regions.

**Can I search for a specific advertiser?**

Yes. Enter the exact page name as the query (e.g., "Nike" or "Coca-Cola"). The Ad Library matches against page names and ad content.

**Does this need a Facebook account?**

No. The Meta Ad Library is a public transparency tool. No login or authentication is needed on your end.

**What about ads that have been taken down?**

The Ad Library keeps records of inactive ads for up to 7 years (political/social issue ads) or 1 year (commercial ads). You will see both active and inactive ads in results.

**How current is the data?**

Ads appear in the library within 24 hours of going live. The scraper pulls directly from Meta's current database.

# Changelog

This Actor's version history is a separate document: https://apify.com/makework36/facebook-adlib-scraper/changelog.md

# Actor input Schema

## `query` (type: `string`):

Search keyword or advertiser name to look up in the Meta Ad Library.

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

2-letter ISO country code. Use 'ALL' to search globally.

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

Maximum number of ads to scrape. Higher values take longer.

## `includeAdvertiserSummary` (type: `boolean`):

If enabled, adds one summary record per advertiser page (recordType='advertiser_summary') with total/active ad counts, CTAs used, platforms, landing domains and the first/last ad dates — a competitor-level view on top of the individual ads.

## Actor input object example

```json
{
  "query": "nike",
  "country": "US",
  "maxAds": 50,
  "includeAdvertiserSummary": false
}
```

# Actor output Schema

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

All scraped items in the default dataset (JSON).

## `csv` (type: `string`):

Default dataset formatted as CSV for spreadsheets (Google Sheets, Excel).

# 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 = {
    "query": "nike"
};

// Run the Actor and wait for it to finish
const run = await client.actor("makework36/facebook-adlib-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 = { "query": "nike" }

# Run the Actor and wait for it to finish
run = client.actor("makework36/facebook-adlib-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 '{
  "query": "nike"
}' |
apify call makework36/facebook-adlib-scraper --silent --output-dataset

```

## MCP server setup

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