Facebook Ads Library Scraper avatar

Facebook Ads Library Scraper

Pricing

from $4.99 / 1,000 results

Go to Apify Store
Facebook Ads Library Scraper

Facebook Ads Library Scraper

Facebook Ads Library Scraper extracts ads from the Facebook Ads Library with full details. Capture creatives, copy, spend ranges, impressions, targeting data, advertiser info, and timestamps. Ideal for competitor research, campaign analysis, and structured ad intelligence workflows.

Pricing

from $4.99 / 1,000 results

Rating

5.0

(2)

Developer

API Empire

API Empire

Maintained by Community

Actor stats

1

Bookmarked

93

Total users

13

Monthly active users

17 days ago

Last modified

Share

Facebook Ads Library Scraper — Extract Ads, Creatives and Pages

Facebook Ads Library Scraper pulls structured data straight from Meta's public Ad Library: every matching ad, its creative (images, video, carousel cards, copy), and the advertiser's page context, in one run. Point it at a Facebook Page URL or an Ad Library search link and it returns typed, normalized JSON — no HTML, no selectors, no login required. Filter by country, activity status, and time window, or switch to count-only mode for a fast audit. After reading this, you'll know exactly which fields you get and how to wire them into a script, dashboard, or agent.

What is Facebook Ads Library Scraper?

Facebook Ads Library Scraper is an Apify Actor that scrapes Meta's public Ad Library — the ad-transparency archive Meta operates for Facebook, Instagram, Messenger, and Audience Network. It runs fully logged out: no Facebook account, password, or session cookie is required. Give it a Page URL or an Ad Library search link and it returns one structured record per ad, enriched with the advertiser's page context and, optionally, a deeper per-ad details lookup.

  • Scrape ads — creative, timing, status, and platform placement for any Page or search
  • Scrape ad creative/media — body text, title, CTA, link, images, video, and carousel cards
  • Scrape advertiser page info — page name, ID, categories, like count, and an optional "about" snippet
  • Export as JSON, CSV, or Excel through the Apify dataset
  • No proxy setup required — residential routing is handled for you when you turn it on

What data does Facebook Ads Library Scraper collect?

Every run returns three kinds of data in the same dataset row — the ad itself, its creative/media, and the advertiser's page context — plus transparency fields Meta discloses only for political and issue ads.

Data TypeKey FieldsJSON Field Names
Adsarchive ID, run dates, active status, platforms, variant countadArchiveID, startDateFormatted, endDateFormatted, isActive, publisherPlatform, collationCount
Ad creative / mediabody text, title, CTA, link URL, images, video, carousel cardssnapshot.body, snapshot.title, snapshot.ctaText, snapshot.linkUrl, snapshot.images, snapshot.videos, snapshot.cards
Advertiser / page infopage name, ID, URL, about text, categories, like countpageInfo.page.name, pageInfo.page.id, pageInfo.page.url, pageInfo.page.about, snapshot.pageCategories, snapshot.pageLikeCount
Transparency data (political/issue ads only)reach estimate, spend range, currency, impressions bucketreachEstimate, spend, currency, impressionsWithIndex

Need more Facebook data?

Pair this with Facebook Page Posts Scraper if you also want a brand's organic content — text, media previews, and engagement signals — alongside its paid activity. If you need the actual image assets a page has posted rather than its ads, Facebook Photos Scraper pulls direct photo URLs, permalinks, and Facebook's own accessibility captions.

How does Facebook Ads Library Scraper differ from the official Facebook API?

Meta operates the Ad Library API as the official, public route into this same ad-transparency data. It requires a Meta developer account and app review, plus identity verification before Meta grants access to political and issue ad data; once approved, it returns a documented set of fields that you page through yourself. Facebook Ads Library Scraper requires none of that setup — paste a source URL and run.

FeatureMeta Ad Library APIFacebook Ads Library Scraper
Access requirementMeta developer account, app review, identity verification for political/issue adsNo Facebook login or developer account needed
Setup timeApp registration and review before your first callPaste a source URL and start the run
Entity coverageAds only, via the endpoints Meta documentsAds, ad creative/media, and advertiser page context in one dataset row
Political/issue ad fieldsSpend, reach, and impressions available where Meta discloses themSame Meta-side restriction — spend, reachEstimate, and impressionsWithIndex are populated only for political/issue ads, null otherwise
Output handlingRaw API JSON; pagination and field mapping are your responsibilityAuto-paginated dataset, ready for JSON, CSV, or Excel export
Volume controlGoverned by Meta's API access termsControlled by your own resultsLimit and Apify plan

