# Facebook Ads Library Scraper - Meta Ad Creative Monitor (`meilimiao/facebook-ads-library-monitor`) Actor

Scrape Meta/Facebook Ads Library by keyword, Ads Library URL, or Page ID. Extract ad copy, creatives, CTA, landing pages, dates, and monitor newly launched competitor ads.

- **URL**: https://apify.com/meilimiao/facebook-ads-library-monitor.md
- **Developed by:** [Glamour Meow](https://apify.com/meilimiao) (community)
- **Categories:** Social media, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Ads Library Scraper - Meta Ad Creative Monitor

Scrape public Meta/Facebook Ads Library results by keyword, Ads Library URL, or Facebook Page ID. Extract competitor ad copy, creatives, CTAs, landing pages, start dates, active status, and ad snapshot URLs.

Built for media buyers, agencies, DTC brands, SaaS marketers, growth teams, and competitive intelligence workflows.

### Why use this Actor?

- **Keyword and advertiser research** — search the public Meta Ads Library by keyword or Page ID.
- **Creative intelligence** — extract ad text, titles, descriptions, CTA, landing pages, all detected external landing page URLs, images, and video URLs when visible.
- **Monitoring mode** — remember seen Library IDs and output only newly discovered ads on scheduled runs.
- **No Facebook login required** — uses the public Ads Library UI.
- **CSV/JSON ready** — structured dataset output for spreadsheets, dashboards, and ad swipe files.
- **Residential proxy ready** — recommended for reliable production scraping.

### Input example

```json
{
  "searchTerms": ["nike"],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "all",
  "maxAds": 100,
  "maxScrolls": 20,
  "includeImages": true,
  "includeVideos": true,
  "monitorMode": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
````

### Output example

```json
{
  "adArchiveId": "1869276447125570",
  "libraryId": "1869276447125570",
  "isActive": true,
  "activeStatus": "Active",
  "startDateText": "Mar 17, 2026",
  "advertiserName": "Nike",
  "advertiserPageUrl": "https://www.facebook.com/nike",
  "adText": "Celebra tu cumpleaños con Nike...",
  "title": "Nike",
  "description": "Download Nike: Shoes, Apparel, Stories...",
  "cta": "Install Now",
  "landingPageUrl": "https://itunes.apple.com/...",
  "landingPageUrls": ["https://itunes.apple.com/..."],
  "displayUrl": "ITUNES.APPLE.COM",
  "hasMultipleVersions": true,
  "imageUrls": ["https://..."],
  "videoUrls": [],
  "snapshotUrl": "https://www.facebook.com/ads/library/?id=1869276447125570",
  "sourceUrl": "https://www.facebook.com/ads/library/?...",
  "searchTerm": "nike",
  "country": "US",
  "scrapedAt": "2026-06-27T12:00:00.000Z"
}
```

### Monitoring mode

Set:

```json
{
  "monitorMode": true,
  "monitorKey": "nike-us-active"
}
```

The Actor stores seen Library IDs in the default key-value store and returns only new ads on later runs with the same `monitorKey`.

### Recommended proxy setup

Meta may block or rate-limit datacenter traffic. Use residential proxies for production:

```json
"proxyConfiguration": {
  "useApifyProxy": true,
  "apifyProxyGroups": ["RESIDENTIAL"],
  "apifyProxyCountry": "US"
}
```

### Limitations

- Meta frequently changes Ads Library HTML/GraphQL internals; ongoing maintenance is expected.
- Some media URLs are lazy-loaded or protected and may not appear in every result.
- Official Graph API spend/impression/demographic fields are limited mainly to political/issue/EU ads and may require a Meta access token; this MVP focuses on the public no-login Ads Library UI.
- Use moderate `maxScrolls` and residential proxies for best reliability.

### SEO keywords

Facebook Ads Library scraper, Meta Ads scraper, Facebook ad spy scraper, competitor ads scraper, Meta ad creative monitor, Facebook ad creative scraper, Instagram ads scraper, ad library API, competitor ad monitoring, DTC ad spy, paid social creative research.

# Actor input Schema

## `searchTerms` (type: `array`):

Keywords to search in Meta/Facebook Ads Library, e.g. nike, skincare, ai software.

## `startUrls` (type: `array`):

Optional full Facebook Ads Library search URLs. Use this for advanced filters copied from the Ads Library UI.

## `pageIds` (type: `array`):

Optional Facebook Page IDs to scrape all ads from a specific advertiser.

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

ISO country code used by Ads Library, e.g. US, GB, CA, AU.

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

Filter active, inactive, or all ads.

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

Filter by media type.

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

Maximum unique ads to save across all searches.

## `maxScrolls` (type: `integer`):

How many infinite-scroll pages to load per search.

## `includeImages` (type: `boolean`):

Include image creative URLs visible in the Ads Library card.

## `includeVideos` (type: `boolean`):

Include video creative URLs when visible in the Ads Library card.

## `monitorMode` (type: `boolean`):

When enabled, the Actor uses a named key-value store to remember seen Library IDs for monitorKey and outputs only newly discovered ads.

## `monitorKey` (type: `string`):

Storage key for monitoring mode. Use one key per competitor/search, e.g. nike-us-active.

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

Recommended: Apify Proxy with RESIDENTIAL group. Meta often blocks datacenter traffic.

## Actor input object example

```json
{
  "searchTerms": [
    "nike"
  ],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "all",
  "maxAds": 100,
  "maxScrolls": 20,
  "includeImages": true,
  "includeVideos": true,
  "monitorMode": false,
  "monitorKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# 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 = {
    "searchTerms": [
        "nike"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("meilimiao/facebook-ads-library-monitor").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 = {
    "searchTerms": ["nike"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("meilimiao/facebook-ads-library-monitor").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 '{
  "searchTerms": [
    "nike"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call meilimiao/facebook-ads-library-monitor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Ads Library Scraper - Meta Ad Creative Monitor",
        "description": "Scrape Meta/Facebook Ads Library by keyword, Ads Library URL, or Page ID. Extract ad copy, creatives, CTA, landing pages, dates, and monitor newly launched competitor ads.",
        "version": "0.1",
        "x-build-id": "ybgTCitDer2BCDJ8Z"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/meilimiao~facebook-ads-library-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-meilimiao-facebook-ads-library-monitor",
                "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/meilimiao~facebook-ads-library-monitor/runs": {
            "post": {
                "operationId": "runs-sync-meilimiao-facebook-ads-library-monitor",
                "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/meilimiao~facebook-ads-library-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-meilimiao-facebook-ads-library-monitor",
                "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",
                "properties": {
                    "searchTerms": {
                        "title": "Search keywords",
                        "type": "array",
                        "description": "Keywords to search in Meta/Facebook Ads Library, e.g. nike, skincare, ai software.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Ads Library URLs",
                        "type": "array",
                        "description": "Optional full Facebook Ads Library search URLs. Use this for advanced filters copied from the Ads Library UI.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "pageIds": {
                        "title": "Facebook Page IDs",
                        "type": "array",
                        "description": "Optional Facebook Page IDs to scrape all ads from a specific advertiser.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "ISO country code used by Ads Library, e.g. US, GB, CA, AU.",
                        "default": "US"
                    },
                    "activeStatus": {
                        "title": "Active status",
                        "enum": [
                            "active",
                            "inactive",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter active, inactive, or all ads.",
                        "default": "active"
                    },
                    "mediaType": {
                        "title": "Media type",
                        "enum": [
                            "all",
                            "image",
                            "video",
                            "memes",
                            "none"
                        ],
                        "type": "string",
                        "description": "Filter by media type.",
                        "default": "all"
                    },
                    "maxAds": {
                        "title": "Maximum ads",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum unique ads to save across all searches.",
                        "default": 100
                    },
                    "maxScrolls": {
                        "title": "Maximum scrolls",
                        "minimum": 1,
                        "maximum": 250,
                        "type": "integer",
                        "description": "How many infinite-scroll pages to load per search.",
                        "default": 20
                    },
                    "includeImages": {
                        "title": "Include image URLs",
                        "type": "boolean",
                        "description": "Include image creative URLs visible in the Ads Library card.",
                        "default": true
                    },
                    "includeVideos": {
                        "title": "Include video URLs",
                        "type": "boolean",
                        "description": "Include video creative URLs when visible in the Ads Library card.",
                        "default": true
                    },
                    "monitorMode": {
                        "title": "Monitoring mode: only output new ads",
                        "type": "boolean",
                        "description": "When enabled, the Actor uses a named key-value store to remember seen Library IDs for monitorKey and outputs only newly discovered ads.",
                        "default": false
                    },
                    "monitorKey": {
                        "title": "Monitoring key",
                        "type": "string",
                        "description": "Storage key for monitoring mode. Use one key per competitor/search, e.g. nike-us-active.",
                        "default": "default"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Recommended: Apify Proxy with RESIDENTIAL group. Meta often blocks datacenter traffic.",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
