Meta Ad Scraper: How to Pull Every Ad from the Facebook Ad Library (2026)
What a Meta ad scraper is, the four ways to build or buy one, working Playwright code, the production architecture behind AdScrape — and how to stay legal.
A Meta ad scraper is a tool that pulls ads from the public Facebook Ad Library at scale. Whether you call it a Meta ad scraper, a Facebook ad scraper, or an ad data extractor, the job is the same: turn the browser-only Facebook Ad Library into queryable data. This guide explains how a Meta ad scraper actually works, the four ways to build or buy one, the rules to stay on the right side of, and the production stack we use to power AdScrape.
What is a Meta ad scraper?
A Meta ad scraper is software that opens the Facebook Ad Library — programmatically, not manually — and extracts ad creatives, copy, landing URLs, page details and start dates into structured data. Because Meta does not offer a commercial-ad API, a Meta ad scraper is the only way to systematically collect competitor ad data at scale.
A production-grade Meta ad scraper has five jobs:
- Render the Facebook Ad Library page (it is JavaScript-driven, not static HTML).
- Paginate through results, often hundreds per brand.
- Parse the DOM into a stable schema even when Meta changes the UI.
- Rotate IPs and fingerprints to avoid rate limits.
- Persist the data with deduplication and historical retention.
How a Meta ad scraper works under the hood
The Facebook Ad Library is a Single Page Application. A request to facebook.com/ads/library returns a near-empty HTML shell; everything you see is hydrated client-side after a series of internal Meta GraphQL calls. A Meta ad scraper has two architectural options:
Option A — Headless browser
Spin up Playwright or Puppeteer, drive the real UI, scroll to trigger pagination, and read the rendered DOM. Slower (~3–6 seconds per page) but resilient to GraphQL schema changes. Most public Meta ad scraper tools are built this way.
Option B — Direct GraphQL
Reverse-engineer the internal GraphQL endpoint the Facebook Ad Library calls. Much faster (~200ms per page) but breaks every time Meta rotates a field name — often monthly. Production Meta ad scrapers use this as a fast path with the headless browser as a fallback.
Four ways to use a Meta ad scraper
1. The browser Meta ad scraper (extensions)
Chrome extensions like Foreplay and Loop save ads as you scroll the Facebook Ad Library. This is a Meta ad scraper for one-person research, not for scale.
2. The DIY Meta ad scraper
Write Playwright scripts, pay for proxies, host on your own infra. Total cost: $200–$600 per month plus 2–3 weeks of engineering plus ongoing maintenance every time Meta changes the DOM.
# Minimal Meta ad scraper skeleton (Playwright)
from playwright.sync_api import sync_playwright
def scrape_meta_ads(page_name: str, country: str = "US"):
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
ctx = browser.new_context(user_agent="Mozilla/5.0 ...")
page = ctx.new_page()
url = (
f"https://www.facebook.com/ads/library/?active_status=active"
f"&ad_type=all&country={country}&q={page_name}"
)
page.goto(url)
page.wait_for_selector("[data-testid='ad-library-result']")
ads = page.eval_on_selector_all(
"[data-testid='ad-library-result']",
"els => els.map(e => e.innerText)"
)
browser.close()
return ads
3. The managed Meta ad scraper API
Services like AdScrape run a hosted Meta ad scraper for you and expose the results via a clean REST API. You skip the proxy and DOM-maintenance work.
4. The vertical Meta ad scraper
Tools like Minea bolt a Meta ad scraper onto a niche workflow (in Minea's case, dropshipping product research). Narrower but more opinionated.
Proxies, fingerprints and avoiding blocks
A Meta ad scraper that hits the Facebook Ad Library more than ~50 times from one IP gets throttled. Production scrapers solve this with:
- Residential proxies — IPs from real ISPs. Bright Data, Smartproxy and Oxylabs are the standard.
- Fingerprint randomisation — rotate User-Agent, screen size, canvas and WebGL signatures.
- Session warmup — load a Facebook page first, accept cookies, then hit the Library. Cold-start sessions trip detection.
- Backoff with jitter — exponential backoff on 429s with ±25% noise.
Storing what your Meta ad scraper finds
Each Facebook ad is ~80KB once you store the media reference plus the parsed fields. A scraper covering 500 brands at 50 ads each ingests ~2GB/month. Most teams land on Postgres for metadata, S3 for the media itself, and a search index (Meilisearch or OpenSearch) for keyword queries.
Is using a Meta ad scraper legal?
In short: yes, with caveats. The Facebook Ad Library is public by design and US courts have held that scraping public web data is not unlawful. See our full breakdown in Is scraping Facebook ads legal? for the GDPR, ToS and copyright nuances.
How AdScrape's Meta ad scraper works
AdScrape runs a distributed Meta ad scraper that hits the Facebook Ad Library every 24 hours for every tracked brand. The fast-path GraphQL extractor handles 90%+ of requests; a Playwright fleet handles the rest plus all media downloads. Results land in Postgres and are exposed through the AdScrape API. The free tier gives you 100 Meta ad scraper queries per month.
Meta ad scraper FAQ
What is the best Meta ad scraper?
For developers needing API access and historical data, AdScrape. For creative teams who only need to save what they see, a browser extension like Foreplay. For dropshipping, Minea's Meta ad scraper.
Is there a free Meta ad scraper?
The Facebook Ad Library itself is free to read; for a true Meta ad scraper, AdScrape, BigSpy and Minea all offer free tiers.
Can a Meta ad scraper see Instagram ads?
Yes. Instagram ads run through the same Meta Ads system and appear in the Facebook Ad Library, so any Meta ad scraper that reads the Library also covers Instagram.
How fast is a Meta ad scraper?
A direct-GraphQL Meta ad scraper can pull ~5 pages/second per IP; a headless-browser Meta ad scraper, ~0.3 pages/second per worker. AdScrape's production cluster does ~1M ads/day.
Do I need a Meta ad scraper if I have the Meta Ad API?
Yes — the official Meta Ad API only returns political ads. For commercial ads, a Meta ad scraper is the only option. See our Meta Ad API guide for the full comparison.
Put this into practice with AdScrape
Search every active Meta ad, compare brands side-by-side, and pull it all through a clean REST API. Free to start, no credit card required.