# Facebook Ad Library Scraper: What Is an Advertiser Running (`bardach_technologies/facebook-ad-library-scraper`) Actor

Public Facebook Ad Library: the ads an advertiser is running now, by page ID, name, keyword or link. Ad text, link, CTA, media links, dates. Capped at about 30 ads per search; stops at any rate limit or block. No login. USD 0.40 per 1,000 ads.

- **URL**: https://apify.com/bardach_technologies/facebook-ad-library-scraper.md
- **Developed by:** [Bardach Technologies](https://apify.com/bardach_technologies) (community)
- **Categories:** Marketing, Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 ad delivereds

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 Ad Library Scraper: What Is an Advertiser Running

Reads the ads that are running now (or ran) from the public Facebook (Meta) Ad Library, the page where anyone can see the
ads on Facebook, Instagram, Messenger, Threads, WhatsApp and the Audience Network, and writes one clean row per ad.

**What you get, honestly:** the library shows a visitor who is not logged in about **30 ads per search**, then answers
"rate limit exceeded". This Actor reads those ads and **stops there**. It never reads past a refusal: it does not use
residential addresses, does not retry a refused search, does not split one search into many to collect more, and does not
log in. For "what is this advertiser running now?" that is usually enough (look up the advertiser by page ID or name); for
a complete archive of an advertiser with hundreds of ads it is not.

**What a refusal looks like**

- The site answers "rate limit exceeded" to the request for the next page: that search ends as **partial** (status
  `partial`, the note says why), the ads read before that are delivered, and **no later search of the run is tried** (`notTried`, nothing is sent for it; a restart sends nothing either).
  The status row is free. It is the usual end of a search that wants more than about 30 ads.
- A browser check that does not pass, a login wall, a CAPTCHA or "too many requests" on a search page: that search is
  `blocked`, is free, is not asked again, and **no later search of the run is tried** (`notTried`).

**Use it when**

- you want what a competitor (by advertiser page ID or name) or a market (by keyword) is advertising now, per country;
- you need ad text, headline, link, call to action, media links, start date, platforms and number of versions in a table.

**Do not use it when**

- you need every ad of a large advertiser: you get about 30 per search, and a partial status says when the list was longer;
- you want to find *new* ads since last time: the library has no date sort, so a list of about 30 ads cannot show which ads are
  new (a new ad can be missing from it, and an older ad can rotate in). There is no "only new" mode. Compare `libraryId` and
  `startDate` of two runs yourself if you want to, knowing the limit;
- you want spend, impressions or reach, political ads, or data of private persons: none of this is read or delivered;
- you want ads of your own ad account (this reads only the public library, never logs in), or the media files themselves
  (the Actor gives links and downloads no media).

**Minimal input**

```json
{
  "keywords": [
    "coffee"
  ],
  "pageIds": [
    "856680081063878"
  ],
  "country": "US",
  "maxAdsPerSearch": 20
}
```

**One output row** (from a real run on 18.11.2026; long text and links shortened, the advertiser's product link replaced)

```json
{
  "recordType": "ad",
  "search": "coffee",
  "libraryId": "1352810280086555",
  "adLibraryUrl": "https://www.facebook.com/ads/library/?id=1352810280086555",
  "pageId": "856680081063878",
  "pageName": "Zulay Kitchen",
  "pageUrl": "https://www.facebook.com/zulaykitchen/",
  "pageCategories": [
    "Brand"
  ],
  "pageLikeCount": 22892,
  "isActive": true,
  "startDate": "2026-06-02",
  "endDate": null,
  "platforms": [
    "facebook",
    "instagram",
    "audience_network",
    "whatsapp",
    "threads"
  ],
  "displayFormat": "IMAGE",
  "adText": "🚨 The Zulay Milk Frother is now at your nearest Walmart! 🚨 ... (shortened)",
  "adTexts": [
    "🚨 The Zulay Milk Frother is now at your nearest Walmart! 🚨 ... (shortened)"
  ],
  "headline": "Now at Walmart: The Milk Frother Everyone’s Talking About!",
  "linkUrl": "https://www.example.com/ (the advertiser's product link, replaced here)",
  "linkCaption": "walmart.com",
  "linkDescription": "Buy Zulay Kitchen Milk Frother with Stand, 2 Duracell Batteries, and Additional Whisk Attachment at Walmart.com",
  "callToAction": "See details",
  "callToActionType": "SEE_DETAILS",
  "imageUrls": [
    "(temporary link to the image on the site's media server, shortened here)"
  ],
  "videoUrls": [],
  "videoPreviewImageUrls": [],
  "cards": [],
  "versions": 1,
  "collationId": "1002702628837588",
  "gatedType": null,
  "visibility": "visible",
  "categories": [
    "UNKNOWN"
  ],
  "containsDigitallyCreatedMedia": false,
  "targetedOrReachedCountries": [],
  "searchType": "keyword"
}
```

At the end of every run each search gets one free status row (here a search that wanted 100 ads and got the 30 the library
shows):

```json
{
  "recordType": "search",
  "search": "coffee",
  "searchType": "keyword",
  "status": "partial",
  "note": "partial: the site refused further result pages ('rate limit exceeded'), in this search or earlier in this run, and was not asked again; the ads read before that were delivered (the list is longer)",
  "adsDelivered": 30,
  "adsChecked": 30,
  "filteredOut": 0,
  "removedByLibrary": 0,
  "totalShown": 50001,
  "reachedMaxAds": false,
  "bytesReceived": 2640000,
  "searchUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&media_type=all&q=coffee&search_type=keyword_unordered"
}
```

**Cost:** USD 0.0004 per ad delivered (USD 0.40 per 1,000), plus USD 0.00005 per run start. Example: 1,000 ads are about 34
searches of about 30 ads and cost 1,000 × 0.0004 + 0.00005 = USD 0.40005. Status rows (also partial ones), blocked, failed and
invalid searches, rows of ads the library hides and ads removed by your filters are free. Set a maximum charge for the run
and it stops cleanly at exactly that amount.

### What it does

- **Searches:** keywords (as typed into the library's search box), advertiser page IDs (all ads of that page), advertiser
  names (exact-phrase search, then only ads whose advertiser name matches), or search links copied from the library's
  address bar (their own filters are used). Up to 100 searches per run; one bad entry gets an `invalid` row and the rest runs.
- **Filters:** country (or ALL), active / inactive / all ads, media type, platforms. Every filter is also checked again on
  each row, so a filter the site ignores never gives you (or charges you for) a wrong row; removed rows are counted in
  `filteredOut` and are free. Links to political or issue ad categories are not supported.
- **Limit:** `maxAdsPerSearch` (1 to 100, default 30) is a hard upper limit. The Actor reads the first page and scrolls only
  while the site answers; the search ends at that many ads, at the end of the list, at the site's refusal (`partial`), or when it
  has looked at `maxAdsCheckedPerSearch` ads. A search that asks for 20 ads reads the first page only and never scrolls.
- **Pace:** at most one search starts per second (`requestDelaySeconds`, 1 to 60, default 2); a refused request is never repeated.
- **Ads the library hides:** the library shows some ads to a visitor who is not logged in only as a notice: ads taken down
  ("This content was removed"), ads that "ran without a required disclaimer", ads from accounts the site disabled, and
  age-restricted ads ("log in to confirm your age"). This Actor never delivers what the library hides from a logged-out
  visitor. For each such ad you get a row with the ad's ID, the advertiser page, the dates and a `visibility` status
  (`removed`, `disclaimerMissing`, `accountDisabled` or `ageRestricted`; shown ads have `visible`), without the ad text,
  links or media. These rows are free, are not counted as delivered ads or against `maxAdsPerSearch`, and their number is in
  the search row (`removedByLibrary`).
- **Dedupe:** each ad appears once per search. An ad that matches two of your searches is delivered once for each search
  (each row names its search).
- **Resume:** if the platform restarts the run, ads already written are neither written nor charged again, and a refusal
  already seen is remembered.

### How it reads the library

A headless Chromium opens the public library search page like a visitor and reads the ad data the page itself receives. No
login, no cookies kept between searches, no CAPTCHA solving, no bypass service, no residential or rotating addresses. Images,
video, fonts and streamed video data are not loaded. A page that comes back without ad data, or with a
refusing status (401, 403, 407, 429, 451, 503), is a refusal: the search is reported as `blocked`, nothing is asked again, no
new proxy address is taken and no later search is tried. A page that cannot be loaded at all fails that search (free).

### Measured

- **On Apify, no proxy (the default), 18.11.2026:** 31 of 34 searches loaded their first page (91 %); none got a second page:
  every next-page request was answered "rate limit exceeded" (12 of 12 first-page checks on 18.11.2026 ended at about 30 ads).
  Three searches of 29 to 30 ads used USD 0.0045 of platform usage in total (about USD 0.0015 per search).
- **On Apify through Apify Proxy datacentre:** 9 of 13 searches loaded their first page (69 %), slower; same refusal. This is why
  the default is no proxy.
- **From a home connection without proxy:** 19 of 19 searches succeeded and scrolling worked, so a run from another network may
  deliver more than 30 ads per search; the Actor then reads them, and stops at the first refusal.
- Not measured: success rate over days, and runs after the changes of 19.11.2026 on the platform (nothing is uploaded yet).

### Limits

- The site may block programmatic visitors at any time; blocked searches are free but deliver nothing.
- Dynamic and catalogue ads (display format DCO or DPA) often show template text such as `{{product.name}}`; the filled-in
  product texts are in `cards` when the library shows them.
- `totalShown` is the library's own approximate result count (it shows 50,001 for "more than 50,000").
- Media links are temporary signed links of the site's media servers; download what you need soon after the run.
- No private data is collected: the rows hold what the advertiser published in its ads and its public page name (which can be the name of a sole trader). Phone numbers and e-mail addresses inside the free texts of an ad (ad text, headline, link caption and description, card texts) are replaced by `[removed]`; the advertiser's page name and links stay. Fields
  that name payers, beneficiaries or "paid for by" persons, targeting, spend and reach are not read.

### Input fields

See the input form: every field states its default and limit. Empty input does nothing and costs nothing (only the platform's
start event). Proxy: none by default (the route that measured best on Apify). You can choose Apify Proxy datacentre groups or
your own proxy addresses; other groups such as RESIDENTIAL are refused, and the Actor never switches address after a refusal.

### Pricing

Pay per event: USD 0.0004 per ad delivered (USD 0.40 per 1,000) and USD 0.00005 per run start. Search status rows, partial
searches' status rows, rows of ads the library hides from logged-out visitors, blocked, failed and invalid searches and ads
removed by your filters are free.

# Actor input Schema

## `keywords` (type: `array`):

Search words, as typed into the Ad Library search box (one search per line). Up to 100 characters each.

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

Numeric page IDs of advertisers (shown as Page ID in the Ad Library, or view_all_page_id= in its links). Each gives all ads of that page. Page names in a link such as facebook.com/brand cannot be used: give the number.

## `pageNames` (type: `array`):

Advertiser names. Searched as an exact phrase; only ads whose advertiser name matches (ignoring case and spaces) are kept. Use page IDs when you know them: they are more complete.

## `adLibraryUrls` (type: `array`):

Search links copied from the Ad Library address bar. The filters inside the link (country, status, media type, platforms) are used instead of the filters below. Links to one single ad and links to political or issue ad categories are not supported.

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

Two-letter country code where the ads were shown (US, DE, GB ...) or ALL.

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

Active, inactive or all ads.

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

Kind of media in the ad.

## `platforms` (type: `array`):

Only ads shown on these platforms. Empty: all platforms.

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

At most this many ads are delivered (and charged) per search, 1 to 100. The library shows a visitor about 30 ads per search and then answers 'rate limit exceeded': a search then ends as 'partial' with the ads read, and the rest of the run asks for no further pages. The Actor never splits a search or tries other addresses to get more.

## `maxAdsCheckedPerSearch` (type: `integer`):

How many ads of the result list the Actor looks at per search, including ads removed by your filters. Raised to the maximum ads per search when lower.

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

No proxy by default (measured as the most reliable route on Apify). You may choose Apify Proxy datacentre groups (SHADER, BUYPROXIES94952) or your own proxy addresses; other groups such as RESIDENTIAL are refused. The Actor never switches the address after a refusal.

## `requestDelaySeconds` (type: `number`):

Pause before each new search, 1 to 60 seconds: at most one search starts per second, and a refused search is never repeated.

## Actor input object example

```json
{
  "keywords": [
    "coffee"
  ],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "all",
  "platforms": [],
  "maxAdsPerSearch": 20,
  "maxAdsCheckedPerSearch": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "requestDelaySeconds": 2
}
```

# Actor output Schema

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

One row per delivered ad (recordType ad) and, at the end, one free row per search with its status and counts (recordType search).

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

Ads per search, which searches were partial, blocked, failed or invalid and why, whether the run stopped at the maximum charge, and the proxy used.

# 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 = {
    "keywords": [
        "coffee"
    ],
    "country": "US",
    "maxAdsPerSearch": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bardach_technologies/facebook-ad-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 = {
    "keywords": ["coffee"],
    "country": "US",
    "maxAdsPerSearch": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("bardach_technologies/facebook-ad-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 '{
  "keywords": [
    "coffee"
  ],
  "country": "US",
  "maxAdsPerSearch": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call bardach_technologies/facebook-ad-library-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bardach_technologies/facebook-ad-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/OigTbF3pDtynuEjio/builds/LMhbLlLDbpTZOXHkG/openapi.json
