Facebook Ad Library Scraper & API - All 6 Meta Platforms avatar

Facebook Ad Library Scraper & API - All 6 Meta Platforms

Pricing

from $2.99 / 1,000 results

Go to Apify Store
Facebook Ad Library Scraper & API - All 6 Meta Platforms

Facebook Ad Library Scraper & API - All 6 Meta Platforms

Scrape the Meta Ad Library for competitor research. Paste a Facebook Ad Library URL or pick a keyword + country. Get every matching ad as a spreadsheet or via API: ad copy, images, videos, CTA, page, run dates, spend & reach. Covers FB, Instagram, Messenger, WhatsApp, Threads, Audience Network.

Pricing

from $2.99 / 1,000 results

Rating

0.0

(0)

Developer

Thodor

Thodor

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

1

Monthly active users

3 days ago

Last modified

Share

Facebook Ad Library Scraper & API for All 6 Meta Platforms

Scrape the Meta Ad Library for competitor research, creative intelligence, and ad-transparency monitoring. Paste a Facebook Ad Library URL or pick a keyword + country, and get every matching ad as a spreadsheet (CSV / Excel / Google Sheets), as JSON, or via API. Covers every ad running on Facebook, Instagram, Messenger, WhatsApp, Audience Network, and Threads.

Each ad comes back as one row with the fields you actually need: page name & profile, ad copy, images, videos, call-to-action, link destination, run dates, publisher platforms, plus spend, reach, and targeting for regulated categories (political/issue/housing/credit/employment ads).

Use it to scrape Facebook ads, extract Instagram ads, track WhatsApp / Messenger / Threads / Audience Network placements, spy on competitor creatives, and feed BI tools, lead-enrichment pipelines, or LLM agents with structured Meta ad data.

Built on the Apify platform: residential proxy rotation, scheduling, integrations, full REST API, and dataset export to spreadsheet (CSV, Excel), JSON, HTML, or RSS out of the box.

Why use this Meta Ad Library Scraper?

  • ๐Ÿ•ต๏ธ Competitor intelligence. See exactly what ads competitors are running, in which countries, and how long they've been running.
  • ๐ŸŽจ Creative research. Discover top-performing ad copy, formats, and call-to-actions in your industry.
  • ๐Ÿ“ˆ Trend analysis. Sort by total impressions or most recent to spot what's gaining traction.
  • โš–๏ธ Compliance & transparency. Track active political, housing, employment, or credit ads in any jurisdiction (with currency, spend, and reach estimates).
  • ๐ŸŒ Multi-country coverage. Issue separate searches per ISO country code in a single run.
  • ๐Ÿ”— Influence mapping. Link ads back to the Facebook pages running them, including page-like counts and categories.
  • ๐Ÿงช Live-tested filters. Every input is verified against Meta's GraphQL endpoint. Most scrapers expose UI options that silently don't work for anonymous browsing; this one doesn't.

How to scrape Facebook Ad Library data

This is the simplest workflow and works for 95% of cases. The form prefills with a working example URL, so the very first click of Start returns results.

  1. Go to https://www.facebook.com/ads/library/ in any browser.
  2. Set up the filters you want: keyword (q), country, ad type (all / political / housing / credit / employment), active status, media type, publisher platform, date range.
  3. Copy the full URL from your address bar.
  4. In Apify Console, open this actor and paste the URL into the Ad Library search URLs input. You can add multiple URLs; the actor scrapes them all in sequence and writes a flat search_url field to each row so you can trace results back to their source query.
  5. (Optional) Adjust Max ads per search (default: 100, max: 1,000,000).
  6. Click Start. Results stream into the dataset as ads are found, so you can begin downloading partial results immediately.

Option B: Use structured filters (no browser needed)

