Facebook Ads Library Scraper avatar

Facebook Ads Library Scraper

Pricing

from $2.00 / 1,000 facebook ad scrapeds

Go to Apify Store
Facebook Ads Library Scraper

Facebook Ads Library Scraper

Scrape public Meta/Facebook Ad Library ads by keyword, Ad Library URL, advertiser page ID or name, or ad ID. Advertiser, copy, CTA, landing page, media, platforms, dates, spend and reach, plus optional EU/UK audience data. No login.

Pricing

from $2.00 / 1,000 facebook ad scrapeds

Rating

0.0

(0)

Developer

Khadin Akbar

Khadin Akbar

Maintained by Community

Actor stats

0

Bookmarked

57

Total users

12

Monthly active users

12 days ago

Last modified

Features

Limited permissions

Share

What is Facebook Ads Library Scraper?

Facebook Ads Library Scraper is an Apify Actor for public Meta/Facebook Ad Library data. It accepts keyword search terms, pasted Ad Library search or advertiser URLs, company page IDs, company names, or ad IDs and returns one dataset record per ad. Each record can include advertiser identity, creative copy, CTA text, landing page URL, media URLs, status, platform coverage, dates, spend and reach estimates, and (optionally) the EU/UK audience record with total reach and age/gender mix by country.

What's new (November 2026): lower tiered prices from $0.003 to $0.002 per ad, pasted Ad Library URLs, several targets scraped in parallel, an optional EU/UK audience lookup, an only-new-ads monitoring mode, a platform filter, and an agentSummary in the run output.

The Actor uses provider-backed public Ad Library APIs, so it fits workflows that start with public ad discovery and end with dataset-based analysis in Apify. It is usable through Apify MCP and the Apify API. No Facebook login is required when the configured provider keys are available in the Actor environment.

Best fit and connected workflows

Use this Actor when you want structured public ad intelligence from Meta's Ad Library and you already know one of the following starting points:

  • a keyword or phrase for broad discovery
  • a company page ID for advertiser-specific monitoring
  • a company name that can be resolved to a page ID
  • a specific ad ID or public Ad Library URL for direct lookup

It connects naturally to downstream workflow steps such as:

  • reviewing ad creative variations by advertiser, headline, and CTA
  • grouping ads by platform, status, country, or date range
  • exporting ad records for manual competitive research
  • passing returned public ad references into Facebook Post Comments Scraper or Facebook Likes Scraper - Public Reactions & Profiles when your workflow continues with public engagement data for a returned Facebook record

Practical scenario

Maya works on paid social research for a direct-to-consumer brand. She starts with the company name "lululemon" and wants to review active ads in the US. She runs the Actor in companyAds mode with companyNames, country, and a moderate maxResults cap.

The returned dataset records give her:

  • pageName and pageId to confirm the advertiser
  • headline, adCopy, and ctaText to review the creative angle
  • landingPageUrl to inspect the offer destination
  • publisherPlatforms to see where the ad ran
  • isActive, startDate, and endDate to understand the run window

She uses those fields to decide which creative theme to compare against her own campaign, then opens the landing page and saves the ad URL for follow-up analysis.

Input

FieldTypePurpose
modestringSelects the discovery path: auto, search, companyAds, or adDetails.
searchTermsarrayKeywords or exact phrases for Ad Library search.
companyPageIdsarrayFacebook Ad Library page IDs for advertiser-specific scraping.
companyNamesarrayCompany names to resolve to page IDs before scraping.
adIdsarrayMeta Ad Library archive IDs for direct detail lookup.
adUrlsarrayPublic single-ad URLs (...ads/library?id=...) for direct lookup.
libraryUrlsarrayPasted Ad Library search or advertiser-page URLs. Country, status, media type, dates and language in the URL apply to that URL.
countrystringTwo-letter country code such as US or ALL.
statusstringACTIVE, INACTIVE, or ALL.
mediaTypestringCreative media filter such as IMAGE, VIDEO, or ALL.
adTypestringall or political_and_issue_ads.
searchTypestringkeyword_unordered or keyword_exact_phrase.
sortBystringKeyword result sorting by impressions or relevance.
languagestringOptional two-letter language code.
startDatestringOptional impression start date in YYYY-MM-DD format.
endDatestringOptional impression end date in YYYY-MM-DD format.
maxResultsintegerMaximum number of ad records to save.
maxPagesPerSearchintegerMaximum provider result pages per target.
enrichDetailsbooleanAdds the EU/UK audience record to each saved ad (billed only when the data comes back).
maxDetailsintegerUpper limit of detail lookups per run (default 50).
onlyNewAdsbooleanMonitoring mode: skip ads returned by an earlier run of the same inputs and bill only new ones.
monitorKeystringOptional name that keeps separate "already seen" lists for different jobs.
platformsarrayKeep only ads that ran on these platforms (for example INSTAGRAM).
includeRawDatabooleanAdds the raw provider payload to each dataset item.
providerstringData route selection; leave on auto.
requestTimeoutSecsintegerPer-provider request timeout in seconds.

