# Facebook Ads Library Scraper | Exact Ad Limit | No Login (`h1018y/anvil-facebook-ads-library-scraper-pro`) Actor

Scrapes the Facebook Ads Library (Meta ad library) from links, Page URLs or search words. Give it what to look for and how many; get each ad's text, dates, platforms, links and images, plus EU reach and payer as rows, stopping at exactly your limit. Same field names as the most used tool.

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

## Pricing

from $3.06 / 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 | Exact Ad Limit | No Login

**Facebook Ads Library Scraper** - Ask for 40 ads, get 40 ads - with EU reach, reach by country and the payer filled in right on the row.

### What does Facebook Ads Library Scraper do?

The run stops at exactly your resultsLimit (every row shows resultsLimitApplied) and opens each ad's details like a visitor for EU reach, reach by country and payer as plain fields when Facebook shows them.

- Exact limit per input and for the whole run, so a test run cannot eat your credit
- EU reach, reach by country, age and gender, payer and beneficiary as plain fields, read from each ad's public details when Facebook answers them
- Date range applied in the search and checked on every row, 7 days or 2 months work too
- Same input and output field names as the most used tool - switch by changing the actor id
- onlyNew for schedules: 0 rows and a clean finish when nothing changed

### Who uses Facebook Ads Library Scraper, and for what

- Agencies - pull a competitor's newest ads every morning with onlyNew
- Media buyers - see how many people an EU ad really reached, by country and age
- Ecommerce teams - check how long a rival's ads have been running
- Developers - swap the actor id and keep the same field names in their program

### What this Facebook Ads Library Scraper does that users of the usual tools ask for

- **Stop at exactly the number of ads asked for, so a run can never bill past it** - in the `resultsLimitApplied` field
- **Date range and limits that are really applied, shown on every row** - in the `dateFilterApplied` field
- **Individual ads whenever the count-only switch is off, with the total on each row** - in the `totalCount` field

#### Switching takes one minute

The input and result field names are the ones the most used Facebook Ads Library Scraper has, so the input JSON your code already sends works unchanged and your pipeline reads the same fields - plus the new ones above.

### Why this Facebook Ads Library Scraper?

Small tools break when Facebook changes its page, and they use different field names, so programs cannot switch to them. This Facebook Ads Library Scraper checks every run and tells you plainly when a page could not be read, instead of returning empty or wrong rows.

### Data you get from Facebook Ads Library Scraper

Every result is one flat row with these fields (values from a real run):

| Field | Example |
|---|---|
| `inputUrl` | https://www.facebook.com/ads/library/?q=adidas\&active_status... |
| `searchTerm` | adidas |
| `totalCount` | 50001 |
| `resultsLimitApplied` | 3 |
| `dateFilterApplied` | null |
| `changeType` | null |
| `adArchiveID` | null |
| `adArchiveId` | null |
| `adId` | null |
| `pageID` | null |
| `pageId` | null |
| `pageName` | null |
| `pageAlias` | null |
| `pageUrl` | null |
| `facebookUrl` | null |
| `pageIsDeleted` | null |
| `pageLikes` | null |
| `pageVerification` | null |
| `entityType` | null |
| `igUsername` | null |
| `igFollowers` | null |
| `isActive` | null |
| `startDate` | null |
| `endDate` | null |
| `startDateFormatted` | null |

### How to use Facebook Ads Library Scraper

1. Press **Start** - the form already holds an example that works.
2. Put in your own input (see the fields on the Input tab).
3. Run it once, or put it on an **Apify Schedule** (with **only new** on, where the form has it) to get just what is new every day; add a **webhookUrl** to get each run's rows sent to your own system, Zapier, Make or Slack.
4. Download the results as JSON, CSV or Excel, or send them to Google Sheets, Zapier, Make, the Apify API or an AI agent (Apify MCP server).

