Facebook Ads Library Scraper - Meta Ad Library & Spend avatar

Facebook Ads Library Scraper - Meta Ad Library & Spend

Pricing

from $0.28 / 1,000 ads

Go to Apify Store
Facebook Ads Library Scraper - Meta Ad Library & Spend

Facebook Ads Library Scraper - Meta Ad Library & Spend

Facebook Ads Library scraper for Meta's Ad Library: ads by keyword, advertiser Page or URL with text, images, videos, carousels, dates, platforms, spend, impressions and reach. Filter by country, platform, language, media and date. No login, no cookies. $0.35 per 1,000 ads.

Pricing

from $0.28 / 1,000 ads

Rating

0.0

(0)

Developer

Social Scrapers

Social Scrapers

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 hours ago

Last modified

Features

Limited permissions

Share

This Facebook Ads Library Scraper extracts ads from Meta's public Ad Library (facebook.com/ads/library): search by keyword, by advertiser Page, or paste Ad Library URLs from your browser, and get every ad's text, headline, link and call to action, images, videos and carousel cards, start and end dates, active status and platforms, plus spend, impressions and "Paid for by" for political and issue ads. Filter by country, platform, language, media type, ad category and date, or sort by impressions. No Facebook account, no login, no cookies. It costs $0.35 per 1,000 ads.

What does Facebook Ads Library Scraper do?

  • 🔎 Three ways to search: keywords (any words or an exact phrase), advertiser Pages (a Page URL, @handle or numeric Page id), and Ad Library URLs copied from your browser.
  • 🎛️ Every Ad Library filter: country, ad category (all ads, or political and issue, housing, employment and credit ads), active status, media type (images, videos, memes, no media), platforms (Facebook, Instagram, Audience Network, Messenger, Threads, WhatsApp), ad language, the date range an ad was shown in, and sorting by impressions. Ad Library URLs keep all of their own filters too.
  • 🖼️ The whole creative: ad text, headline, description, link, caption, call-to-action button, full-size images, HD and SD video links with their preview images, and every card of carousel, catalog and dynamic-creative ads.
  • 🗳️ Political and issue ads: amount spent, impressions and estimated audience as ranges (with numeric bounds), currency, the "Paid for by" line and the contact details the advertiser submitted.
  • 🇪🇺 Optional ad details: turn on includeAdDetails for the audience of political and issue ads by age, gender and region; the reach, targeting, payer and beneficiary of ads shown in the European Union; and facts about the advertiser's Page (likes, Instagram followers, verification).
  • ♾️ No cap: collect a set number of ads per search, or every ad it lists (maxAds: 0).
  • 💸 Pay only for ads delivered: searches with no results cost nothing, and the run stops cleanly at the spending limit you set.

Because it runs on the Apify platform, you also get the API, scheduling, integrations, monitoring and proxy rotation without writing any code.

What data can you extract from the Facebook Ad Library?

One dataset item per ad. Every field is always present: null, false or an empty list means the Ad Library shows nothing for it.

FieldTypeDescription
adArchiveIdstringThe ad's Ad Library id.
adIdstring or nullFacebook's own ad id, when shown (rarely).
urlstringThe ad in the Ad Library.
pageId, pageName, pageUrlstring or nullThe advertiser's Page.
pageProfilePictureUrlstring or nullThe Page's picture.
pageLikeCountinteger or nullThe Page's likes.
pageCategoriesarrayThe Page's categories.
pageIsDeletedbooleanThe Page no longer exists.
isActivebooleanThe ad is running now.
startDate, endDatestring or nullFirst and last day shown, ISO 8601 UTC. For an active ad, endDate is the latest day it was seen running.
publisherPlatformsarrayfacebook, instagram, messenger, audience_network, threads, whatsapp, ...
displayFormatstring or nullIMAGE, VIDEO, CAROUSEL, DCO (dynamic creative), DPA (catalog ad), ...
bodystring or nullThe ad text.
title, linkDescription, captionstring or nullHeadline, description and display link. Catalog ads have these per product, in cards.
linkUrlstring or nullWhere the ad leads.
ctaText, ctaTypestring or nullThe call-to-action button (Shop now, SHOP_NOW).
imagesarrayoriginalUrl and resizedUrl of each image.
videosarrayhdUrl, sdUrl and previewImageUrl of each video.
cardsarrayCarousel, catalog and dynamic-creative cards: title, body, caption, linkUrl, linkDescription, ctaText, ctaType, image and video links.
extraTexts, extraLinks, extraImagesarrayMore variants of a dynamic-creative ad.
brandedContentobject or nullThe partner Page of a branded-content ad: pageId, pageName, pageUrl.
collationId, collationCountstring / integer or nullThe group of ads sharing this creative, and how many ads it has.
categoriesarrayUNKNOWN, POLITICAL, HOUSING, EMPLOYMENT, CREDIT.
byline, disclaimerLabelstring or nullThe "Paid for by" line of political and issue ads.
spend, impressions, reachEstimateobject or nullPolitical and issue ads: text as printed ($10K-$15K, >1M) with lowerBound and upperBound as numbers.
currencystring or nullCurrency of spend.
targetedOrReachedCountriesarrayCountries, when the Ad Library lists them.
containsSensitiveContent, containsDigitallyCreatedMediabooleanAd Library labels.
stateMediaLabelstring or nullState-controlled media label.
gatedType, hideDataStatus, isAaaEligiblestring / booleanAd Library status flags (isAaaEligible: the ad carries EU transparency data).
advertiserContactobject or nullPolitical and issue ads: phone, email, website, address and submittedOn as the advertiser submitted them.
detailsobject or nullWith includeAdDetails: ageGenderDistribution, regionDistribution (shares as fractions of 1), euTransparency (totalReach, targeted ages, gender and locations, reachByCountryAgeGender), payerBeneficiaries, and advertiser (handle, category, likes, verification, Instagram username and followers).
input, inputTypestringThe search term, Page or URL the ad came from, and which list it was in.
scrapedAtstringWhen the ad was read, ISO 8601 UTC.

