# Meta Ad Library Scraper (Facebook & Instagram Ads) (`lagenuina_agency/meta-ad-library-scraper`) Actor

Facebook Ad Library API: scrape Facebook & Instagram ads by page, keyword or URL. Ad copy, CTA, landing page, image & video URLs, dates, platforms, page info, spend for political ads. $0.20/1K ads with proxy included, no login.

- **URL**: https://apify.com/lagenuina_agency/meta-ad-library-scraper.md
- **Developed by:** [Quelli di Carne Genuina](https://apify.com/lagenuina_agency) (community)
- **Categories:** Social media, Lead generation, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 ads

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

## Meta Ad Library Scraper (Facebook & Instagram Ads)

Scrape the public **Meta Ad Library** (facebook.com/ads/library) by page, keyword or Ad Library URL. Get every Facebook, Instagram, Messenger and Audience Network ad with its copy, headline, CTA, landing page, image and video URLs, start and end dates, platforms, page info and, for political and issue ads, Meta's spend and reach ranges. No Facebook login, no cookies, no Meta API token.

> Independent tool, not affiliated with or endorsed by Meta Platforms, Inc. It reads only what Meta publishes in its public Ad Library.

### What you get

One row per ad (real result for Nike, shortened):

```json
{
  "ad_archive_id": "1632663538563793",
  "ad_library_url": "https://www.facebook.com/ads/library/?id=1632663538563793",
  "page_id": "15087023444",
  "page_name": "Nike",
  "is_active": true,
  "start_date_iso": "2026-08-31T07:00:00.000Z",
  "end_date_iso": "2026-10-16T07:00:00.000Z",
  "publisher_platform": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK"],
  "display_format": "IMAGE",
  "ad_text": "Bring sports more fully into your day with the Nike App.",
  "title": "Nike Zenvy Women's Dri-FIT Tank Top",
  "cta_text": "Install now",
  "link_url": "http://play.google.com/store/apps/details?id=com.nike.omega",
  "image_urls": ["https://scontent.xx.fbcdn.net/v/t39.35426-6/788880667_..._n.jpg"],
  "video_urls": [],
  "page_like_count": 39501406,
  "collation_count": 2,
  "snapshot": { "body": { "text": "..." }, "cards": [], "images": [], "videos": [], "...": "every field of the Ad Library" }
}
```

Political and issue ads also come with `spend` (e.g. `"$300K-$350K"`), `currency` and `reach_estimate` / `impressions_text` (e.g. `">1M"`).

**Try it in 1 click.** Press *Start* with the prefilled input (30 active Nike ads): it takes about 10 seconds and costs $0.006.

**Price:** $0.20 per 1,000 ads on every Apify plan, **platform usage and residential proxy included**, no start fee.

### Why this Meta Ad Library scraper

- **All-inclusive price**: $0.20 per 1,000 ads and nothing else. The most used alternative charges $0.14–0.15 per 1,000 *plus* the platform usage and residential proxy of the run, which you pay on top.
- **Drop-in compatible**: the input fields of jmlp's actor (`adLibraryUrls`, `adLibraryUrl`, `pageIDs`, `pageID`, `keyword`, `keywords`, `searchType`, `country`, `activeStatus`, `minDate`, `maxDate`, `maxAds`, `maxConcurrency`) work with the same names and values, and the output keeps Facebook's own field names (`ad_archive_id`, `page_name`, `snapshot.body.text`, `snapshot.images`, `publisher_platform`, `spend`...). `startUrls`, `urls` and `maxItems` / `resultsLimit` are read too.
- **Flat, spreadsheet-ready fields** next to the raw snapshot: `ad_text`, `title`, `cta_text`, `link_url`, `image_urls`, `video_urls` (HD first), `start_date_iso`, `end_date_iso`, `ad_library_url`, `page_url`.
- **Every input style**: Ad Library URLs (all filters kept), single ad links (`?id=`), page ids, `@usernames`, facebook.com page links, keywords with exact-phrase matching.
- **More filters**: media type (image, video, meme), political and issue ads with spend, delivery date window, country by code or name.
- **Reliable**: solves the Ad Library's JS challenge, rotates residential sessions when Facebook rate-limits and continues from the same page, deduplicates ads across targets.

### Use cases

- **Competitor ad research**: every ad a competitor runs on Facebook and Instagram, and which ones run for months (usually the winners).
- **Creative inspiration and swipe files**: image and video URLs of the ads in your niche.
- **Market research by keyword**: all advertisers talking about "running shoes", "solar panels" or "meal kit" in a country.
- **Lead generation**: find businesses actively spending on Meta ads (page name, link, likes, categories).
- **Political ad monitoring**: spend and reach ranges of election and issue ads.
- **Monitoring**: schedule a daily run on your competitors' pages and get new ads in Slack, Sheets or a webhook.

### Input

```json
{
  "pageIDs": ["15087023444", "@cocacola"],
  "keywords": ["running shoes"],
  "country": "US",
  "activeStatus": "active",
  "mediaType": "video",
  "maxAds": 500
}
```

| Field | What it does |
|---|---|
| `adLibraryUrls` | URLs copied from your browser: Ad Library page or keyword searches (filters kept), single ads (`?id=`), Facebook pages (`facebook.com/nike`). |
| `pageIDs` | Numeric page ids (`view_all_page_id`), `@usernames` or facebook.com links. |
| `keywords` | Search the whole Ad Library, like its search box. |
| `searchType` | `keyword_unordered` (default) or `keyword_exact_phrase`. |
| `country` | `US`, `IT`, `Italy`... or `ALL`. |
| `activeStatus` | `all` (default), `active`, `inactive`. |
| `adType` | `all` or `political_and_issue_ads` (with spend and reach). |
| `mediaType` | `all`, `image`, `video`, `meme`, `image_and_meme`, `none`. |
| `minDate` / `maxDate` | Ads delivered in this window (YYYY-MM-DD). |
| `maxAds` | Stop after this many unique ads in total; empty = all. |
| `maxConcurrency` | Targets scraped in parallel (default 3). |
| `proxyConfiguration` | Residential Apify Proxy (default, recommended). |

### Output

Every field Facebook returns for an ad (same names as in the Ad Library's own data, so existing pipelines keep working), plus:

| Field | Meaning |
|---|---|
| `ad_archive_id`, `ad_library_url` | Library ID and public link of the ad |
| `page_id`, `page_name`, `page_url`, `page_like_count`, `page_categories` | Advertiser |
| `ad_text`, `title`, `cta_text`, `link_url` | Copy, headline, button and landing page (first card for carousels / catalog ads) |
| `image_urls`, `video_urls`, `video_preview_image_urls` | Creatives, including carousel cards |
| `display_format` | `IMAGE`, `VIDEO`, `CAROUSEL`, `DCO`, `DPA`... |
| `is_active`, `start_date`, `end_date`, `start_date_iso`, `end_date_iso` | When it ran (Unix and ISO) |
| `publisher_platform` | `FACEBOOK`, `INSTAGRAM`, `MESSENGER`, `AUDIENCE_NETWORK`, `THREADS` |
| `collation_count` | How many versions of the ad exist |
| `spend`, `currency`, `reach_estimate`, `impressions_text` | Political and issue ads only (Meta does not publish them for commercial ads) |
| `snapshot` | The full raw creative object (cards, extra texts, branded content...) |
| `search_url`, `total_ads_in_search`, `scraped_at` | Where the ad came from |

Export as CSV, Excel, JSON or XML from the Dataset tab, or via API.

### Pricing

Pay per event, one event per unique ad, no start fee, and the Apify platform usage and residential proxy are included:

| Apify plan | Price per ad | Per 1,000 ads |
|---|---|---|
| Free | $0.0002 | $0.20 |
| Bronze | $0.0002 | $0.20 |
| Silver | $0.0002 | $0.20 |
| Gold, Platinum, Diamond | $0.0002 | $0.20 |

Set `maxAds` or a maximum total charge on the run to cap spending; the actor stops cleanly when it is reached.

### Migrating from jmlp/meta-ad-library-scraper

Change the actor ID to `lagenuina_agency/meta-ad-library-scraper`; the input usually works unchanged.

| jmlp input | This actor | Notes |
|---|---|---|
| `adLibraryUrls`, `adLibraryUrl` | same | Ad Library URLs, single ad links, Facebook page links. |
| `pageIDs`, `pageID` | same | Numeric ids, `@usernames`, facebook.com links. A plain name that is not a page username is searched as a keyword. |
| `keyword`, `keywords`, `searchType` | same | Same values (`keyword_unordered`, `keyword_exact_phrase`). |
| `country`, `activeStatus`, `minDate`, `maxDate` | same | Same values. |
| `maxAds`, `maxConcurrency` | same | `maxConcurrency` = targets in parallel. |
| `proxyConfiguration` | same | Residential by default. |
| `raw` | (always on) | The raw ad object is always included, with flat fields added. |
| `maxPages`, `delayMs`, `pageSize`, `docId`, `impersonate`, `proxyRotations`, `resume`, `continueFromLastRun`, `shardSplitThreshold`, `proxySessionId` | (not needed) | Ignored: retries, pacing and the GraphQL query id are handled automatically. |
| (not available) | `mediaType`, `adType` | Extra filters. |

**Output:** jmlp's fields (`ad_archive_id`, `page_id`, `page_name`, `is_active`, `start_date`, `end_date`, `publisher_platform`, `collation_count`, `snapshot.*`, `spend`, `currency`, `reach_estimate`) keep their names.

**Price per 1,000 ads** (public Apify Store prices, checked on 17 October 2026):

| Apify plan | jmlp | This actor |
|---|---|---|
| Free, Bronze | $0.15 + platform usage and proxy | $0.20, all included |
| Silver and above | $0.14 + platform usage and proxy | $0.20, all included |

In our test runs the platform usage plus residential proxy of a run like this was about $0.05 per 1,000 ads, so the total is in the same range or lower, without surprises on the bill. Speed and completeness: we have not benchmarked the two actors side by side; run the same input on both and compare.

### Limits / not supported

- Facebook serves the Ad Library 10 ads per request, so large archives take time: about 3–4 seconds per 10 ads per target (roughly 6 minutes for 1,000 ads of one page). Several targets run in parallel.
- Spend, impressions and reach are published by Meta only for political and issue ads. EU audience breakdowns (age, gender, EU reach) of commercial ads, shown on each ad's detail panel, are not extracted.
- Meta stopped running political and issue ads in the EU in October 2025: for EU countries the political category returns few or no ads with spend. US, UK, Brazil and the rest of the world work as usual.
- Image and video URLs are signed Facebook CDN links that expire after some days: download the files you want to keep.
- A plain advertiser name (not a username) is searched as a keyword. Use the page id or the facebook.com link for one exact advertiser.
- Keyword searches can match tens of thousands of ads: set `maxAds`.
- Residential proxy needed: Facebook rate-limits datacenter IPs on the Ad Library.

### Use it from AI agents (MCP)

```json
{
  "mcpServers": {
    "apify": { "url": "https://mcp.apify.com/?actors=lagenuina_agency/meta-ad-library-scraper" }
  }
}
```

Ask things like *"Which video ads is Nike running on Instagram in Italy right now?"* or *"Find Facebook ads about solar panels in Germany and list their landing pages."*

### Integrations and API

```python
## pip install apify-client
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("lagenuina_agency/meta-ad-library-scraper").call(run_input={"pageIDs": ["15087023444"], "activeStatus": "active", "maxAds": 100})
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(ad["page_name"], ad["ad_text"], ad["image_urls"], ad["video_urls"])
```

```js
// npm i apify-client
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('lagenuina_agency/meta-ad-library-scraper').call({ keywords: ['running shoes'], country: 'US', activeStatus: 'active', maxAds: 100 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

Ready-to-run examples (Python CSV export, Node.js, n8n workflow): [github.com/assa83/facebook-ad-library-api](https://github.com/assa83/facebook-ad-library-api).

No-code: use the Apify app in **n8n**, **Make** or **Zapier** (action "Run Actor", pick `lagenuina_agency/meta-ad-library-scraper`), or the `langchain-apify` / CrewAI `ApifyActorsTool` integrations for AI agents. Send results to Google Sheets, Slack, webhooks or S3 with Apify integrations.

### More tools from Quelli di Carne Genuina

**Ad intelligence**

- [Google Ads Transparency Scraper](https://apify.com/lagenuina_agency/google-ads-transparency-scraper): every ad a brand or domain runs on Google Search, YouTube, Shopping, Maps and Play.
- [TikTok Top Ads Scraper](https://apify.com/lagenuina_agency/tiktok-top-ads-scraper): top-performing TikTok ads from the Creative Center with CTR, likes and MP4 video URLs.
- [LinkedIn Ad Library Scraper](https://apify.com/lagenuina_agency/linkedin-ad-library-scraper): B2B ads of any company from the public LinkedIn Ad Library, with targeting and impressions.

**Competitor & SEO research**

- [Similarweb Website Traffic Scraper](https://apify.com/lagenuina_agency/similarweb-scraper): monthly visits, ranks, traffic sources and top countries for any list of domains.
- [Google Trends Scraper](https://apify.com/lagenuina_agency/google-trends-scraper): interest over time, by region, related queries and Trending Now.
- [Google Play Store Scraper](https://apify.com/lagenuina_agency/google-play-scraper): app search, details, top charts and reviews from Google Play, any country.

**Travel prices**

- [Google Hotels Scraper](https://apify.com/lagenuina_agency/google-hotels-scraper): hotel prices and every booking site's rate for any city and dates.
- [Google Flights Scraper](https://apify.com/lagenuina_agency/google-flights-scraper): fares, airlines, stops, price level and price calendar for any route and date.

**Retail prices**

- [Woolworths AU Product Scraper](https://apify.com/lagenuina_agency/woolworths-scraper): Woolworths Australia grocery prices, specials, unit prices and barcodes.
- [Coles AU Product Scraper](https://apify.com/lagenuina_agency/coles-scraper): Coles Australia grocery prices, half-price specials, unit prices and barcodes.

**Content & social data**

- [YouTube Transcript Scraper](https://apify.com/lagenuina_agency/youtube-transcript-scraper): transcripts of videos, Shorts, playlists and channels as text, SRT or VTT.
- [Medium Scraper](https://apify.com/lagenuina_agency/medium-scraper): Medium articles by tag, author or search, with full text as Markdown.
- [Likee Scraper](https://apify.com/lagenuina_agency/likee-scraper): Likee videos, profiles and creator engagement analytics.

Together: see a competitor's ads on Meta, Google and LinkedIn in one workflow.

### FAQ

**How do I see all Facebook ads of a page?** Put its page id, @username or facebook.com link in `pageIDs` (or paste its Ad Library URL), set `activeStatus` to `all` and leave `maxAds` empty.

**How do I find a page id?** Open the page in the Ad Library: it is the `view_all_page_id=` number in the URL. Or just use the @username.

**Does it scrape Instagram ads?** Yes. The Meta Ad Library covers Facebook, Instagram, Messenger, Audience Network and Threads; `publisher_platform` says where each ad ran.

**Is there a Facebook Ad Library API?** Meta's official Ad Library API covers only political/issue ads (and EU ads) and requires identity verification and a developer app. This actor works as an API for all ads: send page ids, keywords or URLs and get JSON back from Python, JavaScript, n8n, Make, Zapier or MCP.

**Can I export Facebook ads to CSV or Excel?** Yes, from the Dataset tab or via API.

**Can I download the ad images and videos?** The output has direct URLs to the full-size images and HD videos; download them soon, the links expire.

**Does it need my Facebook login?** No, the Ad Library is public. No account, cookies or API token.

**Why is spend empty?** Meta publishes spend and reach only for political and issue ads.

**Is it legal to scrape the Meta Ad Library?** It is public transparency data. You are responsible for how you use it; avoid processing personal data without a legal basis and check local laws.

**Something missing or broken?** Open an issue on the Issues tab, we reply within 24 hours.

# Actor input Schema

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

Paste URLs copied from your browser: an Ad Library page URL (view_all_page_id=...), an Ad Library keyword search URL (q=...), a single ad link (?id=...) or a brand's Facebook page (facebook.com/nike, profile.php?id=...). Filters inside an Ad Library URL (country, status, dates, media type) are kept as they are.

## `pageIDs` (type: `array`):

Numeric page ids (the view_all_page_id number of the Ad Library URL), @usernames or facebook.com page links. All ads of each page are scraped with the filters below.

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

Search every advertiser's ads for these words, like the Ad Library search box. Keyword searches can match thousands of ads: set Max ads and a country.

## `searchType` (type: `string`):

Only used for keyword searches.

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

Two-letter country code (US, GB, IT, DE...) or name (Italy). ALL = every country. Ads in the EU also show EU reach info on the ad page.

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

Active = ads running now (what the Ad Library shows by default). All = the full archive, often 10x more.

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

Political and issue ads come with Meta's spend range, currency and impressions/reach range.

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

Only ads with this kind of creative.

## `minDate` (type: `string`):

YYYY-MM-DD. Ads that were running at any time on or after this date (an ad started earlier and still running matches).

## `maxDate` (type: `string`):

YYYY-MM-DD, inclusive.

## `maxAds` (type: `integer`):

Stop after this many unique ads in total (all targets). Empty or 0 = no limit. Caps both runtime and cost.

## `maxConcurrency` (type: `integer`):

How many pages / keywords are scraped in parallel.

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

Keep RESIDENTIAL: Facebook blocks datacenter IPs on the Ad Library.

## Actor input object example

```json
{
  "pageIDs": [
    "15087023444"
  ],
  "searchType": "keyword_unordered",
  "country": "ALL",
  "activeStatus": "active",
  "adType": "all",
  "mediaType": "all",
  "maxAds": 30,
  "maxConcurrency": 3,
  "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 = {
    "pageIDs": [
        "15087023444"
    ],
    "activeStatus": "active",
    "maxAds": 30,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lagenuina_agency/meta-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 = {
    "pageIDs": ["15087023444"],
    "activeStatus": "active",
    "maxAds": 30,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("lagenuina_agency/meta-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 '{
  "pageIDs": [
    "15087023444"
  ],
  "activeStatus": "active",
  "maxAds": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call lagenuina_agency/meta-ad-library-scraper --silent --output-dataset

```

## MCP server setup

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