Facebook Ad Library API: Meta Ads Scraper
Pricing
from $0.30 / 1,000 ads
Facebook Ad Library API: Meta Ads Scraper
Facebook Ad Library API without a token: export Facebook and Instagram ads from the Meta Ad Library by keyword, advertiser page or Ad Library URL. Ad text, headline, CTA, links, image and video URLs, dates, platforms. Large searches split automatically, every ad charged once.
Pricing
from $0.30 / 1,000 ads
Rating
0.0
(0)
Developer
Firsthand
Maintained by CommunityActor stats
0
Bookmarked
3
Total users
0
Monthly active users
5 hours ago
Last modified
Categories
Features
Share
Export Facebook and Instagram ads from the Meta Ad Library by keyword, by advertiser page or by an Ad Library search link. You get the ad text, headline, call to action, landing page, image and video URLs, start and end dates and platforms for every ad, as JSON, CSV or Excel.
There is no access token, no Facebook login and no developer app. The official Meta Ad Library API needs all three, and outside the EU it returns only political and issue ads. This Actor reads the public Ad Library pages that anyone can open in a browser, so it returns commercial ads in every country.
What you get
One row per ad:
adArchiveId,adLibraryUrl: the Library ID and a link to the ad in the Ad LibrarypageId,pageName,pageUrl,pageLikeCount,pageCategories: the advertiserisActive,startDate,endDate: when the ad ran; for an active adendDateis the last day the Library has seen itpublisherPlatforms: FACEBOOK, INSTAGRAM, THREADS, AUDIENCE_NETWORK, WHATSAPP, MESSENGERdisplayFormat: IMAGE, VIDEO, CAROUSEL, DCO, DPA and other formats as the Library names thembodyText,title,linkDescription,caption: the ad copylinkUrl,ctaText,ctaType: the landing page and the buttonimageUrls,videoUrls,videoPreviewImageUrls: links to the creativescards: every card of a carousel or catalog ad with its own text, link, image and videocollationId,collationCount: ads the Library groups as versions of one adimpressionsText,spend,currency,reachEstimate,targetedOrReachedCountries: filled only where Meta publishes them, mostly for political and issue ads and ads shown in the EUsearchInput,searchUrl,scrapedAt: which of your searches found the adsnapshot: the full ad record as the Library returns it, for fields not listed above
How often fields are filled, measured on 2,303 active US ads for "hiking boots" (November 2026): ad text 100%, link 99%, call to action 99%, headline 95%, image URLs 51%, video URLs 49%, carousel cards 21%, impressions text 38%. Spend and reach were empty for all of them: Meta does not publish them for commercial ads in the US.
Facebook Ads Library scraper: how to use it
- Fill in at least one of:
- Search terms: a brand, product or niche, one per line (
hiking boots,nike). Each line is a separate search. - Facebook pages: an advertiser's page URL (
https://www.facebook.com/nike), a page ID (15087023444) or an Ad Library link withview_all_page_id. You get all ads of that page. - Ad Library URLs: open facebook.com/ads/library, set the filters you want, run the search and paste the link from the address bar.
- Search terms: a brand, product or niche, one per line (
- Set Country, Ad status and the other filters for search terms and pages. A pasted Ad Library link keeps its own filters.
- Set Max ads per search, or leave it empty to get every ad the Library returns.
- Run the Actor and download the results.
Each ad appears once per run even when several of your searches find it, and you pay for it once.
Meta Ad Library search by page
A brand often has several Facebook pages, and the ads run from only one of them. The global HelloFresh page (facebook.com/hellofresh) had no ads in any country in November 2026, while US ads ran from facebook.com/HelloFreshUS. If a page returns no ads, open the brand's ads in the Ad Library and copy the page from there: the run summary (SUMMARY.perTarget) says no ads for that page, which is a real zero and not an error: the Actor checks it in two sessions before saying so.
Ads made with creators (partnership ads) are listed under the advertiser's page, with the creator's name in pageName.
Large searches
The Ad Library lists ads 10 at a time, and the further down the list, the slower and more expensive each next part gets. When a search has more than 1,500 ads and you asked for more than that, the Actor splits it by media type (images, videos, no media) and inactive ads also by date ranges, reads each part separately and removes duplicates before saving. This is automatic.
Active ads cannot be split by dates: the Library's date filter means "shown in this period", and an ad running since last year is shown in every period. So one media type of an active search is read up to about 10,000 ads; a bigger part (for example all active Nike image ads in the US, about 18,000) stops there and the run summary marks the search as not complete. Narrow such a search by country, language or platform with an Ad Library URL.
The Library's own counter ("~21,600 results") is an estimate, and for inactive ads it stops at "50,000+". The media type parts together cover 99-99.9% of the counter. In a test the Actor read 97% of the counter for "hiking boots" (2,303 of 2,369 active US ads) to the end of every part. What was read and why each search stopped is in the SUMMARY record of the run's key-value store: complete, stopReason, the number per search and per part.
Download Facebook ad library videos and images
imageUrls, videoUrls and cards hold direct links to the creative files on Facebook's servers. Download them soon after the run: the links carry a signature that expires in a few days (about four days in a November 2026 test). The Actor does not download the files itself.
Example output
{"adArchiveId": "2045879599391945","adLibraryUrl": "https://www.facebook.com/ads/library/?id=2045879599391945","pageId": "112727500143177","pageName": "Whatnot","pageUrl": "https://www.facebook.com/RealWhatnot/","pageLikeCount": 310210,"pageCategories": ["Shopping"],"isActive": true,"startDate": "2026-08-20T07:00:00Z","endDate": "2026-11-08T08:00:00Z","publisherPlatforms": ["FACEBOOK", "INSTAGRAM", "MESSENGER"],"displayFormat": "DPA","bodyText": "Titleist, Callaway, and TaylorMade clubs and apparel starting at $1 ⚡️ Live on Whatnot!","title": "Whatnot: Shop, Sell, Connect","linkUrl": "http://play.google.com/store/apps/details?id=com.whatnot_mobile","caption": "play.google.com","ctaText": "Install now","ctaType": "INSTALL_MOBILE_APP","imageUrls": ["https://scontent-phl2-1.xx.fbcdn.net/v/t39.35426-6/..."],"videoUrls": ["https://video-phl2-1.xx.fbcdn.net/o1/v/t2/f2/m366/..."],"cards": [{"title": "Whatnot", "body": "...", "linkUrl": "https://www.whatnot.com/listing/...", "ctaText": "Install Now", "imageUrl": "https://scontent-phl2-1.xx.fbcdn.net/...", "videoUrl": null}],"searchInput": "hiking boots","scrapedAt": "2026-11-08T12:08:15Z"}
Pricing
$0.45 per 1,000 ads on the Free and Bronze plans, less on higher plans:
| Apify plan | Per ad | Per 1,000 ads |
|---|---|---|
| Free, Bronze | $0.00045 | $0.45 |
| Silver | $0.0004 | $0.40 |
| Gold, Platinum, Diamond | $0.0003 | $0.30 |
Plus $0.002 per run. Duplicates are removed before you are charged, so an ad found by two of your searches costs once. Proxy and compute are included.
Set a spending limit on the run and the Actor stops before going over it.
Facebook Ad Library API without an access token
Call the Actor from your code instead of the official API:
from apify_client import ApifyClientclient = ApifyClient("<YOUR_API_TOKEN>")run = client.actor("firsthand/facebook-ad-library-api").call(run_input={"searchQueries": ["hiking boots"],"country": "US","adStatus": "active","maxAdsPerTarget": 500,})items = client.dataset(run.default_dataset_id).list_items().itemsfor ad in items:print(ad["pageName"], ad["startDate"], ad["linkUrl"])
Field names from other Ad Library Actors work here too: urls, startUrls with {"url": ...}, searchTerms, keywords, pageIds, resultsLimit, limitPerSource, maxItems, countryCode, activeStatus, mediaType, onlyAdsNewerThan.
Filters
| Input | Values | Notes |
|---|---|---|
country | Two-letter code or ALL | Empty means US |
adStatus | active, inactive, all | Empty means active |
adMediaType | all, image_and_meme, image, meme, video, none | |
dateFrom, dateTo | YYYY-MM-DD, or 30 days | The Library filters by the days an ad was shown, not by its start date: an ad running since last year is in every range up to today |
sortOrder | relevance, impressions | impressions puts the most-seen ads first |
exactPhrase | true or false | Match the whole phrase instead of all words |
For filters not listed here (platform, language, ad category), set them in the Ad Library and paste the link into Ad Library URLs.
Good to know
- What is public. The Ad Library shows ads that ran on Meta in the last years. Ad text, creatives, dates and the advertiser page are published for all ads; spend, impressions and reach mostly only for political and issue ads and for ads shown in the EU.
- Single ad links (
/ads/library/?id=...) are not accepted as input; use a search link or the page. - The counter is an estimate. A search can return a little fewer ads than the Ad Library counter shows, see
SUMMARY. - Use of the data. The Ad Library is published by Meta for transparency. Ads contain advertiser names and sometimes people's names and faces. You are responsible for how you use the data, including GDPR where it applies and Meta's terms. Nothing here is legal advice.
- Not affiliated with Meta. Facebook, Instagram and Meta are trademarks of Meta Platforms, Inc.
- Problems. Open an issue on the Issues tab with the input of the run and what you expected.