#### Input example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&q=adidas&search_type=keyword_unordered&media_type=all"
    }
  ],
  "country": "US",
  "resultsLimit": 3,
  "maxItems": 1000,
  "activeStatus": "",
  "sorting": "",
  "onlyAdsNewerThan": "1 year",
  "isDetailsPerAd": true,
  "onlyTotal": false,
  "onlyNew": false,
  "useApifyProxy": true
}
```

#### Output example (a real run)

```json
[
  {
    "inputUrl": "https://www.facebook.com/ads/library/?q=adidas&active_status=all&ad_type=all&country=DE&media_type=all&search_type=keyword_unordered&locale=en_US",
    "searchTerm": "adidas",
    "totalCount": 50001,
    "resultsLimitApplied": 3,
    "dateFilterApplied": null,
    "changeType": null,
    "adArchiveID": null,
    "adArchiveId": null,
    "adId": null,
    "pageID": null,
    "pageId": null,
    "pageName": null,
    "pageAlias": null,
    "pageUrl": null,
    "facebookUrl": null,
    "pageIsDeleted": null,
    "pageLikes": null,
    "pageVerification": null,
    "entityType": null,
    "igUsername": null,
    "igFollowers": null,
    "isActive": null,
    "startDate": null,
    "endDate": null,
    "startDateFormatted": null,
    "endDateFormatted": null,
    "daysRunning": null,
    "publisherPlatform": null,
    "collationId": null,
    "collationCount": null,
    "categories": null,
    "currency": null,
    "spend": null,
    "reachEstimate": null,
    "impressions": null,
    "impressionsWithIndex": null,
    "euTotalReach": null,
    "reachByCountry": null,
    "ageGenderData": null,
    "locationData": null,
    "targetedOrReachedCountries": null,
    "genderAudience": null,
    "ageMin": null,
    "ageMax": null,
    "payer": null,
    "beneficiary": null,
    "hasUserReported": null,
    "reportCount": null,
    "displayFormat": null,
    "adTitle": null,
    "adText": null,
    "linkUrl": null,
    "ctaText": null,
    "ctaType": null,
    "imageUrls": null,
    "videoUrls": null,
    "adLibraryUrl": null,
    "snapshot": null,
    "ad_details": null
  }
]
```

One flat row per result.

### Built for pipelines

- **Field names never change** - fixes and new features only ever add fields, so your code keeps working.
- **Every row has the same shape** - a missing value is `null`, never a dropped field.
- **A plain status line** on every run - how many results, and on a problem what to change in the input - for your logs and for AI agents.
- **Runs on its own** - put it on an Apify Schedule and add a `webhookUrl`: each run's rows go straight to your system, Zapier, Make or Slack.

### How much does Facebook Ads Library Scraper cost?

You pay only per result (pay per event) - no monthly fee, no minimum, and the price per result is lower on Apify's Bronze, Silver and Gold plans. The exact price is on the **Pricing** tab. Apify's free plan credit is enough to try it on real input.

| You want | What you pay for |
|---|---|
| A quick test with the example | a few results |
| A daily scheduled run | only the rows that run returns |
| A big one-off export | the results delivered - set a maximum in the input |

### Also searched as

- meta ads library
- facebook ad library
- facebook ads scraper
- meta ads scraper
- facebook ads library api

### FAQ

**Does Facebook Ads Library Scraper need a login, cookies or an API key?** No. It reads public pages only.

**Can I run Facebook Ads Library Scraper on a schedule?** Yes - with Apify Schedules; each run returns fresh rows.

**Can I call it from Python, JavaScript or an AI agent?** Yes - through the Apify API, the Apify client libraries or the Apify MCP server.

**Is it legal?** It collects only data anyone can see without logging in. You are responsible for using it within the source site's terms and data protection law (GDPR, CCPA).

**What if the site blocks a request?** The run retries from a fresh connection and, if it still cannot read the page, stops with a clear message - never with made-up rows.

**Do I need proxies?** No setup needed - Facebook Ads Library Scraper uses Apify Proxy by default where the site needs it.

### Troubleshooting

- **No results:** check the input (a public URL or a search term that returns results in a normal browser), then try the example input once.
- **Fewer results than expected:** raise the maximum in the input; some sites show only a part of their data without logging in, and Facebook Ads Library Scraper never logs in.
- **The run stopped with a message:** the message says what the site answered; run it again later or with fewer items.

### Your feedback

Missing a field, found a bug, or need another site? Open an issue on the **Issues** tab - issues are answered and fixed. If Facebook Ads Library Scraper saved you time, a short review on this page helps others find it.

Data source: [www.facebook.com/ads/library](https://www.facebook.com/ads/library/)

### More tools from this developer

- [Tweet Scraper for Twitter & X Posts: By URL, No Login](https://apify.com/h1018y/anvil-tweet-scraper)
- [YouTube Thumbnail Downloader: Bulk, Every Size & Titles](https://apify.com/h1018y/anvil-youtube-thumbnail-downloader)
- [ML Conference Finder: NeurIPS, ICLR & ICML Alternatives](https://apify.com/h1018y/anvil-ml-conference-finder)
- [YouTube Transcript & Captions Scraper: Find Any Word Said](https://apify.com/h1018y/anvil-youtube-transcript-scraper)
- [Facebook Ads Library Scraper & Meta Ad Spy: Only New Ads](https://apify.com/h1018y/anvil-facebook-ads-library-scraper)
- [Twitter Scraper: New Tweets From Any X Account, No Login](https://apify.com/h1018y/anvil-twitter-scraper)
- [Facebook Page & Posts Scraper: New Posts & Engagement Growth](https://apify.com/h1018y/anvil-facebook-posts-scraper)
- [Google Trends Scraper: Rising Searches & Interest by Region](https://apify.com/h1018y/anvil-google-trends-scraper)

# Actor input Schema

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

Paste a Meta Ad Library search link, a Facebook Page link or the link of one ad, e.g. https://www.facebook.com/SHEINOFFICIAL. Settings inside a link win over this form.

## `searchTerms` (type: `array`):

Or just type what you would type in the Ad Library search, one per line, e.g. running shoes. Uses the country below.

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

Two-letter code of the country where the ads ran, or ALL, e.g. DE. Used for search words only; links keep their own country.

## `resultsLimit` (type: `integer`):

Exact number of ads per input, e.g. 40. The run stops right there, so you are never billed past it.

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

Hard stop for the whole run across all inputs, e.g. 200.

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

Keep ads still running, stopped ads, or both, e.g. active. A status inside a link wins.

## `sorting` (type: `string`):

Order of the ads, e.g. relevancy_monthly_grouped for most recent first. A sort inside a link wins.

## `onlyAdsNewerThan` (type: `string`):

A date like 2026-01-31 or a relative value like 7 days, 2 months, 1 year. Checked on every row.

## `onlyAdsOlderThan` (type: `string`):

A date like 2026-06-30 or a relative value like 7 days. Combine it with the field above for a closed range.

## `isDetailsPerAd` (type: `boolean`):

Opens each ad's details for EU reach, reach by country and age, payer, Instagram name and followers. Turn off for a faster run, e.g. false.

## `onlyTotal` (type: `boolean`):

Turn on for one row per input with totalCount and no ads. Off always gives the ads themselves, e.g. false.

## `onlyNew` (type: `boolean`):

For a schedule: the first run is the baseline, then only new or stopped ads come back, e.g. true.

## `useApifyProxy` (type: `boolean`):

Leave on so Facebook sees a normal visitor address, e.g. true.

## `proxyGroups` (type: `array`):

Optional Apify proxy groups, e.g. RESIDENTIAL. Empty uses the standard one.

## `webhookUrl` (type: `string`):

Optional. An https address - your own system, Zapier, Make or a Slack incoming webhook - that gets each run's results as JSON (with 'only new' on: just the new ones). Example: https://hooks.slack.com/services/T000/B000/XXXX

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&q=adidas&search_type=keyword_unordered&media_type=all"
    }
  ],
  "country": "US",
  "resultsLimit": 3,
  "maxItems": 1000,
  "activeStatus": "",
  "sorting": "",
  "onlyAdsNewerThan": "1 year",
  "isDetailsPerAd": true,
  "onlyTotal": false,
  "onlyNew": false,
  "useApifyProxy": true
}
```

# Actor output Schema

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

All result rows (open as table, JSON, CSV or Excel).

# 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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&q=adidas&search_type=keyword_unordered&media_type=all"
        }
    ],
    "resultsLimit": 3,
    "onlyAdsNewerThan": "1 year",
    "useApifyProxy": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("h1018y/anvil-facebook-ads-library-scraper-pro").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 = {
    "startUrls": [{ "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&q=adidas&search_type=keyword_unordered&media_type=all" }],
    "resultsLimit": 3,
    "onlyAdsNewerThan": "1 year",
    "useApifyProxy": True,
}

# Run the Actor and wait for it to finish
run = client.actor("h1018y/anvil-facebook-ads-library-scraper-pro").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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=DE&q=adidas&search_type=keyword_unordered&media_type=all"
    }
  ],
  "resultsLimit": 3,
  "onlyAdsNewerThan": "1 year",
  "useApifyProxy": true
}' |
apify call h1018y/anvil-facebook-ads-library-scraper-pro --silent --output-dataset

```

## MCP server setup

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

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/u0HhIDpfgFRkqc8vp/builds/jafNCSwmUcOZLPPDU/openapi.json