Use the Meta Ad Library API directly if you're building inside Meta's own developer ecosystem and can clear its review process. Use Facebook Ads Library Scraper when you want the same public ad data without an app-review cycle, already normalized into one row per ad.

Why do developers and teams scrape Facebook Ads Library?

For marketers and brand teams

Ad-strategy and brand teams use Facebook Ads Library Scraper to see exactly what a competitor is running right now — which creatives, on which platforms (publisherPlatform), for how long (totalActiveTime), and how many variants (collationCount). Point the Actor at a competitor's Page URL, pull every active and inactive ad, and compare messaging, CTAs (snapshot.ctaText), and creative formats over a chosen period. Because the data comes back as one normalized row per ad, teams can drop it straight into a spreadsheet or dashboard instead of manually paging through the public Ad Library screen by screen.

For AI engineers and agent builders

AI and agent teams use the Actor to feed ad creative text and metadata into RAG pipelines and creative-analysis agents. Each ad arrives as typed JSON — snapshot.body, snapshot.title, snapshot.cards, adArchiveID — with no HTML to strip and no selectors to maintain, so it can be embedded, indexed, or passed straight into an LLM context window. A common workflow: run the Actor against a set of advertiser Pages on a schedule, chunk snapshot.body and snapshot.caption text per ad, and index it into a vector store for a competitive-intelligence chat agent.

For researchers and analysts

Academic and policy researchers use the public Ad Library to study political and issue-ad spend, targeting, and messaging. Facebook Ads Library Scraper collects only what Meta already publishes for transparency — spend, reachEstimate, targetedOrReachedCountries, and regionalRegulationData where Meta discloses them for political/issue ads — and returns it as structured rows instead of one-by-one manual archive lookups. That makes it practical to build a dataset across many advertiser pages or a country/keyword search, rather than reading the Ad Library UI one entity at a time.

For developers building data products

Developers build monitoring dashboards, alerting tools, and ad-intelligence products on top of scheduled Actor runs: track a list of advertiser Pages, diff new adArchiveID values against a stored dataset, and surface newly launched creatives to a client-facing product. Because a single run accepts both Page URLs and Ad Library search links in the same startUrls list, one scheduled job can cover keyword-based discovery and named-competitor tracking together, with resultsLimit keeping each run's volume predictable for cost and storage planning.

