# Facebook Ads Library Scraper - Meta & Instagram Ads, No Login (`nexuscortex/facebook-ads-library-scraper`) Actor

Facebook Ads Library scraper and unofficial Meta Ad Library API. Scrape Facebook and Instagram ads by keyword, advertiser or Ad Library URL without login: ad copy, images, videos, carousel cards, landing pages, start dates, platforms, political ad spend. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/nexuscortex/facebook-ads-library-scraper.md
- **Developed by:** [Nexus Cortex](https://apify.com/nexuscortex) (community)
- **Categories:** Marketing, Social media, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.56 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & Unofficial Meta Ad Library API (No Login)

Scrape ads from the public **Meta Ad Library** (facebook.com/ads/library) by **keyword**, **advertiser page** or **Ad Library URL**, and get clean rows ready for spreadsheets: ad copy, headline, images, video files, carousel and catalog cards, landing page and domain, call-to-action button, start date, days running, platforms (Facebook, Instagram, Messenger, Audience Network, Threads), number of ad versions, and for political and issue ads the spend, impressions and "Paid for by" disclaimer.

No Facebook account, cookies, access token or Meta developer app needed. The Actor reads only what any logged-out visitor can see in the Ad Library, over plain HTTP (no browser), so it is fast and cheap: roughly 300-400 ads per minute in our tests.

Use it as a **Facebook ad spy tool**, an **Instagram ads scraper**, a **competitor ad monitor** or an **unofficial Meta Ad Library API** from your code, Make, Zapier, n8n or Google Sheets.

### How to scrape the Facebook Ads Library

1. Click **Try for free** (or **Start**) on this page.
2. Enter keywords, advertisers (Facebook page URLs, page usernames or page IDs), or paste search URLs copied from the Ad Library.
3. Pick a country and, if you like, filters: active or inactive ads, media type, platforms, languages, dates, political ads only.
4. Set **Maximum results** to cap the size and cost of the run, then run the Actor and download the ads as JSON, CSV or Excel, or read them through the Apify API.

### What you can do with it

- **Competitor research**: get every ad a brand is running (`advertisers: ["nike"]`), see which creatives have been running longest (`daysActive`) and how many versions each ad has (`versionsCount`).
- **Creative inspiration and swipe files**: search a niche (`"protein powder"`, `"skincare"`) and collect the ad copy, headlines, images and video files.
- **Landing page and offer research**: `linkUrl` and `linkDomain` show where each ad sends traffic; catalog and carousel ads list every product card with its own link and image.
- **Monitoring**: schedule a daily run per competitor or keyword and compare new `adArchiveId`s.
- **Political and issue ads**: spend range, impressions range, currency and the "Paid for by" disclaimer for transparency and research work.

### Input

| Field | Description |
|---|---|
| `searchQueries` | Keywords to search, one per line |
| `advertisers` | Facebook page URLs (`https://www.facebook.com/nike`), usernames (`nike`) or numeric page IDs (`15087023444`). Returns all ads of each page |
| `startUrls` | Search URLs copied from facebook.com/ads/library (keyword search or an advertiser's "See all ads" page). Filters in the URL are kept |
| `country` | Country where the ads were shown, or `ALL` |
| `activeStatus` | `active`, `inactive` or `all` |
| `adType` | `all` or `political_and_issue_ads` |
| `mediaType` | `all`, `image`, `video`, `meme`, `image_and_meme`, `none` |
| `exactPhrase` | Match keywords as an exact phrase |
| `platforms` | Only ads on `facebook`, `instagram`, `audience_network`, `messenger`, `threads` |
| `languages` | Only ads in these languages (`en`, `de`, ...) |
| `dateFrom`, `dateTo` | Only ads that had impressions in this date range (`2026-10-01`, or `30 days`) |
| `sortBy` | `relevance` or `impressions` (most impressions first) |
| `maxItems` | Total cap on ads for the run (default 50). This is also your maximum spend |
| `maxItemsPerSource` | Cap per keyword, advertiser or URL (default 200) |
| `proxyConfiguration` | Apify Proxy settings (default: residential Apify Proxy) |

Example:

```json
{
    "searchQueries": ["running shoes"],
    "advertisers": ["nike", "https://www.facebook.com/Gymshark"],
    "country": "US",
    "activeStatus": "active",
    "mediaType": "all",
    "maxItems": 200,
    "maxItemsPerSource": 100
}
```

### Output

One row per ad. Example (shortened):

```json
{
    "type": "ad",
    "adArchiveId": "1694952298821099",
    "adLibraryUrl": "https://www.facebook.com/ads/library/?id=1694952298821099",
    "pageId": "104938532182459",
    "pageName": "Just Ingredients Shop",
    "pageUrl": "https://www.facebook.com/100083349256793/",
    "pageLikeCount": 2801,
    "isActive": true,
    "startDate": "2026-10-08T07:00:00.000Z",
    "endDate": "2026-11-07T08:00:00.000Z",
    "daysActive": 30,
    "platforms": ["facebook", "instagram", "audience_network", "threads"],
    "displayFormat": "VIDEO",
    "title": "Just Ingredients Protein Powder",
    "body": "The easy part of your day",
    "linkUrl": "https://justingredients.com/collections/electrolytes",
    "linkDomain": "justingredients.com",
    "ctaText": "Shop now",
    "videoUrl": "https://video.xx.fbcdn.net/...",
    "videoPreviewImageUrl": "https://scontent.xx.fbcdn.net/...",
    "cards": [],
    "versionsCount": 1,
    "spend": null,
    "impressions": null,
    "source": { "type": "keyword", "value": "protein powder" },
    "searchCountry": "US"
}
```

Other fields: `pageProfilePictureUrl`, `pageCategories`, `caption`, `linkDescription`, `ctaType`, `imageUrl` (first image, or the video's preview frame), `images`, `videos` (HD and SD file URLs), `cards` (title, body, link, image and video of each carousel or catalog card), `extraTexts`, `extraLinks`, `extraImages`, `extraVideos`, `isDynamicTemplate`, `isLimitedForLoggedOut`, `collationId`, `categories`, `containsSensitiveContent`, `containsDigitallyCreatedMedia`, `byline`, `currency`, `reachEstimate`, `targetedOrReachedCountries`, `scrapedAt`. A real sample is in `samples/output.json`.

A run summary (ads per source, how many ads the Ad Library reports for each search, failed sources) is saved to the key-value store under `SUMMARY`.

Notes:

- `displayFormat` is the Ad Library's own format: `IMAGE`, `VIDEO`, `CAROUSEL`, `DPA` (catalog / dynamic product ads), `DCO` (dynamic creative) or `EVENT`.
- Catalog and dynamic ads use templates such as `{{product.name}}` for their headline. The Actor replaces those with the first product card's text and sets `isDynamicTemplate: true`; every product is in `cards`.
- `spend`, `impressions`, `byline` and `currency` are filled only for political and issue ads; Meta does not publish them for other ads.
- Image and video links are signed Meta CDN URLs that expire after some days. Download the files you need promptly.

### Pricing

Pay per result: you pay for each ad saved to the dataset. Set *Maximum results* (or your Apify max-charge limit) to cap spend; the Actor stops cleanly when the limit is reached. Duplicate ads found by several keywords or advertisers are returned and charged once. Each run also has Apify's standard start fee of $0.00005 ($0.05 per 1,000 runs), which covers the first seconds of compute. Apify subscribers pay less per result: 10% off on Bronze, 15% on Silver and 20% on Gold and higher plans.

### FAQ

**Do I need a Facebook account or access token?** No. The Actor never logs in and never asks for cookies or tokens.

**Is there an official Meta Ad Library API? Why use this instead?** Meta's official Ad Library API needs a verified developer account and an access token, and for most countries it only returns political and issue ads. This Actor reads the same public Ad Library website any visitor can use, so it returns commercial ads in every country.

**How many ads can I get per search?** The Ad Library loads about 10 ads per scroll. In our tests one keyword was paged 40 times (397 unique ads) without issues. The Ad Library itself shows at most about 50,000 results per search; narrow the search with filters for bigger jobs.

**Why does the Ad Library show a higher number than I received?** The count on the Ad Library page includes ad versions that it groups together. The Actor returns one row per listed ad and reports the number of versions in `versionsCount`.

**Can it get the EU reach and demographic breakdown of an ad?** Not yet. The search results do not include it; it may be added in a later version.

**Do I need a proxy?** The Actor uses Apify's residential proxy by default, because Facebook rate-limits datacenter IPs when loading more results (datacenter IPs only get the first page of about 30 ads per search). Proxy traffic is included in the per-result price.

### Limitations

- Only public data from the Ad Library. Nothing behind a login is accessed.
- Some ads, for example prescription-drug ads, show only their text to logged-out visitors. They are returned with `isLimitedForLoggedOut: true`, no media and no `displayFormat`. Ads the Ad Library hides completely from logged-out visitors are not returned.
- When no country is given, the Ad Library guesses one from the visitor's IP, so the Actor always sends an explicit country (`ALL` by default).
- Meta changes its website often. If the Actor stops working, it fails with a clear error message instead of returning wrong data; please report it in the Issues tab.

### Legal note

This Actor collects only information that Meta publishes in its public Ad Library, without logging in, and does not collect email addresses, phone numbers or other private data. You are responsible for using the data in line with Meta's terms, copyright law (ad creatives belong to their owners) and privacy regulations such as GDPR.

### Feedback

Found a bug or need a field? Open an issue in the Issues tab and we will look at it. If this Actor saved you time, a short review on this page helps other users find it.

### More scrapers from NexusCortex

- [Google Ads Transparency Scraper](https://apify.com/nexuscortex/google-ads-transparency-scraper): Google Search, YouTube and Display ads of any advertiser
- [Google Trends Scraper](https://apify.com/nexuscortex/google-trends-scraper): interest over time, by region and related queries
- [Threads Search Scraper](https://apify.com/nexuscortex/threads-search-scraper): Threads posts and profiles by keyword, back in time
- [Pinterest Scraper](https://apify.com/nexuscortex/pinterest-scraper): pins, boards and profiles by keyword or URL

# Actor input Schema

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

Keywords to search in the Ad Library, one per line, e.g. `running shoes` or a brand name. Each keyword is searched with the filters below.

## `advertisers` (type: `array`):

Get all ads of specific advertisers. Accepts Facebook page URLs (`https://www.facebook.com/nike`), page usernames (`nike`) or numeric page IDs (`15087023444`).

## `startUrls` (type: `array`):

Paste search URLs copied from facebook.com/ads/library (keyword searches or an advertiser's "See all ads" page). The filters in the URL are used as they are; the country below is only added when the URL has none.

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

Country where the ads were shown. `All countries` searches worldwide.

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

Only ads that are running now, only ads that have stopped, or both.

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

`All ads`, or only ads about social issues, elections or politics. Political ads include spend, impressions and the "Paid for by" disclaimer.

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

Only ads that contain this kind of media.

## `exactPhrase` (type: `boolean`):

Match the keyword as an exact phrase instead of any order of its words.

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

Only ads shown on these platforms. Leave empty for all.

## `languages` (type: `array`):

Only ads in these languages, as two-letter codes (`en`, `de`, `es`). Leave empty for all.

## `dateFrom` (type: `string`):

Only ads that had impressions on or after this date (the Ad Library date filter): `2026-10-01` or a relative age such as `30 days`. Ads that started earlier but were still running are included.

## `dateTo` (type: `string`):

Only ads that had impressions on or before this date, e.g. `2026-11-01`.

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

Ad Library relevance, or the ads with the most impressions first.

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

Hard cap on the number of ads saved and charged in this run.

## `maxItemsPerSource` (type: `integer`):

Stop paging a keyword, advertiser or URL after this many ads.

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

Residential Apify Proxy is the default because Facebook rate-limits datacenter IPs when loading more results. Proxy traffic is included in the per-result price.

## Actor input object example

```json
{
  "searchQueries": [
    "running shoes"
  ],
  "country": "US",
  "activeStatus": "active",
  "adType": "all",
  "mediaType": "all",
  "exactPhrase": false,
  "sortBy": "relevance",
  "maxItems": 50,
  "maxItemsPerSource": 200,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped ads in the default dataset.

# 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"
    ],
    "country": "US",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexuscortex/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"],
    "country": "US",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nexuscortex/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/z6sShXiCcW2fbEA9X/builds/6FDKPd0cheOY8aChN/openapi.json
