# Meta Ads Library Scraper (`trovevault/meta-ads-library-scraper`) Actor

Extract public Meta Ad Library ads with page names, creative text, body copy, captions, CTA labels, dates, landing pages, images, videos, platforms, and direct ad links.

- **URL**: https://apify.com/trovevault/meta-ads-library-scraper.md
- **Developed by:** [Trove Vault](https://apify.com/trovevault) (community)
- **Categories:** E-commerce, SEO tools, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 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.
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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## Meta Ads Library Scraper

Extract public Meta Ad Library ads without requiring a Meta API token. The actor searches the public Meta Ad Library for brands, page names, domains, or keywords, then returns structured ad rows with page names, ad archive IDs, active status, dates, creative text, landing pages, image URLs, video URLs, platforms, and direct ad detail links.

Use it when you want a low-friction Meta ads export for competitor monitoring, creative research, agency reporting, or cross-platform ad intelligence workflows.

### Why use Meta Ads Library Scraper?

- Search Meta Ad Library without asking users for a Meta developer token.
- Export creative text, headlines, descriptions, CTA text, landing pages, images, videos, and advertiser page details.
- Monitor active and inactive ads by brand or keyword.
- Build creative swipe files from public Facebook and Instagram ad records.
- Combine Meta rows with Google, TikTok, Bing, and LinkedIn ad datasets.

### What data does Meta Ads Library Scraper extract?

| Field group | Fields |
|---|---|
| Search context | `target`, `country`, `runId` |
| Advertiser identity | `pageName`, `pageId`, `pageProfileUrl`, `pageProfilePictureUrl` |
| Creative identity | `adArchiveId`, `adId`, `adDetailsUrl`, `isActive` |
| Timing | `startDate`, `endDate` |
| Copy and links | `headline`, `description`, `caption`, `callToAction`, `creativeBody`, `creativeText`, `landingPageUrl`, `landingPageUrls` |
| Assets | `imageUrl`, `imageUrls`, `videoUrl`, `videoUrls`, `displayFormat` |
| Delivery context | `publisherPlatforms`, `impressionsText`, `reachEstimate`, `categories`, `collationCount` |

The actor uses public Meta Ad Library pages and browser rendering. It does not require a Facebook login or Meta API access token for the tested public search path.

### What input does Meta Ads Library Scraper accept?

```json
{
  "targets": ["Nike"],
  "country": "US",
  "maxAds": 25,
  "activeStatus": "ALL"
}
````

| Input | Required | Description |
|---|---:|---|
| `targets` | Yes | Brand names, page names, domains, or keywords. Examples: `Nike`, `nike.com`, `Shopify`. |
| `country` | Yes | ISO country code used by Meta Ad Library. Examples: `US`, `GB`, `DE`, `FR`, `PT`. Default: `US`. |
| `maxAds` | No | Maximum ad records to return per target. Default: `25`; maximum: `250`. |
| `activeStatus` | No | `ALL`, `ACTIVE`, or `INACTIVE`. Default: `ALL`. |
| `shownSince` | No | Keep ads whose end date or start date is on or after this `YYYY-MM-DD` date. |
| `datasetId` | No | Existing Apify dataset ID for pipeline runs. Rows are appended there in addition to the default run dataset. |
| `runId` | No | External workflow ID copied to output rows and `RUN_SUMMARY`. |

### What output does Meta Ads Library Scraper return?

Example row:

```json
{
  "target": "Nike",
  "country": "US",
  "pageName": "Nike",
  "pageId": "15087023444",
  "adArchiveId": "1869276447125570",
  "isActive": true,
  "startDate": "2026-07-10",
  "headline": "Nike",
  "description": "Shop new releases",
  "creativeText": "Nike | Shop new releases",
  "landingPageUrl": "https://www.nike.com/",
  "imageUrl": "https://scontent.xx.fbcdn.net/...",
  "publisherPlatforms": ["FACEBOOK", "INSTAGRAM"],
  "adDetailsUrl": "https://www.facebook.com/ads/library/?id=1869276447125570"
}
```

Some ads are carousel or video creatives. Those rows can include multiple `imageUrls`, `videoUrls`, and `landingPageUrls`. Meta does not expose `headline` or `description` for every public ad record; when those fields are absent, use `creativeBody`, `caption`, `callToAction`, and `creativeText` for the available copy.

### How do I run Meta Ads Library Scraper?

1. Add one or more brands, page names, domains, or keywords.
2. Choose a country and active status.
3. Set `maxAds` based on how deep you want the run to go.
4. Run the actor and download the dataset as JSON, CSV, Excel, or through the Apify API.

### How can I use Meta Ads Library Scraper through the API?

```bash
curl "https://api.apify.com/v2/acts/YOUR_USERNAME~meta-ads-library-scraper/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{
    "targets": ["Nike"],
    "country": "US",
    "maxAds": 25
  }'
```

Fetch dataset items:

```bash
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?clean=true" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

### How can I monitor advertisers over time?

Schedule the actor daily or weekly with the same targets and country. Use `adArchiveId`, `pageId`, `startDate`, `endDate`, and `creativeText` to deduplicate ads and detect new creative angles.

### What are the limits of Meta Ads Library Scraper?