Focused input example

{
"mode": "search",
"searchTerms": ["running shoes", "fitness app"],
"country": "US",
"status": "ACTIVE",
"mediaType": "ALL",
"searchType": "keyword_unordered",
"sortBy": "total_impressions",
"maxResults": 25,
"maxPagesPerSearch": 3,
"enrichDetails": false,
"provider": "auto"
}

Output

Each dataset item is one ad record. The dataset is the main output, and the Actor also writes a machine-readable run summary to the default key-value store.

FieldTypePurpose
adIdstringMeta Ad Library archive ID.
adUrlstringDirect Facebook Ad Library URL.
pageIdstring or nullFacebook page ID running the ad.
pageNamestring or nullAdvertiser or page display name.
pageUrlstring or nullFacebook page or profile URL for the advertiser.
pageProfilePictureUrlstring or nullAdvertiser profile image URL.
isActiveboolean or nullCurrent active status when exposed.
startDatestring or nullISO timestamp for the ad start.
endDatestring or nullISO timestamp for the ad end or scheduled end.
publisherPlatformsarrayMeta platforms such as Facebook or Instagram.
countrystring or nullCountry ISO code from the creative snapshot.
targetedCountriesarrayCountries targeted or reached when exposed.
headlinestring or nullPrimary headline or first carousel card title.
adCopystring or nullMain body text from the ad snapshot.
bodyTextstring or nullNormalized body text for filtering and export.
ctaTextstring or nullCall-to-action text such as Shop Now.
ctaTypestring or nullProvider CTA type code.
captionstring or nullCreative caption or domain label.
linkDescriptionstring or nullDescription attached to the landing link or card.
landingPageUrlstring or nullDestination URL when exposed.
creativeImageUrlsarrayCreative image URLs.
creativeVideoUrlsarrayCreative video URLs.
cardsarrayNormalized carousel or card variants.
displayFormatstring or nullMeta display format code.
currencystring or nullSpend currency when exposed.
spendobject or nullSpend range object when exposed.
impressionsTextstring or nullImpression range text when exposed.
reachEstimateobject or nullReach estimate object when exposed.
categoriesarrayAd categories from the provider response.
containsDigitalCreatedMediaboolean or nullWhether Meta flags digitally created media.
containsSensitiveContentboolean or nullWhether Meta flags sensitive content.
sourceModestringInput mode that produced the record.
searchTermstring or nullKeyword or company name that produced the record.
companyPageIdstring or nullCompany/page ID used for company scrapes.
providerstringProvider that returned the record.
detailEnrichedbooleanWhether the ad was enriched with its detail record.
transparencyobject or nullEU/UK audience record when details were fetched: euTotalReach, ukTotalReach, targetsEu, ageAudience, genderAudience, locationAudience, payers, beneficiaries, isTakenDown, reachByCountryAgeGender.
scrapedAtstringISO timestamp for extraction.

Illustrative output record

{
"adId": "3557423444566854",
"adUrl": "https://www.facebook.com/ads/library?id=3557423444566854",
"pageId": "33693527731",
"pageName": "Example Brand",
"pageUrl": "https://www.facebook.com/examplebrand",
"isActive": true,
"startDate": "2026-01-01T00:00:00Z",
"endDate": null,
"publisherPlatforms": ["FACEBOOK", "INSTAGRAM"],
"headline": "New season essentials",
"adCopy": "Discover a fresh collection built for everyday training.",
"ctaText": "Shop Now",
"landingPageUrl": "https://example.com/collection",
"creativeImageUrls": ["https://example.com/image.jpg"],
"sourceMode": "companyAds",
"searchTerm": "example brand",
"companyPageId": "33693527731",
"detailEnriched": false,
"scrapedAt": "2026-01-01T12:34:56Z"
}

How it works

  1. You choose a discovery mode:

    • search for keyword-based Ad Library discovery
    • companyAds for page-based advertiser scraping
    • adDetails for direct ad lookup
    • auto to try ad IDs first, then company inputs, then keyword search
  2. The Actor reads public Ad Library data through managed data routes (with an automatic backup route) and scrapes several targets at once.

  3. It normalizes the returned ad data into dataset items.

  4. If enrichDetails is enabled, up to maxDetails ads get their EU/UK audience record, fetched eight at a time.

  5. It writes the dataset and the run summary to Apify storages.

The Actor reads provider credentials from these environment variables:

Pricing

Pay per event. Platform usage is included in the price you see (no extra usage bill).

EventFreeBronzeSilverGold and above
Ad scraped (ad-scraped)$0.0030$0.0027$0.0024$0.0020
EU/UK audience data (detail-enriched), only when returned$0.0020$0.0020$0.0020$0.0020
Actor start (apify-actor-start), per GB of memory$0.00005$0.00005$0.00005$0.00005

