Apify Store
AS
Apify Store
/apify/facebook-ads-scraper

Facebook Ads Library Scraper

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

liveverifiedasyncdegraded · 25.8s~30s typical
social mediaecommercelead generationfacebookads
$0.0073
per result + $0.005 call
plus $0.001 platform fee per run
Actor charges $0.0058 per result; Cracked adds 25% plus a $0.005 call fee
Bring your own Apify Store key: provider portion drops to $0.
$Set up https://cracked-ai-pearl.vercel.app/SKILL.md, then use Cracked to run apify /apify/facebook-ads-scraper for me.

Input

FieldTypeDescription
startUrls*arrayAdd 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.
resultsLimitinteger⚠️ If you leave this field empty, you will get as many results as possible.
onlyTotalbooleanWhen 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.
includeAboutPagebooleanWhen 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.
isDetailsPerAdbooleanWhen 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 &amp; 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>
activeStatusstring ( | active | inactive)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. default ""
sortingstring ( | total_impressions | relevancy_monthly_grouped)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. default ""
onlyAdsNewerThanstringOnly 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.
onlyAdsOlderThanstringOnly 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.
enrichWithEcommerceDatabooleanWhen 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. default false

Call it

curl
curl https://cracked-ai-pearl.vercel.app/v1/run \
  -H "Authorization: Bearer ck_live_..." -H "content-type: application/json" \
  -d '{"provider":"apify","endpoint":"/apify/facebook-ads-scraper","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":3,"onlyTotal":false,"includeAboutPage":false,"isDetailsPerAd":false,"activeStatus":"","sorting":"","onlyAdsNewerThan":"2024-01-01","onlyAdsOlderThan":"2024-12-31","enrichWithEcommerceData":false},"wait":false}'
poll
curl "https://cracked-ai-pearl.vercel.app/v1/runs/<runId>?wait=30" -H "Authorization: Bearer ck_live_..."
cli
npx cracked-ai run -p apify -e /apify/facebook-ads-scraper -i '{"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":3,"onlyTotal":false,"includeAboutPage":false,"isDetailsPerAd":false,"activeStatus":"","sorting":"","onlyAdsNewerThan":"2024-01-01","onlyAdsOlderThan":"2024-12-31","enrichWithEcommerceData":false}' -w 120
mcp
run_tool({ provider: "apify", endpoint: "/apify/facebook-ads-scraper", 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":3,"onlyTotal":false,"includeAboutPage":false,"isDetailsPerAd":false,"activeStatus":"","sorting":"","onlyAdsNewerThan":"2024-01-01","onlyAdsOlderThan":"2024-12-31","enrichWithEcommerceData":false}, wait: false })

Try it

Runs against your signed-in workspace balance. Sign in if you have not.