Facebook Ads Library API & Instagram Ads Scraper
Pricing
$4.00 / 1,000 results
Facebook Ads Library API & Instagram Ads Scraper
Unofficial Facebook Ads Library API: search Facebook and Instagram ads by keyword, Page ID or Ad Library URL, and get ad copy, images, videos, CTAs, landing pages and dates as JSON or CSV. Date range filter, exact ad limits, fast HTTP scraping. No Meta token or login.
Pricing
$4.00 / 1,000 results
Rating
0.0
(0)
Developer
Anas Nadeem
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 hours ago
Last modified
Categories
Features
Share
Facebook Ads Library API for Facebook and Instagram ads: search the Meta Ad Library by keyword, Facebook Page ID, or a pasted Ad Library URL, and get every ad back as structured JSON or CSV. Each row has the ad copy, headline, call to action, landing page, image and video URLs, advertiser, dates, and platforms. Filter by country, ad status, media type, and date range, and set an exact limit on how many ads you get.
No Meta developer account, access token, identity verification, or Facebook login. Call it from your code through the Apify API, from an AI agent through MCP, or run it from Apify Console. This is an independent scraper of the public Ad Library website, not Meta's official Ad Library API.
Why use this Facebook Ads Library API
- ⚡ Fast: it reads Meta's search API over plain HTTP, with no headless browser and no page scrolling. In our November 2026 cloud tests, 31 ads typically took about 11 seconds and 150 ads took 26 to 51 seconds.
- 🔎 Three ways to search: a keyword, a numeric Facebook Page ID, or any Ad Library search URL pasted from your browser. Tracking parameters such as
fbclidare ignored instead of failing the run. - 📅 Date range filter: keep only ads that ran between two dates.
- 🖼️ Complete creatives: ad text, headlines, CTAs, landing pages, images, videos with preview images, and every version of carousel, dynamic creative, and catalog ads.
- 🤝 Partnership ads labeled: branded-content ads name the creator separately from the advertiser.
- 🎯 Exact limits:
maxAds: 100delivers at most 100 unique ads, one row per ad, with duplicates removed. - 💾 Saved as it goes: results are written page by page, so partial results are kept and an interrupted run can continue.
- 📊 Instagram ads too: the
platformsfield shows where each ad ran: Facebook, Instagram, Messenger, Audience Network, Threads, or WhatsApp.
How to scrape Facebook ads
- Enter one search source: Search keyword, Facebook Page ID, or Ad Library search URL.
- Set Maximum ads. Start with 100; increase it when you need a larger sample.
- For a keyword or Page ID, choose the country, ad status, media type, and an optional date range. A pasted URL keeps its own filters.
- Click Start, then open the run's dataset to view the ads or export them as JSON, CSV, or Excel.
A fresh form contains a one-ad nike example with Residential proxies enabled. A Page ID or URL you enter automatically overrides the example keyword. One run handles one search; to follow several brands, save one task per brand and schedule them.
Input examples
Search ads by keyword
Find up to 100 active ads that match "dinosaur" in the United States:
{"searchQuery": "dinosaur","country": "US","activeStatus": "active","maxAds": 100}
Export a competitor's Facebook Page ads
Collect up to 100 active Burger King ads shown in the United States:
{"pageId": "134615383218473","country": "US","activeStatus": "active","maxAds": 100}
The Page ID is the number after view_all_page_id= in the advertiser's Ad Library URL. To find it from a brand name, use our Meta Ad Library Brand Search & Page ID Finder. Ordinary Facebook Page URLs are not accepted as targetUrl.
Find ads that ran in a date range
Add dateFrom and/or dateTo (YYYY-MM-DD) to a keyword or Page ID search. This is Meta's own Ad Library date filter: it matches ads that ran at some point in the range, so an ad that started earlier but was still running is included.
{"pageId": "134615383218473","country": "US","dateFrom": "2026-11-01","dateTo": "2026-11-10","maxAds": 100}
Paste an Ad Library search URL
Copy a search from the Ad Library in your browser to keep its country, status, platform, language, sort, and date filters. This one searches Boat's active ads in India:
{"targetUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=IN&media_type=all&search_type=page&view_all_page_id=786827864757998&sort_data[mode]=total_impressions&sort_data[direction]=desc","maxAds": 100}
Output example
One ad from the Burger King Page search above, as returned on November 20, 2026. Long media links are shortened here.
{"libraryID": "2426205064851511","adLibraryUrl": "https://www.facebook.com/ads/library/?id=2426205064851511","pageId": "134615383218473","brand": "Burger King","brandLogo": "https://scontent-lax3-1.xx.fbcdn.net/v/t39.35426-6/…","collaboratorName": null,"collaboratorPageId": null,"collaboratorLogo": null,"active": true,"body": "We're giving BK a glow up!","linkTitle": "Meet the new Burger King","linkDescription": "","linkUrl": "https://burgerking.app.link/wtlXQwl6O7b","ctaText": "Order now","ctaUrl": "https://burgerking.app.link/wtlXQwl6O7b","platforms": ["FACEBOOK", "INSTAGRAM"],"totalPlatforms": 2,"similarAdCount": 2,"multipleVersions": false,"images": [],"videos": [{"url": "https://video-lax3-2.xx.fbcdn.net/o1/v/t2/f2/m366/…","duration": null,"poster": "https://scontent-lax3-2.xx.fbcdn.net/v/t39.35426-6/…"}],"cards": [],"startDate": "2026-11-16T08:00:00.000Z","endDate": null,"runningTAT": 3,"format": "video","sourceUrl": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&media_type=all&search_type=page&view_all_page_id=134615383218473","scrapeDate": "2026-11-20T00:30:42.954Z"}
Input reference
Provide searchQuery, pageId, or targetUrl. If several are filled in, targetUrl wins, then pageId, then searchQuery, so you can enter a Page ID or URL without clearing the example keyword.
| Input | Default | Description |
|---|---|---|
searchQuery | - | Keyword search, up to 500 characters. |
pageId | - | Numeric Facebook Page ID, supplied as a string. |
targetUrl | - | Full HTTPS Ad Library search URL. Its filters take precedence over the form's country, status, media, and date settings. |
maxAds | 100 via API; 1 in a fresh form | Maximum unique ads to deliver, from 1 to 10,000. Results, budget, and runtime limits can stop a run earlier. |
country | US | Two-letter country code, such as US or IN, or ALL. Used for keyword and Page ID searches. |
activeStatus | active | active, inactive, or all. Used for keyword and Page ID searches. |
mediaType | all | all, image, video, meme, or none. Used for keyword and Page ID searches. |
dateFrom | - | Optional start of Meta's date range, YYYY-MM-DD. Matches ads that ran during the range. |
dateTo | - | Optional end of the date range, YYYY-MM-DD. |
proxyConfiguration | Residential | Residential proxies are on by default, including for the fresh form and the automatic daily check. Turn them off explicitly for a direct connection. Custom proxy providers may charge separately. |
Supported URL filters: country, q, view_all_page_id, active_status, media_type, ad_type, search_type, is_targeted_country, indexed content_languages[n], indexed publisher_platforms[n], sort_data[mode], sort_data[direction], start_date[min], and start_date[max] (Meta's date range; an empty bound means no limit). URLs from facebook.com, m.facebook.com, and web.facebook.com are accepted, with or without the trailing slash.
Other URL parameters, such as fbclid, utm_source, or source, do not change an Ad Library search. They are removed from the request, logged, and listed in the run summary's ignoredParameters instead of failing the run. An invalid value for a supported filter, a duplicated filter, or a single-ad id URL is still rejected.
Search types are page, keyword_unordered, and keyword_exact_phrase, according to the search source. Sort modes are passed to Meta as written in the URL, for example total_impressions or relevancy_monthly_grouped, with asc or desc direction. Ad categories are all, political_and_issue_ads, housing, employment, and credit.
Output fields
Each dataset row is one ad, identified by libraryID. Fields contain the public data Meta supplies; availability varies by ad.
| Data | Output fields |
|---|---|
| Ad identity | libraryID, adLibraryUrl |
| Advertiser | pageId, brand, brandLogo |
| Partnership (branded content) | collaboratorName, collaboratorPageId, collaboratorLogo |
| Copy and headline | body, linkTitle, linkDescription |
| Call to action and destination | ctaText, ctaUrl, linkUrl |
| Creative media | images, videos, cards, format |
| Status and distribution | active, platforms, totalPlatforms |
| Dates | startDate, endDate, scrapeDate |
| Additional context | similarAdCount, multipleVersions, runningTAT, sourceUrl |
images contains objects with a url. videos contains url, duration, and poster (the preview image shown before the video plays); duration and poster are null when Meta does not supply them. Each entry in cards keeps its own body, title, description, link, CTA, and media.
format is image, video, carousel, dynamic, or unknown. dynamic covers Meta's dynamic creative and dynamic catalog (product) ads: cards, images, and videos hold every version, and ctaText is the button of the first version, as the Ad Library shows it. For dynamic ads, top-level copy uses concrete card text when Meta supplies a product placeholder. A post with several images or videos is a carousel. Card order can vary between searches.
multipleVersions is true for dynamic ads, false for single-version formats, and null when Meta reports no format. A carousel alone is not multiple versions.
endDate is set only for ads that have stopped. Meta reports the current day as the end date of a running ad, so live ads have endDate: null. runningTAT is the number of days since the reported start date of an active ad, not a performance metric. Unknown text is empty; unknown status, dates, counts, and durations are null.
On a branded-content (partnership) ad, brand and pageId are the advertiser, and collaboratorName, collaboratorPageId, and collaboratorLogo are the creator whose identity the ad runs under. brandLogo is null on these ads because Meta only supplies the creator's picture. All collaborator fields are null on other ads.
Media URLs point to Meta's hosting and can expire. The Actor returns links; it does not download or archive the files.
Run summary
Each run saves RUN_SUMMARY in its key-value store, and the run's status line in Apify Console states the outcome in words.
| Field | Meaning |
|---|---|
delivered | Unique ads in the dataset. |
complete | true only when Meta reported no next page and every record was delivered. |
stopReason | exhausted, max_ads, budget, time_limit, interrupted, or error. |
metaResultCount | Meta's approximate result count for the search, from its first page. It can differ from the unique ads Meta actually returns. |
skipped | Records left out because Meta sent them without a usable Library ID, or, in a Page search, from another advertiser. A run with skipped records is not complete. |
ignoredParameters | URL parameters that were not search filters and were removed. Present only when there were some. |
duplicates, pages, restarts, errorCode | Pagination diagnostics. |
Use the Facebook Ads Library API from your code
You need an Apify API token, not a Meta token. For small searches, one synchronous request starts the run and returns the ads:
curl --request POST \'https://api.apify.com/v2/acts/whoareyouanas~meta-ad-lite-scraper/run-sync-get-dataset-items' \--header "Authorization: Bearer ${APIFY_TOKEN}" \--header 'Content-Type: application/json' \--data '{"searchQuery":"dinosaur","country":"US","maxAds":20}'
Synchronous requests wait up to 300 seconds. For larger searches, start the run and read its dataset when it finishes. JavaScript, with the apify-client package:
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('whoareyouanas/meta-ad-lite-scraper').call({pageId: '134615383218473',country: 'US',maxAds: 500,});const { items } = await client.dataset(run.defaultDatasetId).listItems();
Python, with the apify-client package:
import osfrom apify_client import ApifyClientclient = ApifyClient(os.environ["APIFY_TOKEN"])run = client.actor("whoareyouanas/meta-ad-lite-scraper").call(run_input={"pageId": "134615383218473", "country": "US", "maxAds": 500})items = client.dataset(run["defaultDatasetId"]).list_items().items
The Actor's API tab has ready-made examples for other languages. See Apify's run API reference and dataset documentation.
Saved example tasks
Open an example, select Try for free to copy it into your account, then replace the sample input with your own research target. Normal Actor charges apply.
Competitor and brand research
- View a competitor's Facebook ads by Page ID: Burger King's active US ads, 50 ads.
- Find active Nike ads on Facebook and Instagram: keyword search for a brand, 10 ads.
- Facebook Ads Library product research: ecommerce ads that mention "50% off free shipping", 50 ads.
Ad examples by type and industry
- Facebook lead ad examples: "get a free quote" ads with their Get Quote and Sign Up buttons, 30 ads.
- Real estate Facebook ad examples: exact phrase "homes for sale", 30 ads.
- Photography Facebook ad examples: exact phrase "photography session", 30 ads.
Filters and exports
- Download Facebook Ad Library videos: video ads with direct MP4 links, preview images and durations, 20 ads.
- Export Facebook Ads Library search results from a URL: a pasted UK image-ad search, 25 ads.
- Scrape Instagram ads for a keyword: an Ad Library URL limited to Instagram placements, 25 ads.
- Find Facebook ads that ran in a date range: keyword search with
dateFromanddateTo, 30 ads.
Read the completed run's dataset and RUN_SUMMARY before relying on the results. Public availability and field coverage change over time; keep previous results yourself if you need historical comparisons.
Connect an AI assistant with MCP
Use the hosted Apify MCP server with this Actor selected:
https://mcp.apify.com?tools=whoareyouanas/meta-ad-lite-scraper
For a client that accepts an mcpServers configuration:
{"mcpServers": {"apify-meta-ad-lite-scraper": {"url": "https://mcp.apify.com?tools=whoareyouanas/meta-ad-lite-scraper"}}}
Sign in with Apify OAuth when prompted. For a token-based client, add "headers": {"Authorization": "Bearer YOUR_APIFY_TOKEN"} to the server entry. Client configuration formats vary; use the Apify MCP configurator for your client.
Example AI prompt:
Use whoareyouanas/meta-ad-lite-scraper to find 20 active Nike ads in the US. Wait for the run to finish, read its dataset, and summarize the ad copy and calls to action with links to the source ads. Report missing fields and errors; do not infer data that was not returned.
MCP runs use the same input and normal Actor pricing. A successful run status alone does not prove the requested data was extracted; check the dataset and RUN_SUMMARY.
How much does it cost to scrape Facebook ads?
You pay per ad saved to the dataset: $4.00 per 1,000 ads at the time of writing, so 100 ads cost $0.40. Check the Pricing tab for the current rate.
- No start fee, and every output field is included: no separate creative-detail or advertiser-enrichment charge.
- Ads removed as duplicates and records skipped for missing data are never charged.
- Set
maxAds, or a maximum charge for the run, and the scraper stops exactly there.
Tested on real Meta ads
Every release runs 15 cloud checks with Apify Residential proxies and 512 MB memory before it goes live: exact 1-, 2-, 5-, 31- and 150-ad caps, Page, keyword and URL searches, a date-range search that pages past the first 30 ads, a pasted URL with tracking parameters, a confirmed empty search, and explicit budget and runtime stops. Both releases on November 20, 2026 passed all 15.
| Check, two releases | Ads delivered | Runtime |
|---|---|---|
| Page, keyword, or URL search, 12 runs | 31 each | 6.9-43.1 seconds, about 11 typically |
| Keyword "dinosaur", United States, 2 runs | 150 | 26.4 and 50.5 seconds |
| Date-range Page search, 2 runs | 31 | 23.0 and 28.3 seconds |
The slowest runs include automatic retries on fresh IPs after Meta's per-IP rate limit.
Earlier tests on September 8, 2026 delivered all 719 Burger King ads in the United States (Meta reported no next page) and 1,000 "dinosaur" ads with zero duplicate Library IDs. Independent browser checks matched all 281 sampled IDs. These are measured examples, not speed guarantees or proof of complete inventory; availability changes over time.
More ad library scrapers
| Actor | Use it for |
|---|---|
| Meta (Facebook) Ad Library Scraper | Our main Facebook ad scraper, including single-ad input |
| Facebook Ad Library Single Ad Lookup | One ad's creative and details by Library ID |
| Meta Ad Library Brand Search & Page ID Finder | Turn a brand name into a Facebook Page ID |
| Google Ads Transparency Scraper | Competitor ads from Google's Ads Transparency Center |
| TikTok Ad Library & Creative Scraper | Competitor ads on TikTok |
| LinkedIn Ad Library Scraper | Competitor ads on LinkedIn |
Turn competitor ads into your next creative test with Seercraft
Move from bulk ad discovery to an ongoing view of your competitors. We also build Seercraft for ongoing Meta ad research: track competitors daily, save Facebook and Instagram ads to boards, ask Seer questions with links to source ads, and turn your findings into creative briefs.
Switching from another Facebook ads scraper
If you use Curious Coder's Facebook Ad Library Scraper or a similar Actor, you can reuse a supported Ad Library search URL as targetUrl. Run one source at a time and set maxAds to your desired upper limit.
| Existing workflow | This Actor |
|---|---|
| A list of Ad Library search URLs | One targetUrl per run, or one saved task per URL |
| Per-source result limit | maxAds, an exact upper limit |
| Facebook Page URL | The numeric Page ID as pageId |
| Country and status options for a Page | country and activeStatus; set them explicitly to match your previous task |
| Date range | dateFrom and dateTo, or keep start_date[min]/start_date[max] in the URL |
| Raw output consumed by a script | Map to the field names above, particularly libraryID, brand, images, and videos |
This Actor has its own input and output format; it does not accept another Actor's configuration unchanged. It does not provide paid enrichment features such as advertiser details beyond what the Ad Library shows.
FAQ
Is this the official Facebook Ad Library API?
No. It is an independent scraper of the public Ad Library website, run on Apify. You call it like any API, with an Apify token, and you do not need a Meta developer account, access token, or identity verification. It is not affiliated with or endorsed by Meta.
Can I scrape Instagram ads too?
Yes, when Meta returns Instagram placements in Ad Library results. The platforms array lists where each ad ran. To limit a search to Instagram, paste an Ad Library URL filtered to Instagram (publisher_platforms[0]=instagram). This searches ads in the Meta Ad Library, not Instagram posts or profiles.
Can I use it as a Facebook ad spy tool?
You can use it to research any advertiser's public ads: their copy, creatives, offers, landing pages, and how long each ad has run. It does not show spend, impressions, reach, engagement, or ROAS for commercial ads, because the Ad Library does not publish them. Sorting by total impressions does not expose the underlying figures.
Do I need a Facebook account?
No Facebook login or uploaded cookies are required for public results. Ads with login or age restrictions may have empty creative fields. An Apify account is needed to run the Actor; API access uses your Apify token.
Why can an active search contain inactive ads?
Meta can return records marked inactive even when the search requests active ads. This Actor keeps each record's returned status. Filter active === true in your exported data when you need strictly active rows.
Can I retrieve a single ad by Library ID?
This Actor searches by keyword, Page ID, or search URL. Individual ?id= URLs are not supported; use our Facebook Ad Library Single Ad Lookup or main Meta Ad Library Scraper.
Why did I receive fewer ads than maxAds?
maxAds is a ceiling, not a promised count. Results can end earlier, or a run can reach its budget or runtime limit. The run's status line says why it stopped; RUN_SUMMARY in the run's key-value store has the details. complete: true means Meta reported no next page and every record was delivered. A record Meta sends without a usable Library ID is skipped and counted in skipped rather than failing the run. A blocked request, or a page of records in an unrecognized shape, marks the run failed while keeping the ads already saved.
Meta also rate-limits its search API per IP address. The Actor retries on a fresh Residential IP; a run with proxies turned off can stop early when its IP is limited.
Can I request 10,000 ads?
The input accepts up to 10,000. Large searches are subject to a 500-page safety limit and the run's timeout. The Actor stops starting new pages 45 seconds before the timeout and records stopReason: "time_limit" with complete: false; saved results can be resumed. Live tests so far extend to 1,000 ads, so 10,000-ad completion is not guaranteed.
Can I export Facebook ads to CSV or Excel?
Yes. Export the dataset from Apify in JSON, CSV, or Excel. Use JSON when you need the nested cards, images, and videos; use CSV for flat fields such as brand, copy, Library ID, and dates.
Support
Report an issue through the Actor's Issues tab with your run URL, search input, and the affected Library IDs. Include what you expected and what you received. Keep API tokens and proxy credentials out of your report.