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

Returns every currently active Facebook/Instagram ad for an advertiser or keyword, with full creative details, straight from Meta's own Ad Library.

- **URL**: https://apify.com/mrdoe/facebook-ads-library-scraper-internal.md
- **Developed by:** [MrDoe](https://apify.com/mrdoe) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 ad returneds

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

![Facebook Ads Library Scraper — see every ad an advertiser is running, or search by keyword, with full creative details](https://api.apify.com/v2/key-value-stores/kE36venAoVchGsE6b/records/facebook-ads-library-scraper--hero.png)

### What does Facebook Ads Library Scraper do?

Facebook Ads Library Scraper returns every ad an advertiser is currently running on Facebook
and Instagram - or every ad matching a keyword across all advertisers - as clean structured
data. For each ad you get the full ad text, every image and video in the creative, the
landing-page link, the call-to-action, which platforms it runs on, when it started running,
and the advertiser's own page details. No login, no Facebook account needed.

### Why use Facebook Ads Library Scraper?

- **No Facebook account needed** - works fully logged out, every run.
- **Full creative detail, not just a count** - every ad's complete text, images, video and
  landing-page link, not just "how many ads is this page running."
- **Two ways in** - look up one advertiser by their Facebook page, or search by keyword/brand
  name to find ads from any advertiser.
- **Multi-product ads fully unpacked** - catalog and carousel ads often promote several
  products in one ad; each product's own title, image and link comes through separately.
- **Advertiser context included** - page category, follower count and profile link travel
  with every ad, so you know who's behind it at a glance.

### What makes this different

Most "ad library" tools make you click through one ad at a time to see its creative, or hand
you a bare count with no detail at all. This Actor pulls the full creative - every product
tile in a catalog ad, every image, every link - directly into structured rows, so you can
analyze dozens of an advertiser's ads in a spreadsheet instead of opening them one by one.

### Who uses Facebook Ads Library Scraper?

- **Performance marketers and ad agencies** - study exactly what a competitor's ads say, show
  and link to before briefing new creative.
- **E-commerce and dropshipping sellers** - see which products a competitor is actively
  promoting and how, product by product, inside their catalog ads.
- **Brand and PR teams** - monitor what messaging and offers a competitor or partner brand is
  currently running.
- **Market researchers and consultants** - pull a full, structured record of an industry's
  current advertising activity for a client report, without manually browsing the Ad Library.

### How it works

![How Facebook Ads Library Scraper turns your input into ad-creative data](https://api.apify.com/v2/key-value-stores/kE36venAoVchGsE6b/records/facebook-ads-library-scraper--how-it-works.png)

1. **Your input** - an advertiser's Facebook page, or a brand/keyword to search.
2. **The Actor collects it** - it reads Meta's own Ad Library for that advertiser or keyword,
   works fully logged out, and keeps going until it has every ad, up to your limit.
3. **Your output** - one structured record per ad, with its full creative and campaign
   details, ready for a spreadsheet, dashboard or report.

### What data can you extract?

| Field | Description |
|---|---|
| `pageName` / `pageId` | The advertiser's Facebook page name and ID |
| `pageProfileUrl` / `pageProfilePictureUrl` | Link and image for the advertiser's page |
| `pageCategories` / `pageLikeCount` | The page's own category tags and follower count |
| `isActive` | Whether the ad is currently running |
| `startDate` / `endDate` | When Meta's records show this ad as having started/ended |
| `platforms` | Where it runs: Facebook, Instagram, Messenger, Audience Network, Threads |
| `displayFormat` | The ad's format (e.g. image, video, carousel, catalog) |
| `adBodyText` | The ad's main text |
| `ctaText` / `ctaType` | The call-to-action shown on the ad |
| `linkCaption` | The display link shown below the ad (e.g. a domain) |
| `creatives` | Array of every product/card in the ad: title, body, image, video, link and CTA |
| `categories` | Meta's own categorisation for the ad, when available |
| `containsSensitiveContent` | Meta's own content flag |
| `spend` / `reachEstimate` / `currency` / `impressionsText` | Spend range, reach and impression figures - populated only for political/issue ads, which is the only category Meta discloses these for |
| `adDetailUrl` | Direct link to view this ad on Meta's own Ad Library |
| `scrapedAt` | When this record was collected (ISO timestamp) |

### How to use Facebook Ads Library Scraper

1. Open the Actor and go to the **Input** tab.
2. Enter an **Advertiser's Facebook page** (a URL or username), or leave it empty and use
   **Keyword** instead (see the screenshot below).
3. Optionally set **Country**, **Ad status** and **Max results**.
4. Click **Start**.
5. Open the **Dataset** tab, or pull results via the API, once the run finishes.

![Facebook Ads Library Scraper input form with advertiser page, keyword and filters](https://api.apify.com/v2/key-value-stores/kE36venAoVchGsE6b/records/facebook-ads-library-scraper--input.png)

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `pageUrl` | String | No\* | - | An advertiser's Facebook page URL or username |
| `keyword` | String | No\* | `"Nike"` | A brand/search term, used when `pageUrl` is empty |
| `country` | String | No | `"ALL"` | A 2-letter country code, or `"ALL"` |
| `activeStatus` | String | No | `"active"` | `"active"`, `"inactive"` or `"all"` |
| `maxItems` | Integer | No | `30` | Maximum number of ads to return |
| `proxyConfiguration` | Object | No | Residential Apify Proxy | Advanced - a residential proxy is recommended for reliable results |

\*Provide either `pageUrl` or `keyword` - if both are empty the run has nothing to search for.

### Output Data

Each ad produces one dataset record. Example:

```json
{
    "pageName": "Nike",
    "pageLikeCount": 39499255,
    "pageCategories": ["Sportswear", "Product/service"],
    "isActive": true,
    "startDate": "2025-04-07T07:00:00.000Z",
    "platforms": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK", "MESSENGER"],
    "displayFormat": "DPA",
    "adBodyText": "Bring sports more fully into your day with the Nike App.",
    "ctaText": "Install now",
    "creatives": [
        {
            "title": "Nike ACG Polartec® 'Wolf Tree' Women's Mid-Rise Trousers",
            "body": "Bring sports more fully into your day with the Nike App.",
            "linkUrl": "https://www.nike.com/...",
            "ctaText": "Install Now",
            "imageUrl": "https://scontent.fbcdn.net/...",
            "videoUrl": null
        }
    ],
    "adDetailUrl": "https://www.facebook.com/ads/library/?id=1702938977100376",
    "scrapedAt": "2026-10-21T06:34:48.755Z"
}
```

![Sample dataset table from Facebook Ads Library Scraper](https://api.apify.com/v2/key-value-stores/kE36venAoVchGsE6b/records/facebook-ads-library-scraper--output.png)
![Every output field labelled on one example record](https://api.apify.com/v2/key-value-stores/kE36venAoVchGsE6b/records/facebook-ads-library-scraper--fields.png)

### Usage Examples

- **Competitor audit** - set `pageUrl` to a competitor's Facebook page to see every ad
  they're currently running, with full creative detail.
- **Category research** - set `keyword` to a product category or brand name to see which
  advertisers are active in that space right now.
- **Catalog monitoring** - run against an e-commerce advertiser's page to see every product
  they're currently promoting through their catalog ads.
- **Ongoing tracking** - schedule the same `pageUrl` on a recurring run to catch new ads as
  an advertiser launches them.

### Tips for Best Results

- Use `pageUrl` whenever you know the specific advertiser - it's more precise than a keyword
  search and returns only that page's own ads.
- A keyword search can match ads from many different advertisers; narrow `country` if you
  only care about one market.
- `spend`, `reachEstimate` and `impressionsText` are genuinely `null` for the vast majority of
  ads - Meta only discloses those figures for political/issue advertising, not ordinary
  commercial ads.

### Known Limitations

- `spend`, `reachEstimate`, `currency` and `impressionsText` are populated only for
  political/issue ads, exactly as Meta's own Ad Library discloses them - this Actor cannot
  surface view/spend numbers Meta itself doesn't expose for ordinary commercial ads.
- Reflects a snapshot at the time of the run; an advertiser's active ads change over time.
- Image and video URLs are served from Meta's own CDN and may expire after some time; download
  or re-host them promptly if you need to keep a copy.

### Integrations

Connect Facebook Ads Library Scraper to the rest of your stack via the [Apify API](https://docs.apify.com/api/v2),
[webhooks](https://docs.apify.com/platform/integrations/webhooks), scheduled runs, or directly
to Google Sheets, Make, and Zapier through Apify's built-in integrations.

### Export Formats

Download results as **JSON, CSV, Excel, or XML** from the Dataset tab, or fetch them
programmatically via the Apify API.

### Frequently Asked Questions

#### Do I need a Facebook account or to log in?

No. Every run works fully logged out.

#### What's the difference between `pageUrl` and `keyword`?

`pageUrl` returns every ad from one specific advertiser. `keyword` searches ad text and
advertiser names across all of Meta's Ad Library, which can surface ads from many advertisers.

#### Why are `spend` and `reachEstimate` usually empty?

Meta only discloses spend and reach figures for political/issue ads. For ordinary commercial
ads, Meta itself doesn't publish those numbers, so this Actor can't either.

#### Can I schedule this to run automatically?

Yes, use Apify's built-in [Scheduler](https://docs.apify.com/platform/schedules) to re-check an
advertiser or keyword on any interval you choose.

#### Am I charged for a run that returns no ads?

You're only charged the run-start fee plus the per-ad fee for each ad actually returned.

### Support

Found an issue or have a request? Open it on the Actor's **Issues** tab in the Apify Console.

### Legal / Responsible Use

You're responsible for using this Actor in compliance with applicable laws and the target
platform's terms of service. This Actor retrieves publicly viewable ad information only; it
does not collect personal data.

# Actor input Schema

## `pageUrl` (type: `string`):

A Facebook page URL or username (e.g. "nike" or "https://www.facebook.com/nike"). Returns every ad from that one advertiser. Leave empty to use Keyword instead.

## `keyword` (type: `string`):

A brand name or search term to find ads from any advertiser. Used only when Advertiser's Facebook page is empty.

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

A 2-letter country code (e.g. "US"), or "ALL" for every country.

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

Which ads to include.

## `maxItems` (type: `integer`):

Maximum number of ads to return.

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

A residential proxy is strongly recommended - Meta's Ad Library actively blocks non-residential IPs at any real volume.

## Actor input object example

```json
{
  "keyword": "Nike",
  "country": "ALL",
  "activeStatus": "active",
  "maxItems": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "keyword": "Nike",
    "country": "ALL",
    "activeStatus": "active",
    "maxItems": 30,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrdoe/facebook-ads-library-scraper-internal").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 = {
    "keyword": "Nike",
    "country": "ALL",
    "activeStatus": "active",
    "maxItems": 30,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("mrdoe/facebook-ads-library-scraper-internal").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 '{
  "keyword": "Nike",
  "country": "ALL",
  "activeStatus": "active",
  "maxItems": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call mrdoe/facebook-ads-library-scraper-internal --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mrdoe/facebook-ads-library-scraper-internal"
        }
    }
}
```

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/hHQjQ0mameoPzPmcm/builds/pYRnJHm6k49N8s0eU/openapi.json
