# Facebook Ads Library Scraper (`devcake/facebook-ads-library-scraper`) Actor

Facebook Ads Library scraper for competitor research. Find active Meta ads by keyword or Page, export ad text, images, videos, and landing pages.

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

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Facebook Ads Library Scraper for Competitor Research

Collect public Meta ad records in bulk for competitor research, creative research, market analysis, and political transparency work. Search by keyword, Facebook Page URL, or a saved Ads Library URL, then review structured advertiser, copy, creative, platform, date, destination, and optional transparency fields.

Find and save public ads from the [Meta Ads Library](https://www.facebook.com/ads/library/) with this Facebook Ads Library scraper. Search by words, advertiser Pages, or an Ads Library link, then narrow the results and download them for competitor research, ad inspiration, and ongoing monitoring.

No Facebook login is required. For your first test, use the example search and collect 25 ads. You can review the results in a clear table before downloading them.

### 🔎 What can this Facebook Ads Library scraper do?

- 🔍 **Find ads in several ways** — enter keywords, Page IDs, Page URLs, or Ads Library links in one target field.
- 🎯 **Narrow your search** — choose the country, ad status, category, media type, platform, language, and date range.
- 🖼️ **Collect the full ad** — save ad text, headlines, buttons, images, videos, multi-image cards, and destination links.
- 🧹 **Remove duplicates** — the same ad is saved only once, even when several searches find it.
- 📥 **Download and share results** — review ads in Apify, download them as a spreadsheet, or connect them to your usual work tools.

### 👥 Who is it for?

- 📣 **Marketers and agencies** who want to see which ads competitors are running.
- 🎨 **Design and copy teams** looking for ideas across text, images, videos, offers, and buttons.
- 🔬 **Researchers** comparing advertising activity across brands, countries, languages, or time periods.
- 📊 **Analysts** who need organized Facebook ads data for reports and dashboards.
- 👀 **Monitoring teams** that want to follow new campaigns and creative changes over time.

### 📦 What information will you get?

Each result represents one public ad.

| Information | What it includes |
|---|---|
| 🏢 Advertiser | Page name, Page link, profile image, categories, and Page likes |
| ✍️ Ad text | Main text, headline, caption, link description, and button text |
| 🖼️ Ad design | Images, videos, previews, multi-image cards, and ad type |
| 🔗 Destination | Landing-page links and website domain |
| 📅 Delivery | Active or inactive status, start and end dates, platforms, and countries |
| 🔍 Public details | Spend, impressions, reach, payer, audience, and regional details when Meta shows them |

Some information is not shown for every ad. An empty value simply means Meta did not make that detail public.

### ▶️ How to use it

1. Add one or more search targets. Each item can be a keyword, numeric Page ID, Facebook Page URL, or full Ads Library link; the target type is detected automatically.
2. Choose the country and any other options you need, such as active ads, videos, Instagram, or a date range.
3. Choose the maximum ads per target. Start with 25 for a quick, low-cost test; if you enter four targets, each can return up to 25 ads.
4. Click **Start** and wait for the results.
5. Review the ads in **Output**, then download or share them.
6. Save the setup if you want to repeat the same search later.

When you paste an Ads Library link, the choices already included in that link are kept for that search.

### 🧭 Simple search example

Imagine you want to research active video ads for running shoes:

| Choice | Example |
|---|---|
| 🔍 Search | Running shoes |
| 🌍 Country | United States |
| 🟢 Status | Active ads |
| 🎬 Media | Video |
| 📱 Platforms | Facebook and Instagram |
| 🔢 Maximum ads | 100 |

This search returns matching public ads with their advertiser, copy, creative, links, dates, and other available details.

### 📊 What do the results look like?

The **Ads overview** gives you a quick visual list. **Creative details** shows more copy, images, videos, cards, and links. **Complete results** includes every available detail.

Here is a simplified example:

| Advertiser | Headline | Ad type | Status | Destination |
|---|---|---|---|---|
| Example Brand | Run farther in comfort | Video | Active | example.com/shoes |

You can sort, review, and download the results after the search finishes.

### 💰 Pricing and cost control

Check the **Pricing** tab for the current rates. The final cost mainly depends on how many unique ads you save and whether you request extra public details.

Start with 25 ads per target, then increase the limit when you are happy with the results. Ads found more than once are saved only once. The optional extra-details setting can cost more and may not add useful information to every ad, so leave it off unless you need it.

### ⚠️ Important limitations

- 🔓 The tool collects only information that Meta shows publicly.
- 📉 It does not provide private account data, clicks, sales, conversions, or hidden audience settings.
- 🧩 Spend, reach, audience, and verification details may be missing from many ads.
- ⏳ Image and video links can expire, so save important media promptly.
- 🛠️ Meta can change the Ads Library, which may temporarily affect results.

### ❓ Frequently asked questions

#### 📦 What data can I get from the Facebook Ads Library?

You can collect public advertiser information, ad text, headlines, buttons, destination pages, images, videos, multi-image cards, dates, countries, where the ad appeared, and any public spending or audience details Meta provides. The tool organizes this information into one clear result for each unique ad.

#### 👀 How can I find my competitors' Facebook ads?

Add a competitor's Facebook Page or search for its brand and products. Choose the country and show only active ads, then start the search. Use **Ads overview** for a quick scan and **Creative details** to compare text, ad types, images, videos, offers, and destination pages.

#### 👍 Can Apify scrape Facebook?

This tool is made specifically for public Meta Ads Library results. It does not need your Facebook login and does not access private profiles or accounts. Results depend on what Meta makes public and may occasionally be affected by temporary changes to the Ads Library.

### 🛟 Help and responsible use

If you receive fewer ads than expected, check your country, ad status, date range, advertiser Page, and result limit. If you still need help, share the link to your results page with support, but never share passwords or private account information.

Use the tool only for public information you are allowed to collect. Follow Meta's terms, Apify's terms, and the privacy rules that apply to your work.

# Actor input Schema

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

Enter one target per item. Examples: running shoes, 123456789, https://facebook.com/brand, or an Ads Library search URL. The target type is detected automatically.

## `maxAdsPerSearch` (type: `integer`):

Set how many ads to collect for each keyword, Page, or URL target. Start with 25 for a low-cost test, then increase for production.

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

Enter a two-letter country code such as US, GB, or DE. Use ALL for every country.

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

Choose active ads, inactive ads, or both.

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

Limit results to a Meta Ads Library category.

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

Limit results by the main creative media format.

## `searchType` (type: `string`):

Match query words in any order or as an exact phrase.

## `publisherPlatforms` (type: `array`):

Leave empty to include all Meta platforms.

## `contentLanguages` (type: `array`):

Enter BCP-47 language codes such as en, es, pt, or zh. Leave empty for every language.

## `startDate` (type: `string`):

Select the earliest ad start date to include.

## `endDate` (type: `string`):

Select the latest ad start date to include.

## `sortBy` (type: `string`):

Use Meta's default order, newest-first grouping, or total impressions descending.

## `includeTransparencyDetails` (type: `boolean`):

Fetch each public ad detail page and add advertiser verification, Instagram metrics, payer/beneficiary, demographic, regional, EU-targeting, and violation fields when Meta exposes them. <strong>Cost warning:</strong> This sends one extra request per ad and may trigger the configured ad-detail PPE charge.

## Actor input object example

```json
{
  "searchQueries": [
    "running shoes"
  ],
  "maxAdsPerSearch": 25,
  "countryCode": "US",
  "activeStatus": "ACTIVE",
  "adType": "ALL",
  "mediaType": "ALL",
  "searchType": "KEYWORD_UNORDERED",
  "publisherPlatforms": [],
  "contentLanguages": [],
  "startDate": "",
  "endDate": "",
  "sortBy": "DEFAULT",
  "includeTransparencyDetails": false
}
```

# Actor output Schema

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

Visual, analysis-ready table with advertiser, copy, CTA, media preview, destination, status, and monitoring fields.

## `creativeDetails` (type: `string`):

Detailed copy, media, card, destination, and fingerprint fields.

## `rawDataset` (type: `string`):

Every normalized field plus optional raw and tracking data.

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "running shoes"
    ],
    "maxAdsPerSearch": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("devcake/facebook-ads-library-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": ["running shoes"],
    "maxAdsPerSearch": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("devcake/facebook-ads-library-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 '{
  "searchQueries": [
    "running shoes"
  ],
  "maxAdsPerSearch": 25
}' |
apify call devcake/facebook-ads-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devcake/facebook-ads-library-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/mT1fQTIupS5PztTt8/builds/SgcCWpmreygfuECbZ/openapi.json