How to scrape Facebook (step by step)

  1. Open Facebook Ads Library Scraper on its Apify Store listing (Actor ID facebook-ads-library-scraper-pay-per-events).
  2. Add one or more sources to startUrls — a Facebook Page URL (all of that advertiser's ads) or an Ad Library search link (keyword/country query).
  3. Set countryCode, activeStatus, and period to scope the run, and resultsLimit to cap the total number of ads returned.
  4. Start the run — no login, cookies, or session setup are required.
  5. Open the run's dataset and export the results as JSON, CSV, or Excel, or pull them through the Apify API.

What to do when Facebook changes its structure

Facebook Ads Library Scraper is maintained, and its output schema is designed to stay stable — the same field names and types keep working in your integration even when Meta changes the Ad Library's underlying internals. No action is required on your end when that happens.

⬇️ Input

Configure the run in the Apify Console UI or pass an INPUT.json. No field is required — an empty input still runs against the prefilled example sources.

ParameterRequiredTypeDescriptionExample Value
startUrlsNoarrayFacebook Page URLs or Ad Library links, one source per entry. Plain strings, or objects with a url field (and optional label, limit, period).["https://www.facebook.com/SHEINOFFICIAL"]
resultsLimitNointegerUpper bound on ads returned across all sources in the run. Min 1, max 50000. Default 10.20
onlyTotalNobooleanInstead of one row per ad, output one summary row per source with a total count. Default false.false
includeAboutPageNobooleanFor Facebook Page sources, attach a lightweight public title/description "about" snippet. Default false.true
isDetailsPerAdNobooleanRun an additional per-ad lookup for richer metadata (more complete rows, slower run). Default true.true
countryCodeNostring (enum)Default country for Page sources (ALL or an ISO code such as US, GB, DE). Ad Library links usually carry their own country. Default ALL."US"
periodNostringOptional time window when the source URL doesn't specify one. Absolute date (YYYY-MM-DD) or relative span (7 days, 1 month, 1 year). Empty follows the library's own default."30 days"
activeStatusNostring (enum)Filter for Page sources, or when a search link leaves it unspecified: all, active, inactive. Default all."active"
proxyConfigurationNoobjectOptional Apify Proxy. When enabled, the whole run uses residential endpoints only. Requires proxy access on your Apify plan.{"useApifyProxy": true}
{
"startUrls": [
"https://www.facebook.com/SHEINOFFICIAL",
"https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&search_type=keyword_unordered&q=shoes"
],
"resultsLimit": 20,
"onlyTotal": false,
"includeAboutPage": true,
"isDetailsPerAd": true,
"countryCode": "US",
"period": "30 days",
"activeStatus": "active",
"proxyConfiguration": { "useApifyProxy": true }
}

resultsLimit caps ads across all sources combined, not per source — to cap one source individually, set a limit (and optionally its own period) on that entry's object inside startUrls instead of relying on the global default.

⬆️ Output

Every ad is written to the run's default dataset as one typed JSON object — no HTML, no re-parsing. Export it as JSON, CSV, or Excel from the Apify Console, or read it through the Apify API. This Actor is priced pay-per-result: you're charged per ad row actually written to the dataset.

Scraped ad

{
"inputUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&is_targeted_country=false&media_type=all&search_type=page&sort_data[direction]=desc&sort_data[mode]=total_impressions&view_all_page_id=15087023444",
"pageID": "15087023444",
"pageId": "15087023444",
"adArchiveID": "1234567890123456",
"adArchiveId": "1234567890123456",
"adId": null,
"startDate": 1748736000,
"endDate": 1751328000,
"startDateFormatted": "2025-06-01T00:00:00.000Z",
"endDateFormatted": "2025-07-01T00:00:00.000Z",
"isActive": true,
"totalActiveTime": 2592000,
"publisherPlatform": ["FACEBOOK", "INSTAGRAM"],
"collationCount": 3,
"collationId": "9876543210",
"categories": [],
"gatedType": null,
"hideDataStatus": null,
"isAaaEligible": false,
"containsSensitiveContent": false,
"containsDigitalCreatedMedia": false,
"hasUserReported": false,
"reportCount": null,
"menuItems": [],
"stateMediaRunLabel": null,
"pageIsDeleted": false,
"pageName": "SHEIN Official",
"reachEstimate": null,
"spend": null,
"currency": "",
"impressionsWithIndex": { "impressionsText": null, "impressionsIndex": -1 },
"targetedOrReachedCountries": [],
"regionalRegulationData": {},
"fevInfo": null,
"snapshot": {
"pageId": "15087023444",
"pageName": "SHEIN Official",
"title": "SHEIN Official",
"body": { "text": "Up to 70% off summer styles — shop the new drop." },
"caption": "shein.com",
"ctaText": "Shop Now",
"ctaType": "SHOP_NOW",
"linkUrl": "https://shein.com/campaign/summer",
"linkDescription": "Free shipping on orders over $49",
"displayFormat": "IMAGE",
"images": [{ "url": "https://scontent.xx.fbcdn.net/v/creative_123.jpg" }],
"videos": [],
"cards": [],
"pageCategories": ["Clothing (Brand)"],
"pageLikeCount": 28500000,
"countryIsoCode": "US"
},
"pageInfo": {
"page": {
"name": "SHEIN Official",
"id": "15087023444",
"url": "https://www.facebook.com/SHEINOFFICIAL",
"about": { "text": "Global online fashion retailer." }
},
"adLibraryPageInfo": {
"pageInfo": { "hasBlankAds": false, "hiddenAds": 0, "pageIsDeleted": false }
}
}
}

Total-only summary row

When onlyTotal is enabled, each source produces one row like this instead of one row per ad:

{
"sourceUrl": "https://www.facebook.com/SHEINOFFICIAL",
"label": "Source 1",
"totalAdsCount": 842,
"aboutPage": { "url": "https://www.facebook.com/SHEINOFFICIAL", "title": "SHEIN Official", "description": "Global online fashion retailer." }
}

aboutPage only appears when includeAboutPage is also enabled.

How many results can you scrape with Facebook Ads Library Scraper?

There is no absolute cap beyond what you configure: resultsLimit accepts up to 50,000 ads per run (default 10), applied across all sources combined, and each source can also set its own per-entry limit. Pagination is automatic through the Ad Library's cursor-based results — the Actor requests pages sized up to 30 ads at a time and keeps following the cursor until it runs out of results or hits your limit. When a period time window is set, the Actor caps scanning at 40 listing pages per source as a safety valve for filters that match almost nothing. No benchmark run time is published, since actual duration depends on your limit, filters, and whether isDetailsPerAd enrichment is on.

Integrate Facebook Ads Library Scraper and automate your workflow

Facebook Ads Library Scraper works with any language or tool that can send an HTTP request.

REST API integration

import requests
ACTOR_ID = "facebook-ads-library-scraper-pay-per-events"
TOKEN = "<YOUR_APIFY_TOKEN>"
run_input = {
"startUrls": ["https://www.facebook.com/SHEINOFFICIAL"],
"resultsLimit": 20,
}
resp = requests.post(
f"https://api.apify.com/v2/acts/{ACTOR_ID}/run-sync-get-dataset-items",
params={"token": TOKEN},
json=run_input,
)
ads = resp.json()
print(f"Collected {len(ads)} ads")

Works in Python, Node.js, Go, Ruby, cURL.

Automation platforms (n8n, Make)

Both n8n and Make offer a general-purpose Apify integration (a "Run an Actor and get dataset items" node/module) that calls any Actor by its ID. Point it at facebook-ads-library-scraper-pay-per-events, pass the same startUrls, resultsLimit, and filter fields as JSON input, and route the returned ad rows straight into a spreadsheet, database, or Slack alert — no custom code required.

Yes — scraping Meta's Ad Library is legal when you collect only the public data Meta already publishes for transparency, and Facebook Ads Library Scraper does exactly that: it does not log in, does not access private accounts, and returns only what the public Ad Library page shows. Most of what it collects is business/advertiser data — page names, ad creatives, spend and reach disclosures — which sits under Meta's Terms of Service rather than personal-data law. Some fields, such as an individual's name on a personal-brand or political advertiser page, can constitute personal data under GDPR or CCPA, so you need a lawful basis before storing or reusing that data in bulk. Consult legal counsel for commercial use cases involving bulk personal data.

Frequently asked questions

Does Facebook Ads Library Scraper work without a Facebook account?

Yes. The Actor runs fully logged out against the public Ad Library — no Facebook account, password, or session cookie is required.

How often is the scraped data updated?

Every run fetches live data directly from the Ad Library at the time it runs; nothing is served from a cache.

What happens if a Page can't be found or a search returns no ads?

If a Page URL can't be resolved to a page ID, the Actor logs an error for that source and continues with the others rather than failing the whole run. If a source matches zero ads, it simply contributes no rows to the dataset.

Can I scrape non-public or restricted Facebook Ad Library content?

No. The Actor only returns what Meta's public Ad Library page already shows for a given Page or search. Ads that Meta has fully removed from its archive, or content that sits behind a logged-in personal profile, are not accessible.

Does Facebook Ads Library Scraper work for AI agent workflows and LLM pipelines?

Yes. It's callable as an HTTP endpoint from any agent framework. Every response is typed JSON with stable field names — no parsing step before passing it to an LLM.

How does Facebook Ads Library Scraper handle Facebook's anti-bot system?

It presents a real Chrome TLS/JA3 fingerprint (via curl_cffi Chrome impersonation) to seed guest cookies, automatically solves Meta's JS bot-challenge when served, and escalates from a direct connection to Apify residential proxy if the Ad Library blocks the request — all without you managing any of it.

Does Facebook Ads Library Scraper return data in a format LLMs can use directly?

Yes. Typed, normalized JSON with stable field names — no HTML, no selectors. Pass it directly into an LLM context window, index it into a vector store, or route it through an agent tool.

Can I use Facebook Ads Library Scraper without managing proxies?

Yes. By default the Actor connects directly and only escalates to proxy routing on its own if Facebook blocks the request. Turning on proxyConfiguration opts into residential-only routing from the first request, which requires proxy access on your Apify plan.

Why are spend and reachEstimate sometimes empty?

Because Meta itself only discloses spend, reach, and impressions data for political and issue ads. On ordinary commercial ads, the Actor returns null/empty values for these fields rather than fabricating them.

Can I search by keyword and country, or scrape one specific advertiser?

Both, in the same run. Paste a Facebook Page URL to pull one advertiser's ads, or an Ad Library search link (with q=, country=, and other query parameters) to run a keyword/country search — mix both types in the same startUrls list.

What happens when Facebook changes its structure or blocks the scraper?

Facebook Ads Library Scraper is maintained, and its output schema is designed to stay stable — field names and types don't change on your end when Meta updates the Ad Library internally.

Your feedback

Found a bug or missing a field? We want to know. Report it through the Actor's Issues tab on Apify Console, or reach out via API-Empire's Apify Store support channel — active maintenance is how this Actor stays reliable as Meta's Ad Library evolves.