If you'd rather not paste URLs (e.g. you're templating runs across many keyword ร— country combinations from a spreadsheet, or wiring this into an automation), open the Structured filters section in the actor input and fill them directly:

  • Search terms + Countries: cross-product becomes one search per combination (3 terms ร— 5 countries = 15 searches in one run).
  • Ad category / Active status / Media type / Search type / Sort by / Publisher platforms / Start date from-to: every filter from Facebook's own Ad Library UI is exposed and labelled in plain English.

Click Start โ€” same as Option A.

Option C: Call it as an API

The actor is callable via the Apify REST API and webhooks with the same input schema as the UI. Useful for scheduled scrapes, lead-enrichment pipelines, n8n / Make / Zapier workflows, and any LLM agent stack. See the actor's API tab in Apify Console for the exact endpoint and example curl calls.

Use case recipes

Pick the recipe that matches your goal and follow the click-by-click steps. Recipes using Search terms + Countries require opening the Structured filters section in the actor input (or you can paste a URL with those filters baked in).

๐ŸŽจ Find the highest-performing creatives in your industry

Goal: pull the top-spending ads for a category across several countries.

What to fill in (in Structured filters):

  • Search terms: type your category keywords, one per line (e.g. weight loss, fitness app)
  • Countries: type the country codes you care about, one per line (e.g. US, GB, CA)
  • Leave everything else at default.

The actor will run one search per keyword ร— country combination (so 2 keywords ร— 3 countries = 6 separate sorted lists, biggest spenders per query first).

๐Ÿ“… Monitor newly-launched ads in your niche (weekly schedule)

Goal: catch new creative launches in your industry, e.g. the last 7 days. Pair with Apify's built-in Schedules to run it every Monday.

What to fill in (in Structured filters):

  • Search terms: your niche keywords (e.g. crypto, trading bot)
  • Countries: the countries you care about (e.g. US)
  • Sort by: change from the default to "Most recent (grouped by month)". This is important โ€” the default "Total impressions" sort silently ignores the lower date bound.
  • Start date from: pick the date one week ago in the date picker.
  • Active status: leave at active.

When the run finishes, schedule it weekly via the Schedules tab in Apify Console.

โš–๏ธ Political, housing, employment, or credit ad transparency

Goal: get the regulated-category-only fields โ€” currency, spend (range like "$600K - $700K"), reach_estimate, impressions_text / impressions_index, and targeted_or_reached_countries. These columns are empty for normal commercial ads โ€” you must set adType to a regulated category to get them.