How to scrape the Facebook Ad Library

  1. Click Try for free (or Start) on this page.
  2. Add search terms (for example running shoes), advertiser Pages (https://www.facebook.com/<page-name>), or Ad Library URLs copied from facebook.com/ads/library.
  3. Pick the filters you need: country, active status, platforms, languages, media type, dates, sort order.
  4. Set Max ads per search (0 for every ad) and click Start. Each search reads about 300 ads a minute.
  5. Download the ads from the Output tab as JSON, CSV, Excel or HTML, or read them through the API.

How much does it cost to scrape Facebook ads?

$0.35 per 1,000 ads, platform usage and proxies included, with or without includeAdDetails. You pay one ad event for each ad saved, nothing else:

Your Apify planPrice per 1,000 ads
Free and Starter (Bronze)$0.35
Scale (Silver)$0.315 (−10%)
Business (Gold)$0.28 (−20%)

Two examples:

  • 1,000 ads for one keyword = $0.35.
  • Every active ad of 10 competitors, about 2,000 ads = $0.70.

Searches with no results, and Pages that cannot be found, cost nothing. To cap a run's cost, set Maximum cost per run in the run options: the scraper stops cleanly once it is reached and keeps everything scraped so far. Apify's free plan comes with monthly usage credit, enough to try this scraper on thousands of ads.

Input example

Give at least one of searchTerms, pageUrls or adLibraryUrls.

{
"searchTerms": ["running shoes", "meal kit"],
"pageUrls": ["https://www.facebook.com/<page-name>"],
"adLibraryUrls": [
"https://www.facebook.com/ads/library/?active_status=all&ad_type=political_and_issue_ads&country=US&media_type=all&q=climate&search_type=keyword_unordered"
],
"country": "US",
"activeStatus": "active",
"mediaType": "all",
"platforms": ["instagram"],
"languages": ["en"],
"sortBy": "impressions_high",
"dateFrom": "30 days",
"maxAds": 1000,
"includeAdDetails": false,
"proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
FieldTypeDescription
searchTermsarray of stringsKeywords, one search per term, as typed into the Ad Library search box.
pageUrlsarray of stringsAdvertiser Pages: https://www.facebook.com/<page-name>, an @handle, or the numeric Page id (the view_all_page_id of an Ad Library link). Share links from the Facebook app (https://www.facebook.com/share/…, fb.me/…) and links to one of the Page's posts work too.
adLibraryUrlsarray of stringsSearches copied from the address bar on facebook.com/ads/library. All their filters are kept; a link to one ad (?id=...) returns that ad.
countrystring, default ALLWhere the ads were shown: a two-letter code such as US, GB or DE, or ALL.
adTypestring, default allall, political_and_issue_ads, housing_ads, employment_ads or credit_ads.
activeStatusstring, default activeactive, inactive or all.
mediaTypestring, default allall, image, video, meme, image_and_meme or none.
exactPhraseboolean, default falseMatch search terms as an exact phrase.
dateFrom, dateTostring, optionalOnly ads shown between these days: a date (2026-01-31, 2026-1-31, 31/01/2026, Jan 31 2026) or an age (30 days, 2w, 3 months, yesterday). With both day and month 12 or less (01/02/2026) the date is read month/day/year. An ad that started earlier but still ran in the range is included, as in the Ad Library.
platformsarray, optionalOnly ads shown on these platforms: facebook, instagram, audience_network, messenger, threads, whatsapp. Empty = all.
languagesarray, optionalOnly ads in these languages: two-letter codes such as en, es, de. Empty = all.
sortBystring, default defaultdefault (the Ad Library's order), impressions_high or impressions_low.
maxAdsinteger, default 100Ads to collect for each search term, Page and URL. 0 = every ad the search lists.
includeAdDetailsboolean, default falseAdd each ad's details (audience breakdowns, EU transparency, advertiser facts). Slower; same price per ad.
proxyConfigurationobject, default Apify Proxy RESIDENTIALProxy settings. Keep the residential default.

The filters (country to sortBy) apply to search terms and Pages. An Ad Library URL keeps its own filters and takes from these fields only what it does not set.

Output example

A real item from a test run, with names, texts, links and ids replaced by placeholders and long media links shortened:

{
"adArchiveId": "<ad-id>",
"adId": null,
"url": "https://www.facebook.com/ads/library/?id=<ad-id>",
"pageId": "<page-id>",
"pageName": "<advertiser name>",
"pageUrl": "https://www.facebook.com/<page-name>/",
"pageProfilePictureUrl": "https://scontent.xx.fbcdn.net/v/<image-path>.jpg?<signed-parameters>",
"pageLikeCount": 3400,
"pageCategories": ["Community Center"],
"pageIsDeleted": false,
"isActive": true,
"startDate": "2026-06-01T07:00:00.000Z",
"endDate": "2026-11-07T08:00:00.000Z",
"publisherPlatforms": ["facebook", "instagram"],
"displayFormat": "IMAGE",
"body": "<ad text>",
"title": "<headline>",
"caption": "<shop-domain>",
"linkUrl": "https://<shop-domain>/<landing-page>",
"linkDescription": "<link description>",
"ctaText": "Learn more",
"ctaType": "LEARN_MORE",
"images": [
{
"originalUrl": "https://scontent.xx.fbcdn.net/v/<image-path>.jpg?<signed-parameters>",
"resizedUrl": "https://scontent.xx.fbcdn.net/v/<image-path>.jpg?stp=dst-jpg_s600x600&<signed-parameters>"
}
],
"videos": [],
"cards": [],
"extraTexts": [],
"extraLinks": [],
"extraImages": [],
"brandedContent": null,
"collationId": "<group-id>",
"collationCount": 1,
"categories": ["UNKNOWN"],
"byline": null,
"disclaimerLabel": null,
"spend": null,
"currency": null,
"impressions": null,
"reachEstimate": null,
"targetedOrReachedCountries": [],
"containsSensitiveContent": false,
"containsDigitallyCreatedMedia": false,
"stateMediaLabel": null,
"gatedType": "ELIGIBLE",
"hideDataStatus": "NONE",
"isAaaEligible": true,
"advertiserContact": null,
"details": null,
"input": "running shoes",
"inputType": "searchTerm",
"scrapedAt": "2026-11-08T02:19:21.282Z"
}

A political ad carries its spend and reach, and with includeAdDetails its audience:

{
"categories": ["POLITICAL"],
"byline": "<paid for by>",
"disclaimerLabel": "PAID_FOR_BY",
"spend": { "text": "€7K-€8K", "lowerBound": 7000, "upperBound": 8000 },
"currency": "EUR",
"impressions": { "text": ">1M", "lowerBound": 1000000, "upperBound": null },
"reachEstimate": { "text": ">1M", "lowerBound": 1000000, "upperBound": null },
"advertiserContact": { "phone": "<phone>", "email": "<email>", "website": "<website>", "address": "<city, region>", "submittedOn": "Submitted on 30 Mar 2022" },
"details": {
"ageGenderDistribution": [
{ "ageRange": "18-24", "female": 0.13, "male": 0.4, "unknown": 0 },
{ "ageRange": "25-34", "female": 0.04, "male": 0.21, "unknown": 0 }
],
"regionDistribution": [
{ "region": "Uttar Pradesh", "share": 0.11 },
{ "region": "Maharashtra", "share": 0.09 }
],
"euTransparency": null,
"payerBeneficiaries": [],
"advertiser": { "pageAlias": "<handle>", "pageCategory": "Organisation", "pageLikes": 1250000, "pageVerification": "BLUE_VERIFIED", "entityType": "PERSON_PROFILE", "about": "<about text>", "profilePhotoUrl": "<image link>", "coverPhotoUrl": "<image link>", "instagramUsername": "<handle>", "instagramFollowers": 830000, "instagramVerified": true }
}
}

Use cases

  • Competitor ad research: see every ad a competitor is running right now, in which countries and on which platforms, and how long each one has been live.
  • Creative inspiration: collect hooks, headlines, calls to action, images and videos that work in your niche, and study long-running ads (the ones advertisers keep paying for).
  • Market and trend monitoring: run a search on a schedule and track which new ads appear for a keyword or a set of advertisers.
  • Political ad transparency: follow spend, reach and audience of ads about social issues, elections or politics, by advertiser or topic.
  • Datasets: gather ad copy and media for analysis, classification or training data.

Use Facebook Ads Library Scraper via API, Python, JavaScript and integrations

Run the scraper from your own code with the Apify API or an Apify client:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'MY-APIFY-TOKEN' });
const run = await client.actor('socialscrapers/facebook-ads-library-scraper').call({
searchTerms: ['running shoes'],
country: 'US',
maxAds: 1000,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
from apify_client import ApifyClient
client = ApifyClient("MY-APIFY-TOKEN")
run = client.actor("socialscrapers/facebook-ads-library-scraper").call(
run_input={"searchTerms": ["running shoes"], "country": "US", "maxAds": 1000}
)
for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
print(ad["pageName"], ad["startDate"], ad["body"])
  • Schedules: run a search every day and track which new ads appear for a keyword or a set of advertisers.
  • Integrations: send the ads to Google Sheets, Slack, Airtable, Make, Zapier or n8n, or trigger your own webhook when a run finishes.
  • AI agents: call the scraper as a tool through the Apify MCP server.

Limits

  • What the Ad Library shows logged out. Spend, impressions and audience data exist only for political and issue ads (and EU transparency data for ads shown in the EU); other ads show their creative, dates and platforms.
  • Some ads hide their creative from logged-out visitors. About 3% of ads in our tests have gatedType LOGGED_OUT: they come with their advertiser, text, dates and platforms, but without images, videos or a headline.
  • Each search stands alone. An ad that matches several of your searches is returned once for each of them; input says which.
  • One country per search. The Ad Library searches one country, or all of them. Run one search per country to compare countries.
  • Ads sharing a creative. The Ad Library groups ads that share a creative and lists one or a few of them; collationCount says how many ads the group has.
  • Media links expire. Image and video links point to Facebook's CDN, which expires them after some days. Download media promptly if you need it.
  • Residential proxy recommended. Facebook refuses many data-center IP addresses, so keep the default Apify Proxy RESIDENTIAL setting.
  • Share links work for Pages. A share link from the Facebook app (https://www.facebook.com/share/…, fb.me/…) or a link to one of a Page's posts is followed to the Page, at no charge.

FAQ

The Ad Library is a public transparency tool that Meta shows to anyone, logged in or not, and this scraper only reads what it shows to logged-out visitors. Political ads can include personal data of the people behind them, which laws such as the GDPR protect, so collect only what you need for a legitimate purpose. Apify explains the basics in Is web scraping legal?.

Do I need a Facebook account or cookies?

No. The Actor reads only what the Ad Library shows to visitors who are not logged in.

How do I scrape exactly the search I see in my browser?

Set up the search on facebook.com/ads/library, copy the address bar, and paste it into adLibraryUrls. Every filter in it is kept.

Why did I get fewer ads than maxAds?

The search has fewer results, or the run reached its maximum total charge. The run log says which, for each search.

Why did my run finish with no ads?

No ad matched the search and its filters, the Page was not found, or Facebook refused the requests even after 5 attempts on fresh IPs. The run still ends Succeeded, its status message says which, and nothing is charged. A run ends Failed only when Facebook refused every one of 3 or more searches (the scraper is then being blocked) or could not read any of the searches at all.

What do the dates filter?

dateFrom and dateTo keep ads that were shown at some point between those days, the Ad Library's own date filter. An ad that started a year ago and still runs is included.

How fast is it?

Each search reads about 300 ads a minute, and up to 8 searches run side by side: in our tests, 300 ads from three searches took 25 seconds and 1,000 ads from one search about 3.5 minutes. includeAdDetails adds one request per ad.

Can I get spend and impressions for all ads?

The Ad Library publishes them only for ads about social issues, elections or politics. For ads shown in the EU, includeAdDetails adds the reach and targeting the EU requires.

Can I run it on a schedule or from my own code?

Yes. Use Apify schedules, the Apify API and client libraries, webhooks, or integrations such as Make, Zapier or n8n.

Other scrapers by Social Scrapers

ScraperWhat it gets
Facebook Pages ScraperPublic details of Facebook Pages and profiles: contact info, address, rating
Facebook Posts ScraperPosts from Facebook profiles and Pages
Facebook Groups ScraperPosts from public Facebook groups
Instagram Profile ScraperInstagram profiles and their latest posts
Instagram Post ScraperInstagram posts, reels and comments
Threads ScraperThreads profiles, posts and replies
X (Twitter) Profile ScraperX profiles: bio, followers, counts
Reddit ScraperReddit posts, comments, users and search
Quora ScraperQuora questions, answers and profiles
YouTube ScraperYouTube videos, channels, search and comments
YouTube Transcript ScraperTranscripts and captions of YouTube videos
LinkedIn Jobs ScraperLinkedIn job listings