← API Catalog
Apify·Async

Facebook Ads Library Scraper

SocialE-commerce$0.005 / Ad

What it does

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.

Returns: 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.

Parameters

ParameterTypeRequiredDescription
sortingselectNoSet the order of the scraped ads: the default order, by impressions (high to low), or most recent first. ⚠️ Note: if the Meta Ad Library URL you provide already specifies sorting type, that value takes priority and this field is ignored.
onlyTotalbooleanNoWhen enabled, the Actor returns just the total number of ads for each page instead of scraping individual ads. Results are saved as a single dataset item per page.
startUrlsarrayYesAdd 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 Bulk edit option.
activeStatusselectNoFilter ads by whether they're currently running. Active ads are still being shown to users, while inactive ads have stopped running but remain archived in the Meta Ad Library. Choose Active and inactive to scrape both. ⚠️ Note: if the Meta Ad Library URL you provide already specifies an active status, that value takes priority and this field is ignored.
resultsLimitnumberNo⚠️ If you leave this field empty, you will get as many results as possible.
isDetailsPerAdbooleanNoWhen enabled, the Actor opens each ad's detail view and adds an ad_details object with: Advertiser page info – Instagram username, follower count, and verification; page likes, category, and "About" text. Spend data – the page's ad spend and whether it's a registered political advertiser. EU audience & reach (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.
includeAboutPagebooleanNoWhen enabled, the Actor extracts the About tab details from each page's Ad Library profile: Managing organizations – the advertiser's business address and phone number. Primary country location – where the page's admins are based. Page history – creation date, name changes, and merges. Valuable signals for competitor and brand research.
onlyAdsNewerThantextNoOnly scrape ads active on or after this date. Combine it with Scrape ads older than 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.
onlyAdsOlderThantextNoOnly scrape ads that were active during or before this date. Combine it with Scrape ads newer than 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.
enrichWithEcommerceDatabooleanNoWhen enabled, the Actor detects e-commerce product pages from each ad's landing page URL and adds pricing and product details to the ad. ⚠️ Note: you may get more product enrichment results than ads, because a single ad can contain multiple product URLs, each of which is enriched separately.

Endpoints

GET/v1/agents/resources/inspect/apify.apify.facebook-ads-scraperPublic
POST/v1/agents/resources/estimate/apify.apify.facebook-ads-scraperPublic
POST/v1/agents/resources/run/apify.apify.facebook-ads-scraperAgent key
GET/v1/agents/resources/runs/{run_id}Agent key

Quick start

Run it with one Agent One Key over the OpenAI-compatible resource rail.

curl -X POST https://api.deva.me/v1/agents/resources/run/apify.apify.facebook-ads-scraper \
  -H "Authorization: Bearer deva_i1_your_key_here" \
  -H "Content-Type: application/json" \
  --data '{
    "params": {}
  }'

Related in Social

Instagram Scraper
Extract Instagram posts, reels, profiles, places, hashtags, carousels, and comments. Get data from Instagram using one or more Instagram URLs or search queries: content, context, metrics, metadata. Export scraped data, run the scraper via API, schedule and monitor runs or integrate with other tools.
Tweet Scraper V2 - X / Twitter Scraper
Lightning-fast search, URL, list, and profile scraping, with customizable filters. At $0.40 per 1000 tweets, and 30-80 tweets per second, it is ideal for researchers, entrepreneurs, and businesses! Get comprehensive insights from Twitter (X) now!
TikTok Scraper
Extract data from TikTok videos, hashtags, and users. Use URLs or search queries to scrape TikTok profiles, hashtags, posts, URLs, shares, followers, hearts, names, video, and music-related data. Export scraped data, run the scraper via API, schedule and monitor runs or integrate with other tools.
Instagram Profile Scraper
Scrape all Instagram profile info. Just add Instagram usernames, IDs or URLs and extract name, join date, number of followers, location, bio, website, related profiles, video&post count, latest posts. Export scraped data, schedule scraper via API, and integrate with other tools or AI workflows.
Instagram Post Scraper
Scrape Instagram posts. Just add one or more Instagram usernames and get your data in seconds including caption, metrics, images, mentions, coauthors, recent comments, sponsored status, video duration, views. Export scraped data, schedule scraper via API, integrate with other tools or AI workflows.
Facebook Posts Scraper
Extract posts, videos, and engagement metrics from Facebook pages. Get text captions, reactions, video transcripts, images, external links, collaborators, and more from Facebook pages and profiles. Export ad data, schedule runs via API, and integrate with other tools or AI workflows.