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 the public Facebook Ad Library by domain, keyword or Page ID: ad copy, creatives, links, CTA, platforms, dates, active status and spend and impression ranges when shown.

Pricing

from $0.40 / 1,000 results

Rating

0.0

(0)

Developer

Actor stats

0

Bookmarked

7

Total users

3

Monthly active users

18 hours ago

Last modified

Share

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

HTTP-first, residential proxy. Ads are read directly from the Ad Library page and its internal GraphQL pagination (no browser, ~0.5 MB of proxy traffic per 200 ads). If Facebook blocks that path, the Actor automatically falls back to a Playwright browser (slower, ~3 MB of proxy traffic per run). 2 GB memory is enough for both paths.

What does Facebook Ad Library Scraper do?

Requests facebook.com/ads/library with your search query (the first ~30 ads come embedded in the page), then pages through the internal GraphQL endpoint (10 ads per page) until maxResults is reached or the Ad Library has no more ads. Only if that HTTP path fails does it load the page in a browser and scroll.

Run outcome and status messages

  • Succeeded: at least one ad was returned. The run status message shows how many ads, which path was used and the Ad Library counter. The counter (~N results) is approximate and usually 15-20 % higher than the number of distinct ads actually paged (grouped creatives are counted several times), so a run that ends with fewer ads than the counter is normal.
  • PARTIAL (still succeeded): ads were returned but the run stopped early (e.g. a block half-way); the message says why.
  • Failed: 0 ads. The message tells whether the Ad Library itself reports 0 results for the search, the input was empty, or the page was blocked / its layout changed.

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.

Facebook Ad Library Scraper input parameters

ParameterTypeDefaultDescription
domainstring-Advertiser domain, exact phrase match (e.g. toyota.cl). Mutually exclusive with keyword and view_all_page_id.
keywordstring-Keyword searched in ad text (e.g. Toyota Chile). Mutually exclusive with domain and view_all_page_id.
view_all_page_idstring-Facebook Page ID; returns only ads from that page. Mutually exclusive with domain and keyword.
countrystringESCountry filter. One of ES, CL, MX, CO, AR, PE, EC, US, GB, DE, FR, IT, BR, PT.
maxResultsinteger200Maximum number of ads to scrape (1-5000).
headlessbooleantrueRun the browser in headless mode.
proxyConfigurationobjectApify Proxy, RESIDENTIAL groupProxy settings for the browser.

Facebook Ad Library Scraper 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
}

Facebook Ad Library Scraper output example (JSON)

Besides the fields above, each ad includes collation_id, link_description, is_active, keyword (the query that produced it), country, scraped_at and source. This is a real record from the Actor's output:

{
"ad_archive_id": "1780138433194637",
"ad_url": "https://www.facebook.com/ads/library/?id=1780138433194637",
"collation_id": "949012497834209",
"page_id": "177540868925607",
"page_name": "Volkswagen",
"page_url": "https://www.facebook.com/VolkswagenChileOficial/",
"status": "active",
"body": "Diseñado para el pulso de la ciudad. Volkswagen Tera combina una silueta moderna y ágil con la altura y robustez de un verdadero SUVW",
"link_url": "https://www.cotizadoronline.cl/volkswagen/?utm_source=meta&utm_medium=advantage&utm_content=516&utm_term=conversion&utm_campaign=vw_tera_202606",
"link_title": "Súbete a un SUVW\n",
"link_description": "Conectado, eficiente y con todo el estilo. Súbete a Volkswagen Tera, tu primer SUVW\n",
"creative_url": "https://scontent-scl3-1.xx.fbcdn.net/v/t39.35426-6/825286422_2336403780250888_4134902428541484290_n.jpg?...",
"cta_type": "GET_QUOTE",
"start_date": "2026-10-02",
"end_date": "2026-10-02",
"platforms": "FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, THREADS",
"media_type": "text",
"is_active": true,
"impressions_lower": "",
"impressions_upper": "",
"spend_lower": "",
"spend_upper": "",
"spend_currency": "",
"keyword": "page:177540868925607",
"country": "CL",
"scraped_at": "2026-10-02 22:39:14",
"source": "facebook_ad_library"
}

Spend and impression fields are empty strings in this record because the ad was returned for Chile (a non-EU country). media_type is text, image or video.

Run time and memory

  • 10 ads: ~6–10 seconds
  • 100 ads: ~20 seconds
  • 200 ads: ~30–40 seconds (longer if the Actor falls back to the browser)

Memory: 2048 MB by default. The HTTP path uses ~150 MB; 2 GB leaves room for the browser fallback.

How much does it cost to scrape the Facebook Ad Library?

Facebook Ad Library Scraper uses Pay-Per-Event pricing. These are the events configured on the Actor:

EventPrice (USD)When it is charged
Actor Start$0.005Once per run, one event per GB of memory (minimum one event)
result$0.0004Each ad saved to the default dataset

Worked example (default 2048 MB = 2 GB, so 2 start events = $0.010):

AdsResult chargesStart chargesTotal
5050 × $0.0004 = $0.02$0.010$0.03
200200 × $0.0004 = $0.08$0.010$0.09
500500 × $0.0004 = $0.20$0.010$0.21
5,000 (maxResults limit)5,000 × $0.0004 = $2.00$0.010$2.01

Set maxResults or Apify's maximum-cost-per-run setting to cap spend.

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
  • More maxResults = more pages (10 ads per page after the first ~30) = 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.

Facebook Ad Library Scraper FAQ

How much does Facebook Ad Library Scraper cost?

$0.0004 per ad plus $0.005 per GB of run memory at start (2 GB by default, so $0.010). 200 ads come to about $0.09. See the pricing section above.

Which search mode should I use?

Use view_all_page_id when you know the advertiser's Page ID (only ads from that page), domain when you know the website, and keyword when you only know the brand name. If several are set, view_all_page_id takes priority over domain, which takes priority over keyword.

Which countries are supported?

The country input accepts ES, CL, MX, CO, AR, PE, EC, US, GB, DE, FR, IT, BR and PT.

Why are impressions_* and spend_* empty?

Those fields are populated only for EU countries where Facebook discloses them under the EU Digital Services Act. For other countries, such as CL, MX or US, they are empty.

How many ads can I get in one run?

Up to 5,000 (maxResults). More ads mean more scrolling and a longer run: typical run times are roughly 1-2 minutes for 50 ads and 8-12 minutes for 500. Results are deduplicated by ad_archive_id.

Do I need a Facebook account or API key?

No login or API key is needed. The Actor reads the public Ad Library and uses residential proxies by default.

Where do I report a problem?

Open an issue in the Issues tab of this Actor with your input and the run ID.

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