- Public keyword searches can return ads that mention the target, not only ads owned by that brand.
- Browser rendering is slower and more expensive than the official Graph API path.
- Headline and description are returned only when Meta exposes `title` or link description fields in the public payload.
- Spend, impressions, and targeting fields are only returned when visible in the public page payload.
- Meta can change page structure, public payloads, or anti-bot behavior.
- The actor records recoverable extraction issues in `RUN_SUMMARY` rather than inventing rows.

### How do I troubleshoot Meta Ads Library Scraper?

| Issue | Likely cause | Solution |
|---|---|---|
| No rows were returned | No public ads matched the target/country/status, or Meta changed the public page payload | Try a broader target, another country, or check `RUN_SUMMARY`. |
| Results include unrelated advertisers | Keyword search matches text and mentions | Use a more specific brand, domain, or page name. |
| Some rows have no images or videos | The public record is text-only or Meta withheld the asset in the page payload | Use creative text, landing page, and ad detail URL fields. |
| Runs are slower than API-based actors | The actor uses a browser to access the public page | Lower `maxAds` for quick checks or split large target lists. |

### What changed in the current version?

#### 0.1

- Initial public Meta Ad Library scraper with no Meta API token required, browser rendering, creative text extraction, landing pages, images, videos, dates, platforms, and direct ad links.

# Actor input Schema

## `targets` (type: `array`):

Search terms to look up in the public Meta Ad Library. Examples: Nike, nike.com, Shopify. Use specific names for cleaner competitor monitoring.

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

Country reached by ads, using ISO 3166-1 alpha-2 codes accepted by Meta. Examples: US, GB, DE, FR, PT. Default: US.

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

Maximum ad records to return per target. Use 5-50 for quick checks and higher values for deeper monitoring. Default: 25; maximum: 250.

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

Meta ad activity filter used by the public Ad Library page. ALL returns active and inactive ads when available; ACTIVE returns currently active ads. Default: ALL.

## `shownSince` (type: `string`):

Only keep ads whose end date or start date is on or after this YYYY-MM-DD date. Leave empty for all returned dates.

## `datasetId` (type: `string`):

Optional existing Apify dataset ID for pipeline runs. Rows are appended there in addition to the default run dataset. Leave empty for normal one-off runs.

## `runId` (type: `string`):

Optional external run or workflow ID to include in output rows and RUN\_SUMMARY. Use it to join scheduled runs with your own monitoring jobs; leave empty when not needed.

## Actor input object example

```json
{
  "targets": [
    "Nike"
  ],
  "country": "US",
  "maxAds": 25,
  "activeStatus": "ALL"
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

No description

## `runSummaryUrl` (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 = {
    "targets": [
        "Nike"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trovevault/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 = { "targets": ["Nike"] }

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Meta Ads Library Scraper",
        "description": "Extract public Meta Ad Library ads with page names, creative text, body copy, captions, CTA labels, dates, landing pages, images, videos, platforms, and direct ad links.",
        "version": "0.1",
        "x-build-id": "afDhsSEdxFzP91w7E"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/trovevault~meta-ads-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-trovevault-meta-ads-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/trovevault~meta-ads-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-trovevault-meta-ads-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/trovevault~meta-ads-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-trovevault-meta-ads-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": [
                    "targets",
                    "country"
                ],
                "properties": {
                    "targets": {
                        "title": "Brands or Keywords",
                        "type": "array",
                        "description": "Search terms to look up in the public Meta Ad Library. Examples: Nike, nike.com, Shopify. Use specific names for cleaner competitor monitoring.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "Nike"
                        ]
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "Country reached by ads, using ISO 3166-1 alpha-2 codes accepted by Meta. Examples: US, GB, DE, FR, PT. Default: US.",
                        "default": "US"
                    },
                    "maxAds": {
                        "title": "Maximum Ads",
                        "minimum": 1,
                        "maximum": 250,
                        "type": "integer",
                        "description": "Maximum ad records to return per target. Use 5-50 for quick checks and higher values for deeper monitoring. Default: 25; maximum: 250.",
                        "default": 25
                    },
                    "activeStatus": {
                        "title": "Active Status",
                        "enum": [
                            "ALL",
                            "ACTIVE",
                            "INACTIVE"
                        ],
                        "type": "string",
                        "description": "Meta ad activity filter used by the public Ad Library page. ALL returns active and inactive ads when available; ACTIVE returns currently active ads. Default: ALL.",
                        "default": "ALL"
                    },
                    "shownSince": {
                        "title": "Shown Since",
                        "type": "string",
                        "description": "Only keep ads whose end date or start date is on or after this YYYY-MM-DD date. Leave empty for all returned dates."
                    },
                    "datasetId": {
                        "title": "Dataset ID",
                        "type": "string",
                        "description": "Optional existing Apify dataset ID for pipeline runs. Rows are appended there in addition to the default run dataset. Leave empty for normal one-off runs."
                    },
                    "runId": {
                        "title": "Run ID",
                        "type": "string",
                        "description": "Optional external run or workflow ID to include in output rows and RUN_SUMMARY. Use it to join scheduled runs with your own monitoring jobs; leave empty when not needed."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