What to fill in (in Structured filters):

  • Search terms: your topic (e.g. election, vote, mortgage)
  • Countries: the jurisdiction (e.g. US)
  • Ad category: change from "All ads" to "Issues, elections or politics" (or Housing / Employment / Financial products and services, depending on what you're tracking).
  • Active status: set to "Active + inactive" to also get historical ads (politics ads are kept for 7 years).

๐Ÿ“ฑ Threads / WhatsApp / Audience Network analysis

Goal: see which brands are running ads on Meta's lesser-known surfaces (most competitor scrapers only return Facebook + Instagram).

What to fill in (in Structured filters):

  • Search terms: your niche (e.g. fintech)
  • Countries: your market (e.g. US)
  • Publisher platforms: tick only the surfaces you want โ€” Threads, or WhatsApp, or Audience Network, or any combination. Leaving this empty returns ads from all surfaces.

๐ŸŒ Multi-country B2B lead research

Goal: find every active ad targeting a specific non-US country for a niche, then enrich the landing pages into a contact list.

What to fill in (in Structured filters):

  • Search terms: your niche, in the local language too if relevant (e.g. accounting software, boekhouder)
  • Countries: the target market (e.g. BE for Belgium)
  • Publisher platforms: tick Facebook and Instagram (skip Threads/WhatsApp for B2B).
  • Active status: leave at active.

When the run finishes, take the link_url column from the output spreadsheet and feed it into the Email Extractor & Lookup API to auto-find contact emails on each landing page.

๐Ÿ•ต๏ธ Spy on a single competitor's ads

Goal: see every ad one specific brand is currently running, biggest spenders first. No Structured filters needed.

Steps:

  1. Open the brand's Facebook page in your browser.
  2. Click the "Page transparency" section, then click "See all" under "Ads From This Page". This opens the Ad Library showing only that brand's ads.
  3. Copy the URL from your address bar.
  4. In the actor's input, paste it into Ad Library search URLs (replacing the prefilled crypto example).
  5. Click Start. That's it โ€” defaults take care of the rest (active ads only, sorted by biggest spenders).

Input

Every input is optional, except that you must provide either startUrls or searchTerms (or both; they're additive). Fields marked Structured are under the collapsible Structured filters section in the form.

FieldSectionDescription
startUrlsTop levelOne or more facebook.com/ads/library URLs copied from your browser. Prefilled with a working crypto/US example.
maxAdsPerSearchTop levelMax unique ads to collect per search. Default: 100. Max: 1,000,000. Set to 0 for unlimited.
searchTermsStructuredKeywords to search for (each term ร— country combination becomes one search).
countriesStructuredISO country codes; defaults to ["US"]. Use ["ALL"] for global.
adTypeStructuredall (default), political_and_issue_ads, housing_ads, employment_ads, credit_ads.
activeStatusStructuredactive (default), inactive, all.
mediaTypeStructuredall (default), image, video, meme, image_and_meme, none.
searchTypeStructuredkeyword_unordered (default), keyword_exact_phrase.
sortByStructuredtotal_impressions (default, high to low โ€” best for competitor analysis) or relevancy_monthly_grouped (most recent, grouped by month โ€” best with a date filter).
publisherPlatformsStructuredAny of facebook, instagram, messenger, whatsapp, audience_network, threads. Empty = all.
startDateFrom / startDateToStructuredYYYY-MM-DD bounds on ad start date.

Example input (API / programmatic โ€” section grouping doesn't apply here, just key names):

{
"startUrls": [
{"url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=crypto&search_type=keyword_unordered"}
],
"searchTerms": ["nike", "adidas"],
"countries": ["US", "GB"],
"publisherPlatforms": ["facebook", "instagram", "threads"],
"startDateFrom": "2025-01-01",
"maxAdsPerSearch": 100
}

Output

Each ad is written to the dataset as a flat row. Download as a spreadsheet (CSV or Excel) for direct use in Google Sheets, Airtable, or Looker, or grab JSON / HTML / RSS / API for piping into BI tools, LLM agents, and automation platforms.

โš ๏ธ Spend, reach, and impressions data is ONLY available for regulated ad categories โ€” political/issue, housing, employment, and credit ads. For normal commercial ads these columns will always be empty. This is a Meta policy (they only legally have to disclose ad finances for regulated categories), not a scraper limitation. To get spend/reach data, set Ad category to one of the regulated options when running the actor.

Some ads return placeholder text like {{product.name}} or {{product.brand}} in the title and body. Those are DCO (Dynamic Creative Optimization) ads where Meta serves a different product per viewer from the same template โ€” see the DCO FAQ for how to filter them out using the is_dynamic_creative column.

Data fields

FieldDescription
๐Ÿ†”ad_archive_idFacebook's stable ID for this ad
๐ŸŸขis_activeWhether the ad is currently running
๐Ÿ“„page_id, page_name, page_profile_uriThe Facebook page running the ad
๐Ÿ“Špage_categories, page_like_countPage metadata
๐ŸŽจdisplay_formatIMAGE, VIDEO, DCO (dynamic creative), DPA (dynamic product), CAROUSEL, etc.
๐Ÿงฌis_dynamic_creativetrue when the ad copy contains template placeholders like {{product.name}} (see FAQ below). Use this to filter DCO/DPA template ads out of a spreadsheet in one click.
๐Ÿ“title, body_text, captionAd copy. For DCO/DPA ads these may contain {{product.name}}, {{product.brand}}, {{product.description}} etc. placeholders rather than literal text
๐Ÿ”˜cta_text, cta_typeCall-to-action button label and type
๐Ÿ”—link_url, link_descriptionWhere the ad sends the user
๐Ÿ–ผ๏ธimage_urlsDirect CDN URLs for image creatives
๐ŸŽฌvideo_urlsDirect CDN URLs for video creatives
๐ŸƒcardsFor carousel/DCO ads: array of per-card creative (title, body, link, image)
๐Ÿ“ฑpublisher_platformWhich Meta surfaces ran the ad: FACEBOOK, INSTAGRAM, MESSENGER, THREADS, WHATSAPP, AUDIENCE_NETWORK
๐Ÿ“…start_date, end_dateISO 8601 UTC strings (e.g. "2026-05-23T05:36:37Z"). For active ads, end_date is null and start_date is derived from the actual total_active_time (Meta's anonymous endpoint doesn't expose real delivery windows for non-political ads).
๐Ÿท๏ธcategoriesAd's policy categories, e.g. political, housing, credit, employment
๐Ÿšฉcontains_sensitive_content, contains_digital_created_mediaPolicy flags
๐Ÿ’ฐcurrency, spend, reach_estimate, impressions_text, impressions_indexโš ๏ธ POLITICAL ADS ONLY. Null for all normal commercial ads. spend is a string range like "$600K - $700K" or ">$1M". reach_estimate and impressions_text are string ranges. impressions_index is the only numeric version โ€” use it to sort competitors by impressions in a spreadsheet.
๐ŸŒtargeted_or_reached_countriesโš ๏ธ POLITICAL ADS ONLY. Populated for cross-border political campaigns; empty for single-country regulated ads.
๐Ÿ”search_urlWhich input URL this ad came from (useful when scraping multiple searches)

Raw JSON examples (for developers)

The data fields table above is the canonical reference. The blocks below show the raw row shape you'll get from the API / JSON export, in case you're piping the output into a script.

Normal commercial ad โ€” political/transparency fields are present but empty (Meta only publishes those for regulated ads).

{
"ad_archive_id": "1361967839295138",
"is_active": true,
"page_id": "170402436152087",
"page_name": "Crypto Fund Trader",
"page_profile_uri": "https://www.facebook.com/cryptofundtrader/",
"page_categories": ["Internet company", "Education"],
"page_like_count": 2342,
"display_format": "DCO",
"is_dynamic_creative": true,
"title": "{{product.name}}",
"body_text": "$19M+ in performance rewards processed. 50,000 traders completed virtual evaluations.",
"caption": "cryptofundtrader.com",
"cta_text": "Learn more",
"cta_type": "LEARN_MORE",
"link_url": "https://cryptofundtrader.com/?utm_source=meta&...",
"image_urls": [],
"video_urls": ["https://video.xx.fbcdn.net/..."],
"cards": [{"title": "...", "body": "...", "link_url": "...", "cta_text": "..."}],
"publisher_platform": ["FACEBOOK", "INSTAGRAM", "MESSENGER"],
"start_date": "2025-11-07T20:00:00Z",
"end_date": null,
"categories": ["UNKNOWN"],
"contains_sensitive_content": false,
"contains_digital_created_media": false,
"currency": null,
"spend": null,
"reach_estimate": null,
"impressions_text": null,
"impressions_index": null,
"targeted_or_reached_countries": [],
"search_url": "https://www.facebook.com/ads/library/?..."
}

Political / regulated ad โ€” same schema, but the bottom block is populated because Ad category was set to political_and_issue_ads (or housing_ads / employment_ads / credit_ads). spend, reach_estimate, and impressions_text are string ranges; impressions_index is the only numeric column.

{
"ad_archive_id": "352695862528588",
"is_active": true,
"page_id": "20531316728",
"page_name": "Facebook App",
"categories": ["POLITICAL"],
"currency": "USD",
"spend": "$600K - $700K",
"reach_estimate": ">1M",
"impressions_text": ">1M",
"impressions_index": 39,
"targeted_or_reached_countries": ["US", "CA"],
"search_url": "https://www.facebook.com/ads/library/?ad_type=political_and_issue_ads&..."
}

Tips

  • Parallelism. To go faster, add more search URLs (or more searchTerms ร— countries combinations) rather than trying to scale a single search. Workers within one search paginate the same sorted list and waste requests on duplicates beyond ~5 parallel workers.
  • Country filter matters. country=ALL returns Facebook's globally-sorted top ads (heavily US-dominated). Use specific country codes (e.g. country=BE for Belgium-targeted ads) for non-US scrapes.
  • Sort order. Two modes are honored server-side for anonymous browsing: Most recent (monthly grouped) (default; surfaces newly-launched ads, respects both ends of the date filter) and Total impressions (biggest spenders first; often returns older very-high-spend creatives, and only respects the upper end of the date filter). FB's UI exposes "Creation time / Start date / End date" but those sort modes are not actually honored for anonymous requests; the actor maps them to "Most recent" so pasted URLs still work.
  • Date range filter. Use start_date[min] and start_date[max] in pasted URLs (FB UI's "Start date" picker), or the Start date from / Start date to inputs. Works most reliably with the "Most recent" sort.
  • Ad type filter. Change ad_type from all to political_and_issue_ads (or housing, credit, employment) to scope to regulated ad categories, which return additional fields like spend, reach, and targeting.
  • Anti-bot engineering. The actor uses residential sticky-session proxies, Chrome TLS impersonation (Meta blocks plain-Python TLS fingerprints), and an auto-solver for Facebook's rd_challenge HTTP-403 gate. You don't need to configure any of this; it's hardcoded as the default because anything else gets rate-limited within seconds.

Other Apify Actors you might like

If you're using this for competitive intelligence or lead enrichment, these pair well:

  • TikTok Comment Scraper: extract comments, usernames, timestamps, likes & reply counts from any TikTok username or video URL. Useful for social listening alongside Meta ad data.
  • Email Extractor & Lookup API: bulk-extract emails from any list of domains (e.g. the link_url pages this actor finds). Auto-discovers contact pages and verifies domains.
  • CMS & Tech Stack Detector: identify the CMS, frameworks, analytics, payment processors, and ecommerce add-ons on competitor sites you discover through their ads.
  • Reverse Image Search API: find where an ad creative appears elsewhere on the web (Instagram, TikTok, eBay, Amazon, etc.) using Google Lens exact-match search.
  • Google Maps Places API: 60+ business attributes per place (names, phones, websites, hours, reviews, coordinates). Good for B2B lead lists.

FAQ, disclaimers, and support

Is it legal to scrape the Facebook Ad Library? The Facebook Ad Library is a public transparency tool that Meta provides intentionally to let anyone see active ads. This actor only retrieves data that is visible to any logged-out browser visiting the same URLs. Always respect Meta's Terms of Service and your local laws when using scraped data.

Why does some ad copy look like {{product.name}} instead of real text? Those ads are DCO (Dynamic Creative Optimization) or DPA (Dynamic Product Ads). The advertiser uploads a template like "Shop {{product.name}} from {{product.brand}} today" and links it to a Facebook Commerce Manager product catalog. At render time, Meta picks the right product per viewer and substitutes the placeholder, so each user sees a different rendered ad from the same template. Because there's no single "rendered" ad, the Ad Library (and therefore every scraper, including this one) returns the raw template with placeholders intact. Use the is_dynamic_creative column to filter these out of your spreadsheet in one click if you only want literal ad copy.

Feedback: open an issue on the actor's Issues tab if anything is broken or missing a field you need.