# Facebook Ads Library Scraper (`apify/facebook-ads-scraper`) Actor

Extract advertising data from Facebook, Instagram, WhatsApp, Threads. Get ads, publishers, prices, reach estimates, impressions, links, images, IDs, timestamps, product info, and more from Facebook Ad Library. Export ad data, schedule runs via API, and integrate with other tools or AI workflows.

- **URL**: https://apify.com/apify/facebook-ads-scraper.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** Social media, E-commerce, Lead generation
- **Stats:** 29,781 total users, 4,487 monthly users, 99.1% runs succeeded, 437 bookmarks
- **User rating**: 4.29 out of 5 stars

## Pricing

from $3.40 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

> 📢 **New: e-commerce data enrichment, powered by Facebook Ads Library Scraper × [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool).**
>
> 🛍️ With this add-on, you can now extract the products and prices behind each ad, not only the ad data itself to combine competitor ad research, product research, and pricing intelligence in a single run.

### What can Facebook Ads Library Scraper do?

Facebook Ads Library Scraper **extracts data from the [Meta Ad Library](https://www.facebook.com/ads/library) across multiple Meta platforms** beyond what official APIs provide. Add one or multiple Facebook page URLs or Facebook Ads Library URLs, and you can:

🧩 Scrape ads published across **Meta platforms**, including Facebook, Instagram, WhatsApp, Threads, Messenger, and Audience Network

🔎 Prefilter ads by **brand, keyword, country, language, media type, status (active or inactive), ad type** (product, political, housing), and creative format

📅 **Refine ads before scraping** with date filters, sorting (default, impressions high to low, or most recent), and active status (active or inactive) — for cleaner, cheaper runs

🏢 Get advertiser transparency signals from the Facebook Ads Library *About page*, including **business address, admin countries and counts, and page creation/merging or name change history**

🌍 Track **ad performance across countries, languages, and brands** to compare regional strategies and localization efforts

🎨 Analyze and reuse **complete ad creatives**, including images, videos, carousels, memes, ad copy, and CTA links

🛒 Enrich ads with the **products and prices behind them**, more [details](https://apify.com/apify/facebook-ads-scraper#enrich-ads-with-product-and-pricing-data)

⬇️ Export ad data in **JSON, CSV, Excel, or XML**

🦾 Access the ad data programmatically via API endpoints, SDKs (Python & Node.js), and webhooks

Add Facebook Ads Library Scraper to your **ad research and transparency toolkit** to support competitor monitoring, content strategy optimization, benchmarking, performance analysis, and regulatory reporting.

### What Facebook and Instagram ad data can I extract?

With this Meta Ads API, you will be able to extract the following ad data from Meta platforms:

#### 🏢 Page & advertiser data

<table>
  <tr>
    <td>📝 Page name, ID, alias, category, verification status</td>
    <td>🔗 Page URL & profile links</td>
  </tr>
  <tr>
    <td>📊 Page metrics (likes, Instagram followers)</td>
    <td>📸 Page profile & cover images</td>
  </tr>
  <tr>
    <td>🧑‍💼 Page owner & transparency info</td>
    <td>🏢 Advertiser's business address and phone</td>
  </tr>
  <tr>
    <td>🌍 Page admin locations by country</td>
    <td>🧮 Page admin count per country</td>
  </tr>
  <tr>
    <td>📅 Page creation date & name change history</td>
    <td></td>
  </tr>
</table>

#### 🛍 Ad data

<table>
  <tr>
    <td>🛍 Ad text & messaging</td>
    <td>🏷 Ad category & type (e.g. product, political, social issue)</td>
  </tr>
  <tr>
    <td>🎨 Ad creatives (images, videos, carousels)</td>
    <td>🖼 Creative variants & display format</td>
  </tr>
  <tr>
    <td>🖱 CTA text & CTA type</td>
    <td>🔗 Destination links (when available)</td>
  </tr>
  <tr>
    <td>📢 Publisher platforms (Facebook, Instagram, WhatsApp, Threads, Audience Network)</td>
    <td>🌐 Language & country signals (when available)</td>
  </tr>
  <tr>
    <td>⏱ Ad start & end dates</td>
    <td>📅 Visibility timeframe & activity history</td>
  </tr>
  <tr>
    <td>💸 Ad spend data & currency (when available)</td>
    <td>👀 Reach & impression estimates (when available)</td>
  </tr>
  <tr>
    <td>🧮 Report count & user reports</td>
    <td>🚦 Ad status (active/inactive)</td>
  </tr>
  <tr>
    <td>📦 Branded content & partner page details</td>
    <td>🔎 Compliance, eligibility & safety flags</td>
  </tr>
</table>

#### 🛒 E-commerce enrichment (add-on)

<table>
  <tr>
    <td>🛒 Product name & URL</td>
    <td>💲 Product price & currency</td>
  </tr>
  <tr>
    <td>🏷 Product brand</td>
    <td>🖼 Product image</td>
  </tr>
  <tr>
    <td>📄 Product description</td>
    <td>⭐ Product rating & review count</td>
  </tr>
</table>

### Enrich ads with product and pricing data 🛍️

With the new e-commerce add-on, Facebook Ads Library Scraper doesn't stop at the ad — it follows the destination link and pulls the **actual products and prices behind each ad**. The enrichment is powered by the [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool), which extracts data from almost any retail site, marketplace, or delivery platform.

On top of the standard ad data, you can capture:

- 🏷 **Product details** — name, product description, brand, product URL
- 💲 **Pricing** — current price and currency
- ⭐ **Reviews & ratings** — number of reviews and current rating
- 🖼️ **Images** of the extracted product

This turns a single run into **competitor ad research, product research, and pricing intelligence at once** — ideal for price monitoring, catalog and offer comparison, and market mapping. See the [E-commerce Scraping Tool](https://apify.com/apify/e-commerce-scraping-tool) for the full list of supported data and sites.

### How much will scraping ads data from Facebook or Instagram cost you?

Facebook Ads Library Scraper uses a **pay-per-result (PPR)** pricing model, where one result equals one ad campaign. On the Free plan, it costs **$5.80 per 1,000 ads**, with no discount applied.

Paid plans offer discounted rates and higher monthly credit. For example, the Starter plan charges $5.00 per 1,000 ads, which allows you to **scrape 7,800 ads per month**. The Scale and Business plans reduce the price to **$4.20 with 47,000 ads per month**, and **$3.40 with 300,000 ads per month**, respectively.

The **[e-commerce enrichment](https://apify.com/apify/e-commerce-scraping-tool)** add-on is billed per 1,000 enriched ads, on top of the ad price, and only when you turn it on. On the Free plan it costs **$5.70 per 1,000**, and the Starter plan drops it to **$3.20 per 1,000** — with bigger discounts on higher plans. Check the [pricing tab](https://apify.com/apify/facebook-ads-scraper/pricing) for full details.

### How do I use Facebook Ad Library Scraper?

Facebook Ads Library Scraper was designed to be easy to start with, even if you've never extracted data from the web before. Here's how you can scrape data from the Facebook Ads Library with this tool:

1. [Create](https://console.apify.com/sign-up) a free Apify account using your email.
2. Open [Facebook Ad Library Scraper](https://apify.com/apify/facebook-ads-scraper).
3. Add a Facebook Page URL to scrape ads from.
4. Alternatively, head over to the Facebook Ad Library. Choose the country, advertisement category, and brand name or keyword.
5. Filter the results by platform, language, activity, media type, timeframe, or even audience size before scraping them. Copy the URL to the scraper.
6. Click "Start" and wait for the data to be extracted.
7. Download your data though API or in JSON, XML, CSV, Excel, HTML.

For a step-by-step guide on how to scrape Facebook Ads, follow our [tutorial](https://blog.apify.com/scrape-facebook-ads-data/) 📝 or this [video guide](https://www.youtube.com/watch?v=eMkayN0wljA)

<https://www.youtube.com/watch?v=eMkayN0wljA>

> Please note that this scraper displays the extracted results only at the very end of the run. The rest of the time it will display 0 results. Please be patient to see all the extracted data.

### ⬇️ Input

Enter either a Facebook page **URL or a Facebook Ads Library URL of a brand or an ad.**

To scrape Facebook Ads, the input should be either:

- **URLs of brands or ads taken directly from [Facebook Ads Library](https://www.facebook.com/ads/library/?active_status=active\&ad_type=all\&country=CZ\&is_targeted_country=false\&media_type=all),** such as `https://www.facebook.com/ads/library/?active_status=active&ad_type=all&content_languages[0]=en&country=ALL&is_targeted_country=false&media_type=image&publisher_platforms[0]=instagram&publisher_platforms[1]=facebook&search_type=page&view_all_page_id=15087023444`.
  - Before you copy\&paste this type of URL, **don't forget to include various settings, platforms, keywords, or filters** available in Facebook Ads Library.
- Alternatively, you can **add one or more Facebook page URLs** to scrape the ads from, such as `SHEINOFFICIAL`
- Additionally, choose active or inactive ads, whether to scrape the ad details.

You can input URLs individually or in bulk using the **Bulk edit** function. You can also input data manually via the UI, JSON, or programmatically via an API. Click on the [input tab](https://apify.com/apify/facebook-ads-scraper/input-schema) for a full explanation of input in JSON. <a href="https://console.apify.com/actors/JJghSZmShuco4j9gJ"> <img src="https://github.com/apify-projects/actor-readme-images/blob/master/Facebook%20Ads%20Library%20API%20input.png?raw=true" alt="Scrape ads from Meta Facebook Instagram" style="width:70%;"> </a>

### ⬆️ Output

Your Facebook Ads Library results will appear in a dataset in the **Storage** tab. You can view them as a table, download in **JSON, CSV, Excel, or XML**, or use API endpoints.

<a href="https://console.apify.com/actors/JJghSZmShuco4j9gJ/">
<img src="https://raw.githubusercontent.com/apify-projects/actor-readme-images/e13701f69b9d729fdacbc807421a0bcab8e2a3d9/Meta Ad Library API Scraper dataset.png" alt="Instagram ads Meta ads Facebook ads output" style="width:100%;"> </a>

Besides the table view, you can also view your data as JSON, as well as download it as CSV, XML, Excel file, or through an API.

#### 🛍️ Meta ad data sample

```json
[
    {
        "inputUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&is_targeted_country=false&media_type=all&search_type=page&sort_data[mode]=total_impressions&sort_data[direction]=desc&view_all_page_id=16453004404",
        "pageID": "16453004404",
        "adArchiveID": "1229350099285014",
        "startDateFormatted": "2026-03-16T07:00:00.000Z",
        "endDateFormatted": "2026-07-09T07:00:00.000Z",
        "adArchiveId": "1229350099285014",
        "collationCount": 1,
        "collationId": "936389910871080",
        "pageId": "16453004404",
        "snapshot": {
            "brandedContent": null,
            "pageId": "16453004404",
            "pageIsDeleted": false,
            "pageProfileUri": "https://www.facebook.com/sephora/",
            "rootResharedPost": null,
            "byline": null,
            "disclaimerLabel": null,
            "pageName": "Sephora",
            "pageProfilePictureUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/420097314_profile.jpg",
            "event": null,
            "caption": "sephora.com",
            "ctaText": "Download",
            "cards": [
                {
                    "body": "Major beauty benefits are waiting for you on the app 💞",
                    "ctaType": "DOWNLOAD",
                    "caption": "",
                    "linkDescription": "Download now",
                    "linkUrl": "https://www.sephora.com/beauty/app",
                    "title": "Our App = Your Beauty BFF",
                    "ctaText": "Download",
                    "videoHdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQPloWW025_hd.mp4",
                    "videoPreviewImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/420071819_preview.jpg",
                    "videoSdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQNBDatym5_sd.mp4",
                    "watermarkedVideoHdUrl": "",
                    "watermarkedVideoSdUrl": "",
                    "imageCrops": [],
                    "originalImageUrl": null,
                    "resizedImageUrl": null,
                    "watermarkedResizedImageUrl": null
                },
                {
                    "body": "Major beauty benefits are waiting for you on the app 💞",
                    "ctaType": "DOWNLOAD",
                    "caption": "",
                    "linkDescription": "Download now",
                    "linkUrl": "https://www.sephora.com/beauty/app",
                    "title": "Our App = Your Beauty BFF",
                    "ctaText": "Download",
                    "videoHdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQP6ka8Ul6RD_hd.mp4",
                    "videoPreviewImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/421895314_preview.jpg",
                    "videoSdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQNthR9RJnca_sd.mp4",
                    "watermarkedVideoHdUrl": "",
                    "watermarkedVideoSdUrl": "",
                    "imageCrops": [],
                    "originalImageUrl": null,
                    "resizedImageUrl": null,
                    "watermarkedResizedImageUrl": null
                },
                {
                    "body": "Major beauty benefits are waiting for you on the app 💞",
                    "ctaType": "DOWNLOAD",
                    "caption": "",
                    "linkDescription": "Download now",
                    "linkUrl": "https://www.sephora.com/beauty/app",
                    "title": "Our App = Your Beauty BFF",
                    "ctaText": "Download",
                    "videoHdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQNzU2WVmzmn_hd.mp4",
                    "videoPreviewImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/420071819_preview.jpg",
                    "videoSdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQP3AEf0mm7j_sd.mp4",
                    "watermarkedVideoHdUrl": "",
                    "watermarkedVideoSdUrl": "",
                    "imageCrops": [],
                    "originalImageUrl": null,
                    "resizedImageUrl": null,
                    "watermarkedResizedImageUrl": null
                }
            ],
            "body": { "text": "{{product.brand}}" },
            "ctaType": "DOWNLOAD",
            "displayFormat": "DCO",
            "linkDescription": "{{product.description}}",
            "linkUrl": "https://www.sephora.com/beauty/app",
            "images": [],
            "pageCategories": ["Health/beauty", "Beauty Supplies", "Health & Beauty"],
            "pageLikeCount": 20327208,
            "title": "{{product.name}}",
            "videos": [],
            "isReshared": false,
            "extraLinks": [],
            "extraTexts": [],
            "extraImages": [],
            "extraVideos": [],
            "countryIsoCode": null,
            "brazilTaxId": null,
            "additionalInfo": null,
            "ecCertificates": []
        },
        "isActive": true,
        "hasUserReported": false,
        "reportCount": null,
        "menuItems": [],
        "stateMediaRunLabel": null,
        "pageIsDeleted": false,
        "pageName": "Sephora",
        "impressionsWithIndex": { "impressionsText": null, "impressionsIndex": -1 },
        "gatedType": "ELIGIBLE",
        "categories": ["UNKNOWN"],
        "isAaaEligible": false,
        "containsDigitalCreatedMedia": false,
        "reachEstimate": null,
        "currency": "",
        "spend": null,
        "endDate": 1783580400,
        "publisherPlatform": ["FACEBOOK", "INSTAGRAM"],
        "startDate": 1773644400,
        "containsSensitiveContent": false,
        "totalActiveTime": null,
        "regionalRegulationData": {
            "finserv": { "isDeemedFinserv": false, "isLimitedDelivery": false },
            "twAntiScam": { "isLimitedDelivery": false }
        },
        "hideDataStatus": "NONE",
        "fevInfo": null,
        "adId": null,
        "targetedOrReachedCountries": [],
        "ad_details": {
            "advertiser": {
                "page": {
                    "about": { "text": "We Belong to Something Beautiful" },
                    "is_delegate_page_with_linked_primary_profile": false,
                    "id": "16453004404"
                },
                "ad_library_page_info": {
                    "page_spend": {
                        "current_week": null,
                        "lifetime_by_disclaimer": [],
                        "weekly_by_disclaimer": [],
                        "is_political_page": false
                    },
                    "page_info": {
                        "entity_type": "PERSON_PROFILE",
                        "ig_followers": 22663627,
                        "ig_username": "sephora",
                        "ig_verification": true,
                        "likes": 20327208,
                        "page_alias": "sephora",
                        "page_category": "Health/beauty",
                        "page_cover_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-6/481205189_cover.jpg",
                        "page_id": "16453004404",
                        "page_is_deleted": false,
                        "page_is_restricted": false,
                        "page_name": "Sephora",
                        "page_profile_uri": "https://www.facebook.com/sephora/",
                        "page_verification": "BLUE_VERIFIED",
                        "profile_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-1/381282579_profile.jpg",
                        "is_profile_page": false
                    }
                }
            },
            "violation_types": [],
            "verified_voice_context": null
        },
        "pageInfo": {
            "adLibrarySystemStatus": {
                "systemStatus": {
                    "status": "NO_KNOWN_ISSUES",
                    "activeIssues": [
                        { "product": "Ad Library", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Ad Library Report", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Ad Library API", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Branded Content", "status": "NO_KNOWN_ISSUES" }
                    ]
                }
            },
            "xfbAdLibraryIsCaptchaRequired": false,
            "adLibraryPageInfo": {
                "pageInfo": {
                    "relatedPages": [
                        {
                            "categoryName": "Health/beauty",
                            "country": "CZ",
                            "countryName": "Czech Republic",
                            "pageId": "141422642653037",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/343736955_cz.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "CA",
                            "countryName": "Canada",
                            "pageId": "1651784498372756",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/381525849_ca.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "RO",
                            "countryName": "Romania",
                            "pageId": "216565628451130",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/431141575_ro.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "GR",
                            "countryName": "Greece",
                            "pageId": "127637600614842",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/345646932_gr.jpg"
                        }
                    ],
                    "hasBlankAds": false,
                    "hiddenAds": 0,
                    "pageIsDeleted": false
                }
            },
            "page": {
                "name": "Sephora",
                "id": "16453004404",
                "url": "https://facebook.com/sephora",
                "about": { "text": "We Belong to Something Beautiful" },
                "isDelegatePageWithLinkedPrimaryProfile": false,
                "confirmedPageOwner": {
                    "name": "SEPHORA USA, INC.",
                    "information": {
                        "address": {
                            "city": "SAN FRANCISCO",
                            "country": "United States of America",
                            "postalCode": "94105",
                            "state": "CA"
                        },
                        "phoneNumber": null
                    },
                    "id": "10152404065929405"
                },
                "pagesTransparencyInfo": {
                    "historyItems": [
                        {
                            "eventTime": 1665135415,
                            "itemType": "NAME_CHANGE",
                            "eventTimeFormatted": "2022-10-07T09:36:55.000Z"
                        },
                        {
                            "eventTime": 1446222683,
                            "itemType": "NAME_CHANGE",
                            "eventTimeFormatted": "2015-10-30T16:31:23.000Z"
                        },
                        {
                            "eventTime": 1213117433,
                            "itemType": "CREATION",
                            "eventTimeFormatted": "2008-06-10T17:03:53.000Z"
                        }
                    ],
                    "stateMediaCountryLabel": null,
                    "id": "dHJhbnNwYXJlbmN5OjE2NDUzMDA0NDA0",
                    "adminLocations": {
                        "adminCountryCounts": [
                            {
                                "count": 50,
                                "country": { "isoName": "United States", "id": "109078688522" }
                            },
                            { "count": 5, "country": { "isoName": "India", "id": "92061054329" } },
                            { "count": 4, "country": { "isoName": "Brazil", "id": "90994063252" } },
                            { "count": 4, "country": { "isoName": "Canada", "id": "111030136976" } }
                        ]
                    }
                },
                "adLibraryPageTargetingInsight": null
            },
            "adLibraryUser": null
        }
    },
    {
        "inputUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&is_targeted_country=false&media_type=all&search_type=page&sort_data[mode]=total_impressions&sort_data[direction]=desc&view_all_page_id=16453004404",
        "pageID": "16453004404",
        "adArchiveID": "1310216507331960",
        "startDateFormatted": "2026-06-07T07:00:00.000Z",
        "endDateFormatted": "2026-07-07T07:00:00.000Z",
        "adArchiveId": "1310216507331960",
        "collationCount": null,
        "collationId": "1968588860514082",
        "pageId": "16453004404",
        "snapshot": {
            "brandedContent": null,
            "pageId": "16453004404",
            "pageIsDeleted": false,
            "pageProfileUri": "https://www.facebook.com/sephora/",
            "rootResharedPost": null,
            "byline": null,
            "disclaimerLabel": null,
            "pageName": "Sephora",
            "pageProfilePictureUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/715098644_profile.jpg",
            "event": null,
            "caption": "SEPHORA.COM",
            "ctaText": "Shop now",
            "cards": [],
            "body": {
                "text": "The perfect new SPF, according to Cazzie David. Who may or may not be a sunscreen expert."
            },
            "ctaType": "SHOP_NOW",
            "displayFormat": "VIDEO",
            "linkDescription": "Get the latest at Sephora",
            "linkUrl": "https://www.sephora.com/shop/exclusive-products",
            "images": [],
            "pageCategories": ["Health/beauty"],
            "pageLikeCount": 20327208,
            "title": "New. Hot. Only at Sephora.",
            "videos": [
                {
                    "videoHdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQN4x3da6BVd_hd.mp4",
                    "videoPreviewImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/717186269_preview.jpg",
                    "videoSdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQMVPKpSiSsO_sd.mp4",
                    "watermarkedVideoHdUrl": null,
                    "watermarkedVideoSdUrl": null
                }
            ],
            "isReshared": false,
            "extraLinks": [],
            "extraTexts": [],
            "extraImages": [],
            "extraVideos": [],
            "countryIsoCode": null,
            "brazilTaxId": null,
            "additionalInfo": null,
            "ecCertificates": []
        },
        "isActive": true,
        "hasUserReported": false,
        "reportCount": null,
        "menuItems": [],
        "stateMediaRunLabel": null,
        "pageIsDeleted": false,
        "pageName": "Sephora",
        "impressionsWithIndex": { "impressionsText": null, "impressionsIndex": -1 },
        "gatedType": "ELIGIBLE",
        "categories": ["UNKNOWN"],
        "isAaaEligible": false,
        "containsDigitalCreatedMedia": false,
        "reachEstimate": null,
        "currency": "",
        "spend": null,
        "endDate": 1783407600,
        "publisherPlatform": ["FACEBOOK", "INSTAGRAM", "THREADS"],
        "startDate": 1780815600,
        "containsSensitiveContent": false,
        "totalActiveTime": null,
        "regionalRegulationData": {
            "finserv": { "isDeemedFinserv": false, "isLimitedDelivery": false },
            "twAntiScam": { "isLimitedDelivery": false }
        },
        "hideDataStatus": "NONE",
        "fevInfo": null,
        "adId": null,
        "targetedOrReachedCountries": [],
        "ad_details": {
            "advertiser": {
                "page": {
                    "about": { "text": "We Belong to Something Beautiful" },
                    "is_delegate_page_with_linked_primary_profile": false,
                    "id": "16453004404"
                },
                "ad_library_page_info": {
                    "page_spend": {
                        "current_week": null,
                        "lifetime_by_disclaimer": [],
                        "weekly_by_disclaimer": [],
                        "is_political_page": false
                    },
                    "page_info": {
                        "entity_type": "PERSON_PROFILE",
                        "ig_followers": 22663627,
                        "ig_username": "sephora",
                        "ig_verification": true,
                        "likes": 20327485,
                        "page_alias": "sephora",
                        "page_category": "Health/beauty",
                        "page_cover_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-6/481205189_cover.jpg",
                        "page_id": "16453004404",
                        "page_is_deleted": false,
                        "page_is_restricted": false,
                        "page_name": "Sephora",
                        "page_profile_uri": "https://www.facebook.com/sephora/",
                        "page_verification": "BLUE_VERIFIED",
                        "profile_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-1/381282579_profile.jpg",
                        "is_profile_page": false
                    }
                }
            },
            "violation_types": [],
            "verified_voice_context": null
        },
        "pageInfo": {
            "adLibrarySystemStatus": {
                "systemStatus": {
                    "status": "NO_KNOWN_ISSUES",
                    "activeIssues": [
                        { "product": "Ad Library", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Ad Library Report", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Ad Library API", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Branded Content", "status": "NO_KNOWN_ISSUES" }
                    ]
                }
            },
            "xfbAdLibraryIsCaptchaRequired": false,
            "adLibraryPageInfo": {
                "pageInfo": {
                    "relatedPages": [
                        {
                            "categoryName": "Health/beauty",
                            "country": "CZ",
                            "countryName": "Czech Republic",
                            "pageId": "141422642653037",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/343736955_cz.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "CA",
                            "countryName": "Canada",
                            "pageId": "1651784498372756",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/381525849_ca.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "RO",
                            "countryName": "Romania",
                            "pageId": "216565628451130",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/431141575_ro.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "GR",
                            "countryName": "Greece",
                            "pageId": "127637600614842",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/345646932_gr.jpg"
                        }
                    ],
                    "hasBlankAds": false,
                    "hiddenAds": 0,
                    "pageIsDeleted": false
                }
            },
            "page": {
                "name": "Sephora",
                "id": "16453004404",
                "url": "https://facebook.com/sephora",
                "about": { "text": "We Belong to Something Beautiful" },
                "isDelegatePageWithLinkedPrimaryProfile": false,
                "confirmedPageOwner": {
                    "name": "SEPHORA USA, INC.",
                    "information": {
                        "address": {
                            "city": "SAN FRANCISCO",
                            "country": "United States of America",
                            "postalCode": "94105",
                            "state": "CA"
                        },
                        "phoneNumber": null
                    },
                    "id": "10152404065929405"
                },
                "pagesTransparencyInfo": {
                    "historyItems": [
                        {
                            "eventTime": 1665135415,
                            "itemType": "NAME_CHANGE",
                            "eventTimeFormatted": "2022-10-07T09:36:55.000Z"
                        },
                        {
                            "eventTime": 1446222683,
                            "itemType": "NAME_CHANGE",
                            "eventTimeFormatted": "2015-10-30T16:31:23.000Z"
                        },
                        {
                            "eventTime": 1213117433,
                            "itemType": "CREATION",
                            "eventTimeFormatted": "2008-06-10T17:03:53.000Z"
                        }
                    ],
                    "stateMediaCountryLabel": null,
                    "id": "dHJhbnNwYXJlbmN5OjE2NDUzMDA0NDA0",
                    "adminLocations": {
                        "adminCountryCounts": [
                            {
                                "count": 50,
                                "country": { "isoName": "United States", "id": "109078688522" }
                            },
                            { "count": 5, "country": { "isoName": "India", "id": "92061054329" } },
                            { "count": 4, "country": { "isoName": "Brazil", "id": "90994063252" } },
                            { "count": 4, "country": { "isoName": "Canada", "id": "111030136976" } }
                        ]
                    }
                },
                "adLibraryPageTargetingInsight": null
            },
            "adLibraryUser": null
        }
    },
    {
        "inputUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&is_targeted_country=false&media_type=all&search_type=page&sort_data[mode]=total_impressions&sort_data[direction]=desc&view_all_page_id=16453004404",
        "pageID": "16453004404",
        "adArchiveID": "2525430031261760",
        "startDateFormatted": "2026-06-08T07:00:00.000Z",
        "endDateFormatted": "2026-07-08T07:00:00.000Z",
        "adArchiveId": "2525430031261760",
        "collationCount": 4,
        "collationId": "1968588860514082",
        "pageId": "16453004404",
        "snapshot": {
            "brandedContent": null,
            "pageId": "16453004404",
            "pageIsDeleted": false,
            "pageProfileUri": "https://www.facebook.com/sephora/",
            "rootResharedPost": null,
            "byline": null,
            "disclaimerLabel": null,
            "pageName": "Sephora",
            "pageProfilePictureUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/713484736_profile.jpg",
            "event": null,
            "caption": "SEPHORA.COM",
            "ctaText": "Shop now",
            "cards": [],
            "body": {
                "text": "The perfect new SPF, according to Cazzie David. Who may or may not be a sunscreen expert."
            },
            "ctaType": "SHOP_NOW",
            "displayFormat": "VIDEO",
            "linkDescription": "Get the latest at Sephora",
            "linkUrl": "https://www.sephora.com/shop/exclusive-products",
            "images": [],
            "pageCategories": ["Health/beauty"],
            "pageLikeCount": 20327208,
            "title": "New. Hot. Only at Sephora.",
            "videos": [
                {
                    "videoHdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQN4x3da6BVd_hd.mp4",
                    "videoPreviewImageUrl": "https://scontent.xx.fbcdn.net/v/t39.35426-6/715512011_preview.jpg",
                    "videoSdUrl": "https://video.xx.fbcdn.net/o1/v/t2/f2/AQMVPKpSiSsO_sd.mp4",
                    "watermarkedVideoHdUrl": null,
                    "watermarkedVideoSdUrl": null
                }
            ],
            "isReshared": false,
            "extraLinks": [],
            "extraTexts": [],
            "extraImages": [],
            "extraVideos": [],
            "countryIsoCode": null,
            "brazilTaxId": null,
            "additionalInfo": null,
            "ecCertificates": []
        },
        "isActive": true,
        "hasUserReported": false,
        "reportCount": null,
        "menuItems": [],
        "stateMediaRunLabel": null,
        "pageIsDeleted": false,
        "pageName": "Sephora",
        "impressionsWithIndex": { "impressionsText": null, "impressionsIndex": -1 },
        "gatedType": "ELIGIBLE",
        "categories": ["UNKNOWN"],
        "isAaaEligible": false,
        "containsDigitalCreatedMedia": false,
        "reachEstimate": null,
        "currency": "",
        "spend": null,
        "endDate": 1783494000,
        "publisherPlatform": ["FACEBOOK", "INSTAGRAM", "THREADS"],
        "startDate": 1780902000,
        "containsSensitiveContent": false,
        "totalActiveTime": null,
        "regionalRegulationData": {
            "finserv": { "isDeemedFinserv": false, "isLimitedDelivery": false },
            "twAntiScam": { "isLimitedDelivery": false }
        },
        "hideDataStatus": "NONE",
        "fevInfo": null,
        "adId": null,
        "targetedOrReachedCountries": [],
        "ad_details": {
            "advertiser": {
                "page": {
                    "about": { "text": "We Belong to Something Beautiful" },
                    "is_delegate_page_with_linked_primary_profile": false,
                    "id": "16453004404"
                },
                "ad_library_page_info": {
                    "page_spend": {
                        "current_week": null,
                        "lifetime_by_disclaimer": [],
                        "weekly_by_disclaimer": [],
                        "is_political_page": false
                    },
                    "page_info": {
                        "entity_type": "PERSON_PROFILE",
                        "ig_followers": 22663627,
                        "ig_username": "sephora",
                        "ig_verification": true,
                        "likes": 20327492,
                        "page_alias": "sephora",
                        "page_category": "Health/beauty",
                        "page_cover_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-6/481205189_cover.jpg",
                        "page_id": "16453004404",
                        "page_is_deleted": false,
                        "page_is_restricted": false,
                        "page_name": "Sephora",
                        "page_profile_uri": "https://www.facebook.com/sephora/",
                        "page_verification": "BLUE_VERIFIED",
                        "profile_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-1/381282579_profile.jpg",
                        "is_profile_page": false
                    }
                }
            },
            "violation_types": [],
            "verified_voice_context": null
        },
        "pageInfo": {
            "adLibrarySystemStatus": {
                "systemStatus": {
                    "status": "NO_KNOWN_ISSUES",
                    "activeIssues": [
                        { "product": "Ad Library", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Ad Library Report", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Ad Library API", "status": "NO_KNOWN_ISSUES" },
                        { "product": "Branded Content", "status": "NO_KNOWN_ISSUES" }
                    ]
                }
            },
            "xfbAdLibraryIsCaptchaRequired": false,
            "adLibraryPageInfo": {
                "pageInfo": {
                    "relatedPages": [
                        {
                            "categoryName": "Health/beauty",
                            "country": "CZ",
                            "countryName": "Czech Republic",
                            "pageId": "141422642653037",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/343736955_cz.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "CA",
                            "countryName": "Canada",
                            "pageId": "1651784498372756",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/381525849_ca.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "RO",
                            "countryName": "Romania",
                            "pageId": "216565628451130",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/431141575_ro.jpg"
                        },
                        {
                            "categoryName": "Health/beauty",
                            "country": "GR",
                            "countryName": "Greece",
                            "pageId": "127637600614842",
                            "pageName": "SEPHORA",
                            "pageVerification": "BLUE_VERIFIED",
                            "profileImageUri": "https://scontent.xx.fbcdn.net/v/t39.30808-1/345646932_gr.jpg"
                        }
                    ],
                    "hasBlankAds": false,
                    "hiddenAds": 0,
                    "pageIsDeleted": false
                }
            },
            "page": {
                "name": "Sephora",
                "id": "16453004404",
                "url": "https://facebook.com/sephora",
                "about": { "text": "We Belong to Something Beautiful" },
                "isDelegatePageWithLinkedPrimaryProfile": false,
                "confirmedPageOwner": {
                    "name": "SEPHORA USA, INC.",
                    "information": {
                        "address": {
                            "city": "SAN FRANCISCO",
                            "country": "United States of America",
                            "postalCode": "94105",
                            "state": "CA"
                        },
                        "phoneNumber": null
                    },
                    "id": "10152404065929405"
                },
                "pagesTransparencyInfo": {
                    "historyItems": [
                        {
                            "eventTime": 1665135415,
                            "itemType": "NAME_CHANGE",
                            "eventTimeFormatted": "2022-10-07T09:36:55.000Z"
                        },
                        {
                            "eventTime": 1446222683,
                            "itemType": "NAME_CHANGE",
                            "eventTimeFormatted": "2015-10-30T16:31:23.000Z"
                        },
                        {
                            "eventTime": 1213117433,
                            "itemType": "CREATION",
                            "eventTimeFormatted": "2008-06-10T17:03:53.000Z"
                        }
                    ],
                    "stateMediaCountryLabel": null,
                    "id": "dHJhbnNwYXJlbmN5OjE2NDUzMDA0NDA0",
                    "adminLocations": {
                        "adminCountryCounts": [
                            {
                                "count": 50,
                                "country": { "isoName": "United States", "id": "109078688522" }
                            },
                            { "count": 5, "country": { "isoName": "India", "id": "92061054329" } },
                            { "count": 4, "country": { "isoName": "Brazil", "id": "90994063252" } },
                            { "count": 4, "country": { "isoName": "Canada", "id": "111030136976" } }
                        ]
                    }
                },
                "adLibraryPageTargetingInsight": null
            },
            "adLibraryUser": null
        }
    }
]
```

> Please note that `startDate` and `endDate` (if available) will be added as formatted ISO values as `startDateFormatted`: "2026-02-12T07:00:00.000Z" and `endDateFormatted` : "2026-02-12T07:00:00.000Z"

#### 🛍️ E-commerce enrichment data sample

When the e-commerce enrichment add-on is enabled, each ad's destination is followed to extract the products and prices behind it, returned under `ecommerceData`:

```json
{
    "ecommerceData": [
        {
            "linkUrl": "https://www.sephora.cz/p/eau-des-merveilles---toaletni-voda-108455.html",
            "url": "https://www.sephora.cz/p/eau-des-merveilles---toaletni-voda-108455.html",
            "name": "Eau Des Merveilles - Toaletní voda",
            "offers": {
                "price": "2990.0",
                "priceCurrency": "CZK"
            },
            "brand": {
                "slogan": "HERMÈS"
            },
            "image": "https://media.sephora.eu/content/dam/gdam/europe/digital/massivpimupload/H/HERMS/108455/10707-media_swatch.jpg?scaleWidth=750&scaleHeight=750&scaleMode=fit",
            "description": "Pohádkově kouzelný a jiskřivý parfém s teplou a omamnou vůní. Vůně připomínající sladké, vanilkové benzoe a dřeviny s nádechem ambry, úžasná procházka mezi svěžími divokými oranžovníky.\n\nOd roku 2004 je Eau des Merveilles klíčem k zázračnému světu Hermès. Mezi nevinností a fantazií, dětskými sny a ženskostí. Svět, ve kterém se nevšednost zjevuje za bílého dne. Každým rokem nás unášejí kouzelné a poetické vůně. Zachycené do oblého flakonu připomínajícího lupu, skrývajícího magickou moc, která umožňuje vidět svět z nového, zázračného úhlu. Je klíčem k zázrakům, zdrojem hvězd zářících za bílého dne.",
            "reviewCount": 107,
            "rating": 4.4
        },
        {
            "linkUrl": "https://www.sephora.cz/p/coco-mademoiselle---eau-de-toilette-10021.html",
            "url": "https://www.sephora.cz/p/coco-mademoiselle---eau-de-toilette-10021.html",
            "name": "COCO MADEMOISELLE - Toaletní voda s rozprašovačem | CHANEL ≡ SEPHORA",
            "offers": {
                "price": 2920,
                "priceCurrency": "Kč"
            },
            "brand": {
                "slogan": null
            },
            "image": "https://media.sephora.eu/content/dam/gdam/europe/digital/massivpimupload/C/CHANEL/10021/4914-media_swatch.jpg?scaleWidth=750&scaleHeight=750&scaleMode=fit",
            "description": "Popis\n\nEsence odvážné a nezávislé ženy. Orientálně-svěží a éterická vůně, uložená v plnitelném rozprašovači. Kultovní předmět, ideální na cesty."
        },
        {
            "linkUrl": "https://www.sephora.cz/p/men-smooth-shave---gel-na-holeni-bez-alkoholu-11063.html",
            "url": "https://www.sephora.cz/p/men-smooth-shave---gel-na-holeni-bez-alkoholu-11063.html",
            "name": "Men Smooth Shave - Gel na holení bez alkoholu | CLARINS ≡ SEPHORA",
            "offers": {
                "price": 371,
                "priceCurrency": "Kč"
            },
            "brand": {
                "slogan": null
            },
            "image": "https://media.sephora.eu/content/dam/gdam/europe/digital/pim/published/C/CLARINS/11063/40596-media_swatch.jpg?scaleWidth=750&scaleHeight=750&scaleMode=fit",
            "description": "Pěnivý gel bez alkoholu usnadňuje holení a zabraňuje podráždění pleti. Zklidňuje a zjemňuje pleť."
        }
    ]
}
```

### Want to scrape Facebook comments or groups?

You can use the dedicated scrapers below if you want to scrape specific Facebook data. Each of them is built particularly for the relevant Facebook or Instagram scraping case, be it posts, comments, reels, or search results. Feel free to browse them:

<table>
<tr>
<td>📷 <a href="https://apify.com/apify/instagram-scraper">Instagram Scraper</a></td>
<td>🕵️‍♀️ <a href="https://apify.com/apify/facebook-search-scraper">Facebook Search Scraper</a></td>
<td>👥 <a href="https://apify.com/apify/facebook-groups-scraper">Facebook Groups Scraper</a></td>
</tr>
<tr>
<td>😎 <a href="https://apify.com/apify/facebook-facebook-followers-following-scraper">Facebook Followers & Following Scraper</a></td>
<td>👀 <a href="https://apify.com/apify/facebook-marketplace-scraper">Facebook Marketplace Scraper</a></td>
<td>🎞 <a href="https://apify.com/apify/facebook-reels-scraper">Facebook Reels Scraper</a></td>
</tr>
<tr>
<td>🌟 <a href="https://apify.com/apify/facebook-reviews-scraper">Facebook Reviews Scraper</a></td>
<td>📝 <a href="https://apify.com/apify/facebook-posts-scraper">Facebook Posts Scraper</a></td>
<td>📹 <a href="https://apify.com/apify/facebook-video-search-scraper">Facebook Video Search Scraper</a></td>
</tr>
<tr>
<td>💬 <a href="https://apify.com/apify/facebook-comments-scraper">Facebook Comments Scraper</a></td>
<td>👍 <a href="https://apify.com/apify/facebook-likes-scraper">Facebook Likes and Reactions Scraper</a></td>
<td>ℹ️ <a href="https://apify.com/apify/facebook-page-contact-information">Facebook Page Contact Information</a></td>
</tr>
<tr>
<td>📘 <a href="https://apify.com/apify/facebook-pages-scraper">Facebook Pages Scraper</a></td>
<td>🏞 <a href="https://apify.com/apify/facebook-photos-scraper">Facebook Photos Scraper</a></td>
<td>🗓 <a href="https://apify.com/apify/facebook-events-scraper">Facebook Events Scraper</a></td>
</tr>
<tr>
<td>🔮 <a href="https://apify.com/apify/brand-collaboration-scraper">Brand Collaboration Scraper</a></td>
</tr>
</table>

### ❓FAQ

#### Is it legal to scrape Facebook Ads data?

Our Facebook Ads Library Scraper only collects data that is publicly available in the Facebook Ad Library. It does not access private content or extract sensitive user information such as email addresses or precise location. You should be aware that some public data may still be considered personal data under regulations like the [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation). Only scrape data if you have a legitimate reason. For more context, see our blog posts on [the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/) and [ethical web scraping](https://blog.apify.com/what-is-ethical-web-scraping-and-how-do-you-do-it/).

#### Why is my `ecommerceData` showing `null`?

We only enrich URLs that are actual product pages. If an ad leads somewhere else — for example, a sign-up or landing page — we skip the enrichment to save you money when the add-on is enabled. So a `null` value most likely means the ad's destination wasn't a product URL.

To check, look into the `snapshot` field: it contains `cards` → `linkUrl`, the link that leads from the ad to its destination page. Open that link and you'll see whether it's a product page or not. If you're convinced it is a product page but still aren't getting your e-commerce data, please open an issue on the [Issues tab](https://apify.com/apify/facebook-ads-scraper/issues/open).

#### Can I integrate Facebook Ads data with other services?

Yes. Scraped ads data can be integrated with almost any cloud service or web app. Apify supports **Make, Zapier, n8n, Slack, Airbyte, Asana, GitHub, Google Sheets, Google Drive**, [and more](https://apify.com/integrations). You can also use [webhooks](https://docs.apify.com/integrations/webhooks) to trigger actions when a run finishes, such as sending notifications or syncing results to another system.

#### Can I access Meta Ads data through an MCP server?

Yes. You can connect your scraped Instagram or Facebook ads to an [MCP server](https://apify.com/apify/facebook-ads-scraper/api/mcp) using clients like ClaudeDesktop or LibreChat, or build your own integration. For Facebook Ads Library Scraper:

1. Start a Server-Sent Events (SSE) session to receive a `sessionId`.
2. Send API messages using that `sessionId` to trigger the scraper.
3. The message starts the Facebook Ads Library Scraper with the provided input.
4. The response should be: Accepted.

Learn more in the [MCP setup guide](https://blog.apify.com/how-to-use-mcp/).

#### Can I use the Facebook Ads Library Scraper with API?

Yes. The Apify API provides programmatic access to run Actors, fetch datasets, monitor performance, and manage versions and schedules. For Node.js, use the apify-client NPM package. For Python, use the apify-client PyPI package. Full details are available in the [Apify API reference](https://docs.apify.com/api/v2), or check the [API tab](https://apify.com/apify/facebook-ads-scraper/api) for ready-to-use code examples.

#### Facebook Ads Library Scraper not working

The Apify team continuously improves Actor performance. If you run into technical issues or find a bug, please create an issue on the Actor’s [Issues tab](https://apify.com/apify/facebook-ads-scraper/issues/open) in Apify Console.

# Actor input Schema

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

Add a Facebook Page URL, a brand URL from Meta Ad Library, or a Meta Ad Library search URL. You can add multiple URLs using the <b>Bulk edit</b> option.

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

⚠️  If you leave this field empty, you will get as many results as possible.

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

When enabled, the Actor returns just the <b>total number of ads</b> for each page instead of scraping individual ads. Results are saved as a single dataset item per page.

## `includeAboutPage` (type: `boolean`):

When enabled, the Actor extracts the <b>About</b> tab details from each page's Ad Library profile:<br><ul><li><b>Managing organizations</b> – the advertiser's business address and phone number.</li><li><b>Primary country location</b> – where the page's admins are based.</li><li><b>Page history</b> – creation date, name changes, and merges.</li></ul>Valuable signals for competitor and brand research.

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

When enabled, the Actor opens each ad's detail view and adds an <code>ad\_details</code> object with:<br><ul><li><b>Advertiser page info</b> – Instagram username, follower count, and verification; page likes, category, and "About" text.</li><li><b>Spend data</b> – the page's ad spend and whether it's a registered political advertiser.</li><li><b>EU audience & reach</b> (for ads targeting the EU) – targeted countries, gender, and age range, total EU reach, a per-country age/gender reach breakdown, and the ad's declared payer and beneficiary.</li></ul>

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

Filter ads by whether they're currently running. <b>Active</b> ads are still being shown to users, while <b>inactive</b> ads have stopped running but remain archived in the Meta Ad Library. Choose <b>Active and inactive</b> to scrape both. <br><br>⚠️ Note: if the Meta Ad Library URL you provide already specifies an active status, that value takes priority and this field is ignored.

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

Set the order of the scraped ads: the default order, by impressions (high to low), or most recent first. <br><br>⚠️ Note: if the Meta Ad Library URL you provide already specifies sorting type, that value takes priority and this field is ignored.

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

Only scrape ads active on or after this date. Combine it with <b>Scrape ads older than</b> to set a closed date range. Use an absolute date (YYYY-MM-DD) or a relative value, such as 1 day, 2 months, or 3 years.

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

Only scrape ads that were active during or before this date. Combine it with <b>Scrape ads newer than</b> to set a closed date range. Use an absolute date (YYYY-MM-DD) or a relative value, such as 1 day, 2 months, or 3 years.

## `enrichWithEcommerceData` (type: `boolean`):

When enabled, the Actor detects e-commerce product pages from each ad's landing page URL and adds pricing and product details to the ad.<br><br><b>⚠️ Note:</b> you may get more product enrichment results than ads, because a single ad can contain multiple product URLs, each of which is enriched separately.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/SHEINOFFICIAL"
    },
    {
      "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&content_languages[0]=en&country=ALL&is_targeted_country=false&media_type=image&publisher_platforms[0]=instagram&publisher_platforms[1]=facebook&search_type=page&view_all_page_id=15087023444"
    }
  ],
  "resultsLimit": 10,
  "activeStatus": "",
  "sorting": "",
  "onlyAdsNewerThan": "2024-01-01",
  "onlyAdsOlderThan": "2024-12-31",
  "enrichWithEcommerceData": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all scraped data

# 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/SHEINOFFICIAL"
        },
        {
            "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&content_languages[0]=en&country=ALL&is_targeted_country=false&media_type=image&publisher_platforms[0]=instagram&publisher_platforms[1]=facebook&search_type=page&view_all_page_id=15087023444"
        }
    ],
    "resultsLimit": 10,
    "activeStatus": "",
    "sorting": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/facebook-ads-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 = {
    "startUrls": [
        { "url": "https://www.facebook.com/SHEINOFFICIAL" },
        { "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&content_languages[0]=en&country=ALL&is_targeted_country=false&media_type=image&publisher_platforms[0]=instagram&publisher_platforms[1]=facebook&search_type=page&view_all_page_id=15087023444" },
    ],
    "resultsLimit": 10,
    "activeStatus": "",
    "sorting": "",
}

# Run the Actor and wait for it to finish
run = client.actor("apify/facebook-ads-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/SHEINOFFICIAL"
    },
    {
      "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&content_languages[0]=en&country=ALL&is_targeted_country=false&media_type=image&publisher_platforms[0]=instagram&publisher_platforms[1]=facebook&search_type=page&view_all_page_id=15087023444"
    }
  ],
  "resultsLimit": 10,
  "activeStatus": "",
  "sorting": ""
}' |
apify call apify/facebook-ads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=apify/facebook-ads-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/JJghSZmShuco4j9gJ/builds/rrVTw8I2WYdLCwrpH/openapi.json