Cost examples (Free plan): 100 ads = $0.30, 1,000 ads = $3.00; on Gold, 1,000 ads = $2.00. With audience data on 20 ads add $0.04. The start event is charged even when input is invalid or nothing is found; result events are charged only for ads actually saved. Result limits cap result events. Check the live Pricing tab for current rates.

Use with AI agents (MCP)

This Actor is available through Apify MCP as a tool for retrieving structured public Meta/Facebook Ad Library records. The exact Actor identity is khadinakbar/facebook-ads-library-scraper.

Tool description: search or look up public Facebook ads by keyword, company page ID, company name, ad ID, or public Ad Library URL, then return normalized ad records with provenance fields suitable for downstream analysis.

Find active public ads for this advertiser and summarize the creative themes.

Input: use companyNames, country, status, and maxResults. If the ad record includes landing pages and platforms, include them in the summary. Return the ad URLs and explain which fields support each observation.

Output interpretation:

  • adId and adUrl identify the public Ad Library record.
  • pageName, pageId, and pageUrl identify the advertiser.
  • headline, adCopy, ctaText, and landingPageUrl describe the creative and destination.
  • publisherPlatforms, isActive, startDate, and endDate provide run context.
  • provider, sourceMode, searchTerm, companyPageId, detailEnriched, and scrapedAt support provenance and auditability.

Scope and pagination:

  • Use one country per request (a country inside a pasted library URL applies to that URL).
  • Use maxPagesPerSearch to control how many provider pages are checked per target.
  • Use maxResults as the main cap on saved records.
  • When enrichDetails is enabled, up to maxDetails extra lookups run; a detail fee applies only to ads where EU/UK audience data came back.

Cost guidance:

  • Each saved ad record is billed as one ad-scraped event.
  • The EU/UK audience lookup adds one detail-enriched event per ad that returned the data.
  • The live Pricing tab is the source of truth for the current billing view on Apify.

Apify API example

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({
token: process.env.APIFY_TOKEN,
});
const run = await client.actor('khadinakbar/facebook-ads-library-scraper').call({
mode: 'search',
searchTerms: ['running shoes'],
country: 'US',
status: 'ACTIVE',
maxResults: 5,
});
const dataset = client.dataset(run.defaultDatasetId);
const { items } = await dataset.listItems();
console.log('First records:', items);

Best results and outcome guidance

Start with the narrowest input that matches your research goal:

  • use adIds or adUrls for a specific public ad
  • use companyPageIds when you already have the advertiser page ID
  • use companyNames when you need resolution from a brand name
  • use searchTerms for theme, category, or competitor discovery

Helpful settings from the contract:

  • country: use a single country code such as US when you want location-specific results
  • status: choose ACTIVE for current ads or ALL for a wider review
  • searchType: choose exact phrase matching for focused research or unordered keyword matching for broader discovery
  • sortBy: use impressions-first ordering for volume-oriented review, or relevance ordering for recent keyword results
  • enrichDetails: enable when you want more complete creative fields and can account for extra event usage

Continue the workflow

FAQ

When should I use search instead of companyAds?

Use search when you are exploring a theme, offer, or product category. Use companyAds when you already know the advertiser page ID or a company name that should resolve to one.

When should I use adDetails?

Use adDetails when you already have a Meta Ad Library archive ID or a public Ad Library URL and want direct record lookup.

How do I choose between companyNames and companyPageIds?

companyPageIds is the more direct route when you already have the page ID. companyNames is useful when you begin with a brand name and want the Actor to resolve it first.

What if I want only current ads?

Set status to ACTIVE and keep country specific if your research focuses on one market.

Yes. Put a search link (facebook.com/ads/library/?q=...) or an advertiser link (...?view_all_page_id=...) in libraryUrls or in searchTerms. Filters in the link are applied to that link.

How do I get only new ads each day?

Turn on onlyNewAds and keep the same inputs (or the same monitorKey). Ads returned earlier are skipped and not billed; the first run returns everything.

What does the EU/UK audience record contain?

Total reach, age and gender mix by country, targeting, and payer/beneficiary, as published by Meta for ads shown in the EU and UK. Ads outside those regions may return little or nothing, and then no detail fee is charged.

How many ads can one search return?

A single keyword or page search can be followed for roughly 1,000 ads before the Ad Library's paging link becomes too long. The run then ends normally with stopReason: pagination-limit. To go further, split by startDate/endDate or by search terms; terms run in parallel.

Can I keep the output small?

Yes. Set maxResults to a tight cap, keep maxPagesPerSearch low, and leave includeRawData disabled for normal runs.

Responsible use

This Actor works with public Meta/Facebook Ad Library data only. Use the returned records in ways that fit your compliance, research, and data handling requirements. The output includes public ad URLs, creative text, platform data, and provenance fields so you can review records responsibly and preserve context when sharing or analyzing results.