# Facebook Ad Library Scraper - Competitor Ads, No Login (`renzomacar/facebook-ads-library-scraper`) Actor

Spy on competitor Facebook & Instagram ads with no login — pull every active ad creative, copy, spend range, run dates and landing page from the Meta Ad Library. No account, no API key. For media buyers, agencies and dropshippers researching winning ads. Pay per ad scraped.

- **URL**: https://apify.com/renzomacar/facebook-ads-library-scraper.md
- **Developed by:** [Renzo Madueno](https://apify.com/renzomacar) (community)
- **Categories:** Marketing, Social media
- **Stats:** 3 total users, 1 monthly users, 96.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 - Competitor Ads, Creatives, No Login

Spy on any brand's live Facebook & Instagram ads. This scraper pulls structured data straight from the **public Facebook Ad Library** (the transparency database Meta is legally required to keep open) — **no login, no cookies, no Facebook account needed**.

Search by **advertiser** (e.g. `Nike`) or by **keyword** (e.g. `skincare`, `black friday`) in any country, and get back the full ad creative: copy, headline, images, video URLs, CTA, destination link, platforms, run dates, and how many variants the advertiser is testing.

Perfect for **ad spying, competitor research, creative inspiration, and agency ad-intelligence reports.**

---

### What you get per ad

| Field | Example |
|---|---|
| `pageName` / `pageId` | `Nike` / `15087023444` |
| `adArchiveId` + `adLibraryUrl` | direct link to the ad in the Library |
| `isActive`, `startDate`, `endDate` | running since 2026-03-17 |
| `platforms` | `["FACEBOOK","INSTAGRAM","AUDIENCE_NETWORK","MESSENGER"]` |
| `mediaType` | `IMAGE` / `VIDEO` / `CAROUSEL` / `DPA` |
| `title`, `body`, `caption` | full ad copy |
| `ctaText`, `ctaType` | `Shop now` / `SHOP_NOW` |
| `linkUrl`, `linkDescription` | destination landing page |
| `imageUrls`, `videoUrls`, `videoPreviewUrls` | downloadable creative assets |
| `cards` | every card of a carousel ad (image/video + copy + link) |
| `variantCount` | how many versions the advertiser is A/B testing |
| `pageLikeCount`, `pageCategories`, `pageProfilePicture` | advertiser profile |
| `spend`, `impressions`, `currency` | populated for political/issue ads |
| `containsDigitalCreatedMedia` | AI-generated creative flag |

---

### Example output

```json
{
  "adArchiveId": "1869276447125570",
  "adLibraryUrl": "https://www.facebook.com/ads/library/?id=1869276447125570",
  "pageName": "Nike",
  "pageId": "15087023444",
  "isActive": true,
  "startDate": "2026-03-17T07:00:00.000Z",
  "endDate": "2026-06-11T07:00:00.000Z",
  "platforms": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK", "MESSENGER"],
  "mediaType": "CAROUSEL",
  "title": "Nike: Shoes, Apparel, Stories",
  "body": "Celebrate your birthday with Nike and unlock exclusive products, free shipping and returns.",
  "ctaText": "Shop now",
  "ctaType": "SHOP_NOW",
  "linkUrl": "https://www.nike.com/...",
  "imageUrls": ["https://scontent.xx.fbcdn.net/.../creative.jpg"],
  "videoUrls": [],
  "variantCount": 6,
  "cards": [ { "title": "...", "body": "...", "imageUrl": "...", "linkUrl": "..." } ],
  "queriedCountry": "US",
  "scrapedAt": "2026-06-12T09:00:00.000Z"
}
````

***

### Input

| Field | Description | Default |
|---|---|---|
| `searchQuery` ✅ | Brand/advertiser name or keyword (what you'd type in the Library search box) | `Nike` |
| `country` | Two-letter country code for ad delivery (US, GB, CA, AU, DE, BR…) | `US` |
| `adType` | `all` (commercial) or `political_and_issue` (adds spend & impressions) | `all` |
| `activeStatus` | `active`, `inactive`, or `all` | `active` |
| `mediaType` | `all`, `image`, `video`, `meme`, `image_and_meme`, `none` | `all` |
| `maxResults` | Max ads to return (1–2000) | `50` |
| `proxyCountry` | Residential proxy country (required — see below) | `US` |

#### Minimal input

```json
{ "searchQuery": "Nike", "country": "US", "maxResults": 50 }
```

***

### Use cases

- **Ad spying** — see exactly what creatives a competitor is running right now, across FB & Instagram.
- **Competitor research** — track which offers, hooks and landing pages a brand pushes, and how many variants they test.
- **Creative inspiration** — build a swipe file of winning ad copy + creative for your niche.
- **Agencies** — generate ad-intelligence reports for clients in seconds; export to Sheets/Looker.
- **Trend monitoring** — schedule daily runs on a keyword to catch new advertisers entering a market.

***

### Pricing

This actor uses **pay-per-event** pricing:

- **$0.005** per actor start
- **$0.01** per ad returned

A typical 50-ad run costs about **$0.51**. You only pay for ads actually returned.

***

### How it works (and reliability notes)

The Facebook Ad Library is a **public, login-free** transparency tool. This actor:

1. Loads the public Library search page through a **residential proxy**.
2. Harvests the ads embedded in the page, then drives Facebook's own ad-search GraphQL query by cursor to paginate.

**Residential proxy is required.** Facebook rate-limits ad pagination from datacenter IPs. The actor uses Apify Residential proxy by default; pick the `proxyCountry` that matches your target market for best results. If a run is partially rate-limited, simply rerun — each run gets a fresh IP.

`political_and_issue` ads additionally expose **spend ranges and impressions** (Meta publishes these for political advertising); commercial ads do not include spend/impression numbers (Meta does not publish those publicly).

***

*Not affiliated with or endorsed by Meta. Scrapes only the public, login-free Ad Library transparency data.*

***

### Frequently asked questions

**Is the Facebook Ad Library scraper free to use without a Facebook login?**
Yes. This Facebook Ad Library scraper reads Meta's public ad transparency database directly, so you never log in, never connect a Facebook account, and never paste cookies. The Ad Library is a public resource Meta is legally required to keep open, and this actor scrapes only that public data.

**Can I scrape competitor ads by brand name?**
Yes. Put the advertiser or brand name in `searchQuery` (for example `Nike`, `Gymshark`, or `Shopify`) and the scraper returns every active ad that brand is running across Facebook and Instagram, including ad copy, creatives, CTAs and the number of variants they are A/B testing.

**Can I search Facebook ads by keyword instead of brand?**
Yes. Use a keyword like `skincare`, `black friday` or `crypto` in `searchQuery` to discover every advertiser running ads on that topic in your chosen country. This is ideal for ad spying across a whole niche rather than a single competitor.

**Does the Facebook ad scraper return video and image creatives?**
Yes. Each ad record includes `imageUrls`, `videoUrls`, `videoPreviewUrls` and full carousel `cards`, so you can download the actual ad creatives and build a swipe file.

**Can I see Facebook ad spend and impressions?**
Spend ranges and impressions are returned for `political_and_issue` ads, because Meta publishes those numbers publicly. Commercial ads do not include spend or impression data because Meta does not make it public.

**Which countries does the Facebook Ad Library scraper support?**
Any country supported by the Ad Library. Set the two-letter `country` code (US, GB, CA, AU, DE, BR and more) to see the ads delivered in that market.

**How much does it cost to scrape Facebook ads?**
Pricing is pay-per-event: $0.005 per run start plus $0.01 per ad returned. A typical 50-ad run costs about $0.51, and you only pay for ads actually delivered.

# Actor input Schema

## `searchQuery` (type: `string`):

Brand/advertiser name (e.g. 'Nike') or a keyword (e.g. 'skincare', 'black friday'). This is what you'd type into the Ad Library search box.

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

Two-letter country code for ad delivery (e.g. US, GB, CA, AU, DE, BR). The Ad Library is segmented by country.

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

'all' covers commercial ads (most use cases). 'political\_and\_issue' returns political/issue ads, which additionally expose spend & impression ranges.

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

Filter by whether ads are currently running.

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

Filter ads by creative media type.

## `maxResults` (type: `integer`):

Maximum number of ads to return.

## `proxyCountry` (type: `string`):

Two-letter country code for the residential proxy (e.g. US, GB, CA). Residential IPs are REQUIRED — Facebook rate-limits ad pagination from datacenter IPs.

## Actor input object example

```json
{
  "searchQuery": "Nike",
  "country": "US",
  "adType": "all",
  "activeStatus": "active",
  "mediaType": "all",
  "maxResults": 50,
  "proxyCountry": "US"
}
```

# Actor output Schema

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

All result items as JSON.

# 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 = {
    "searchQuery": "Nike"
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Ad Library Scraper - Competitor Ads, No Login",
        "description": "Spy on competitor Facebook & Instagram ads with no login — pull every active ad creative, copy, spend range, run dates and landing page from the Meta Ad Library. No account, no API key. For media buyers, agencies and dropshippers researching winning ads. Pay per ad scraped.",
        "version": "0.1",
        "x-build-id": "gFIGagdYjRYC3P0W0"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/renzomacar~facebook-ads-library-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-renzomacar-facebook-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/renzomacar~facebook-ads-library-scraper/runs": {
            "post": {
                "operationId": "runs-sync-renzomacar-facebook-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/renzomacar~facebook-ads-library-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-renzomacar-facebook-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": [
                    "searchQuery"
                ],
                "properties": {
                    "searchQuery": {
                        "title": "Advertiser or keyword",
                        "type": "string",
                        "description": "Brand/advertiser name (e.g. 'Nike') or a keyword (e.g. 'skincare', 'black friday'). This is what you'd type into the Ad Library search box."
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "Two-letter country code for ad delivery (e.g. US, GB, CA, AU, DE, BR). The Ad Library is segmented by country.",
                        "default": "US"
                    },
                    "adType": {
                        "title": "Ad type",
                        "enum": [
                            "all",
                            "political_and_issue"
                        ],
                        "type": "string",
                        "description": "'all' covers commercial ads (most use cases). 'political_and_issue' returns political/issue ads, which additionally expose spend & impression ranges.",
                        "default": "all"
                    },
                    "activeStatus": {
                        "title": "Active status",
                        "enum": [
                            "active",
                            "inactive",
                            "all"
                        ],
                        "type": "string",
                        "description": "Filter by whether ads are currently running.",
                        "default": "active"
                    },
                    "mediaType": {
                        "title": "Media type",
                        "enum": [
                            "all",
                            "image",
                            "video",
                            "meme",
                            "image_and_meme",
                            "none"
                        ],
                        "type": "string",
                        "description": "Filter ads by creative media type.",
                        "default": "all"
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Maximum number of ads to return.",
                        "default": 50
                    },
                    "proxyCountry": {
                        "title": "Residential proxy country",
                        "type": "string",
                        "description": "Two-letter country code for the residential proxy (e.g. US, GB, CA). Residential IPs are REQUIRED — Facebook rate-limits ad pagination from datacenter IPs.",
                        "default": "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
