Facebook Ad Library Scraper avatar

Facebook Ad Library Scraper

Pricing

from $0.40 / 1,000 results

Go to Apify Store
Facebook Ad Library Scraper

Facebook Ad Library Scraper

Scrapes ads from Facebook Ad Library. Select the brand and extract the historical ads.

Pricing

from $0.40 / 1,000 results

Rating

0.0

(0)

Developer

Actor stats

0

Bookmarked

2

Total users

0

Monthly active users

2 days ago

Last modified

Share

Extracts ads from Facebook's public Ad Library by intercepting internal GraphQL calls. No API key or Facebook login required.

Uses Playwright + residential proxy to load the Ad Library page and capture GraphQL ad data. 4 GB memory recommended.

What it does

Navigates to facebook.com/ads/library with your search query, scrolls to load more results, and intercepts the internal GraphQL responses that contain ad data.

Three search modes

ModeFieldWhen to use
Domain searchdomainYou know the advertiser's website (e.g. toyota.cl). More precise — uses exact-phrase matching.
Keyword searchkeywordYou only know the brand name. Broader results.
Page ID searchview_all_page_idYou know the Facebook Page ID. Zero-noise mode — returns ONLY ads from that specific page. Most precise.

If multiple fields are set, priority is: view_all_page_id > domain > keyword.

Finding a Page ID

  1. Go to facebook.com/ads/library and search for the brand
  2. Click on an ad from the advertiser you want
  3. Click "See all ads from this advertiser"
  4. The URL will contain view_all_page_id=XXXXXXXXXXXX — that number is the Page ID

Output fields

Core fields (all modes)

FieldTypeDescription
ad_archive_idstringFacebook ad archive ID (deduplication key)
page_idstringAdvertiser page ID
page_namestringAdvertiser page name
page_urlstringAdvertiser page URL
statusstringactive / inactive
bodystringAd text content (max 600 chars)
link_urlstringDestination URL
link_titlestringLink card title
start_datestringFirst shown date (YYYY-MM-DD)
end_datestringLast shown date (YYYY-MM-DD, null if still active)
platformsstringPlatforms (facebook, instagram, etc.)
media_typestringtext / image / video

v0.6 new fields

FieldTypeDescription
ad_urlstringDirect URL to view the ad in Facebook Ad Library (facebook.com/ads/library/?id=...)
creative_urlstringURL of the ad creative asset (video HD/SD URL or image URL). Extracted from the ad snapshot.
cta_typestringCall-to-action type (e.g. LEARN_MORE, SHOP_NOW, SIGN_UP). From the ad snapshot.
impressions_lowerintegerLower bound of estimated impressions (EU transparency data only).
impressions_upperintegerUpper bound of estimated impressions (EU transparency data only).
spend_lowerintegerLower bound of estimated ad spend (EU transparency data only).
spend_upperintegerUpper bound of estimated ad spend (EU transparency data only).
spend_currencystringCurrency code for spend fields (e.g. EUR).

Note: impressions_* and spend_* fields are populated only for EU countries where Facebook is required to disclose this data under the EU Digital Services Act. For non-EU countries (e.g. CL, MX, US), these fields will be null.

Example inputs

Domain mode

{
"domain": "toyota.cl",
"country": "CL",
"maxResults": 100
}

Page ID mode (zero-noise)

{
"view_all_page_id": "303915015690",
"country": "CL",
"maxResults": 200
}

Cost estimate

  • 50 ads (test): ~$0.003, ~1–2 minutes
  • 200 ads: ~$0.01, ~3–5 minutes
  • 500 ads: ~$0.02, ~8–12 minutes

Memory: 4096 MB (Playwright required; Facebook runs heavy JS).

Proxy

Residential proxies are required — Facebook blocks datacenter IPs systematically. The actor defaults to RESIDENTIAL proxy group.

Notes

  • Facebook may show a cookie consent dialog; handled automatically
  • Results depend on scroll depth: more maxResults = more scrolling = more time
  • Deduplicates by ad_archive_id
  • The Ad Library shows all active and recently inactive ads (last 7 years for political ads, 90 days for others)
  • creative_url and cta_type are extracted from Facebook's inline snapshot data — coverage depends on the ad format (typically 70-80% for creative_url, 40-50% for cta_type)

Accesses only publicly visible ad data — the same data available at facebook.com/ads/library without login. No personal user data is collected.

Ad library scrapers

All four share a normalized output schema — same field names, same formats. Merge datasets from different platforms without a mapping layer.

ActorWhat it adds
TikTok Ad Library ScraperAd creatives, targeting and spend data from TikTok's EU transparency archive
Google Ads Transparency ScraperSearch, Display and YouTube ads from Google's Ads Transparency Center
LinkedIn Ad Library ScraperB2B ads from LinkedIn's Ad Library