Facebook Ads Library Scraper
Collect public ads from the Meta Ad Library by keyword, advertiser Page ID or Ad Library link: ad text, headline, landing page, button, images and videos, dates, platforms and version count, plus spend and reach ranges where Meta publishes them. Not affiliated with Meta.
- on apify
v0iddo/facebook-ads-library-scraper- category
- marketing, social media
- build
- 0.1.9, built 2026-11-10
- billing
- Apify bills it per result; the price for your plan is on the actor's page.
What you get
Every result is one row in the run's dataset. Download it as JSON, CSV, Excel or HTML, or read it through the Apify API.
The main fields of each row:
- Ad ID (
adArchiveId) - Advertiser (
pageName) - Active (
isActive) - Started (
startDate) - Ended (
endDate) platforms- Ad text (
body) - Headline (
title) - Button (
ctaText) - Landing page (
linkUrl) - Format (
displayFormat) - Images (
imageUrls) - Ad Library link (
adLibraryUrl)
What people use it for
- Competitor ad research: every active ad of a brand's Page, with text, headline, button and landing page.
- Creative inspiration: collect ads for a keyword with their images, videos and format.
- Ad longevity: start and end dates show which ads a brand keeps running, a sign that they work.
- Agency reporting: snapshot the ads of a client's rivals on a schedule.
Run it on Apify
- Open facebook-ads-library-scraper on Apify and sign in, or make an Apify account.
- On the Input tab, fill in the fields listed below. The form opens with example values filled in.
- Click Start. Rows appear on the Output tab while the run works.
- Export the rows as JSON, CSV, Excel, XML or HTML, or read them through the Apify API.
- To run it again on a schedule, save the input as a task and add a schedule in the Apify Console.
What you can set
- Search terms (
searchTerms): Words to search the Ad Library for, for example a brand or product name. One per line. Each term is one search; a run reads at most 25 searches (terms, Page IDs and links together). - Advertiser Page IDs (
pageIds): Numeric Facebook Page IDs of advertisers whose ads you want, one per line. Each ID is one search. The ID is the number after view_all_page_id= in an Ad Library link of that advertiser. - Ad Library links (
adLibraryUrls): Optional search links copied from the browser, such as https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=nike&search_type=keyword_unordered. A link keeps its own filters. Only Ad Library search links work. Each link is one search. - Country (
country): Where the ads were shown: a two-letter country code such as US, GB or DE, or ALL for every country. Used for search terms and Page IDs. Default:US. - Ad status (
activeStatus): Which ads to return: ads that are running now, ads that stopped, or both. Options: Active ads, Inactive ads, All ads. Default:active. - Ad category (
adType): Ad category in the Ad Library. Political and issue ads come with spend and impressions ranges. Options: All ads, Political and issue ads, Housing ads, Employment ads, Credit ads. Default:all. - Media type (
mediaType): Only ads that contain this kind of media. Options: All, Images, Videos, Memes, Text only. Default:all. - Started on or after (
startDateMin): Optional. Only ads that started running on or after this date, as YYYY-MM-DD. - Started on or before (
startDateMax): Optional. Only ads that started running on or before this date, as YYYY-MM-DD. - Ads per search (
maxAdsPerSearch): The most ads to read for each search term, Page ID or link. The Ad Library shows about 30 ads first and about 10 more each time the page loads more. At most 1000. Default:100. - Maximum results (
maxItems): The run stops after this many result rows. It also caps what one run can cost. Default:100. - Proxy configuration (
proxyConfiguration): Leave as is: the run goes through Apify residential proxy from the start, the network this site answers. Pick proxy groups here only to force another network.
Example input
This is the input the actor is tested with every day.
{
"searchTerms": [
"nike"
],
"country": "US",
"activeStatus": "active",
"maxItems": 20
}Run it from Python
The official apify-client package starts the run, waits for it and reads the rows. It needs your own Apify API token.
# pip install apify-client
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN") # your own API token, from the Apify Console
run_input = {
"searchTerms": ["nike"],
"country": "US",
"activeStatus": "active",
"maxItems": 20,
}
run = client.actor("v0iddo/facebook-ads-library-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)Limits
- Reads the public Meta Ad Library only (facebook.com/ads/library). It opens the Ad Library page in a real browser, as a visitor who is not logged in, and scrolls down so the page loads more ads. No login and no account cookies are used.
- If Meta shows a login, verification or CAPTCHA page instead of the Ad Library, the run stops and says so; it never tries to get around that.
- Not affiliated with Meta. The data is what the public Ad Library shows to a visitor who is not logged in.
- The Ad Library shows about 30 ads first and about 10 more each time the page is scrolled, so large searches take a few minutes. Each search term, Page ID or link is read up to Ads per search (at most 1000), and a run reads at most 25 searches. Ads that appear in several searches are returned once.
- Version count (collationCount) is how many copies of the same ad Meta groups together. The end date is empty for ads that still run.
- Spend, impressions and reach ranges, the country list and audience splits are filled only for ads where the Ad Library publishes them (political and issue ads, and some ads shown in the EU). For all other ads they are empty.
- Dynamic catalog ads can show placeholders such as {{product.name}} where Meta fills in a product at delivery time.
- The Paid for by disclaimer is the label Meta prints on political and issue ads. It can name the payer.
- Image and video links are temporary Meta CDN links. The actor does not download the files; download them soon if you need them.
- Ad text is returned as the advertiser wrote it, with e-mail addresses and phone numbers removed. Apart from the advertiser (Page) name and the Paid for by label, no names are published as fields. Nothing about the people who saw or reacted to an ad is collected.
- Some ad categories (housing, employment, credit) exist only for certain countries; other countries return nothing for them.
- Only publicly visible data is collected. No login, no paywalled content, no personal contact details.
- Sites change their pages from time to time. The actor is checked automatically and repaired when a check fails.
- Each run sends one short usage record to the developer: the Actor and run IDs, the number of results, whether the run succeeded (and if not, the kind of error, such as "blocked" or "input problem"), whether the account is on a paid Apify plan, how the run was started (for example from the Console, the API or a schedule) and a one-way fingerprint of the account (a hash, not the account ID), so that repeat runs of one account count once. It contains nothing from your input or results.
Questions
Do I need an account on the Meta Ad Library, cookies or an API key?
No. The actor reads only what every visitor of the Meta Ad Library can see, without logging in. You only need an Apify account to start it.
How many results can one run return?
Up to 5,000 rows per run. Without a limit it stops at 100. Set Maximum results to the number you need; large jobs can also be split into several runs or scheduled.
Why did my run return no results?
The status message of the run says why: nothing matched the input, the input was not a page the actor understands, or the site refused every network the actor tried. Check the input against the example above and run it again with a small limit.
Can I run it on a schedule?
Yes. Save your input as a task and add a schedule in the Apify Console (daily, hourly or with a cron expression). Each run gets its own dataset, so you keep a history.
Which formats can I export?
JSON, CSV, Excel, XML, HTML table and RSS from the Output tab or the API. Integrations send the rows to Google Sheets, Slack, Make, Zapier, n8n or a webhook.
This is one of the two actors that read pages a robots.txt does not open to them. Where it starts and where it stops is written on the scrapers page.
More
every fact here is read from the actor's public data on Apify, every day; it last changed on