Meta (Facebook) Ad Library Scraper
Pricing
from $0.20 / 1,000 results
Meta (Facebook) Ad Library Scraper
Scrape the Meta Ad Library by keyword, Facebook Page ID, Ad ID, or direct Ad Library URL. Extract ad copy, CTA, links, images, videos, campaign dates, and other structured data from Facebook and Instagram ads.
Pricing
from $0.20 / 1,000 results
Rating
0.0
(0)
Developer
Mikolabs
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
Meta (Facebook) Ad Library Scraper — Facebook & Instagram Ads Extractor by Mikolabs
Scrape the Meta Ad Library (Facebook Ad Library) at scale. Extract ad copy, images, video URLs, advertiser details, and creative data from Facebook and Instagram ads — no Meta account, no API key, no approval process required. Export to JSON, CSV, or Excel in minutes.
What does Meta (Facebook) Ad Library Scraper do?
Meta (Facebook) Ad Library Scraper by Mikolabs extracts structured ad data from Meta's public Ad Library. Point it at a keyword, a Facebook Page ID, a specific Ad ID, or a raw Ad Library URL, and it returns clean, structured records — ad creative body, image and video URLs, advertiser name, CTA text and links, platform reach, and delivery dates.
Use it to research competitor Facebook and Instagram ads, monitor brand advertising trends, build ad intelligence datasets, or feed structured ad data into AI/analytics pipelines — all without a Facebook account or Meta developer approval.
Unlike the official Meta Ad Library API (limited to political/issue ads in the EU, gated behind identity verification and a 200 requests/hour cap), this scraper works on any public ad, targeted at any country, with no account required.
Two ways to run it
Option A — Direct URLs
Paste one or more complete Facebook Ad Library URLs (from facebook.com/ads/library) into startUrls. When this field is filled, every other parameter is ignored and the scraper runs exactly what you searched for in your browser.
Option B — Auto-build from parameters
Leave startUrls empty and instead supply:
- Search Keywords (
searchQueries) — e.g."nike","running shoes" - Facebook Page IDs (
pageIds) — numeric IDs to pull every ad from a specific brand page - Specific Ad IDs (
adIds) — target individual ads directly
Each keyword, Page ID, or Ad ID you provide is launched as its own search and run concurrently (controlled by maxConcurrency), so you can batch dozens of brands or keywords in a single actor run.
What data can you extract?
Every ad result includes the following structured fields:
| Field | Description |
|---|---|
libraryID | Ad Archive ID — unique identifier for historical lookup |
brand | Advertiser page name |
industry | Advertiser industry/category, when available |
active | Whether the ad is currently running (true/false) |
platforms | Where the ad runs — facebook, instagram, messenger, audience_network |
totalPlatforms | Number of platforms the ad runs on |
similarAdCount | Number of creative variants in the same ad group |
multipleVersions | true if the ad has multiple creative variants |
body | Full ad copy / creative text |
linkTitle | Headline of the link card |
linkUrl | Destination URL from the ad |
linkDescription | Caption / description from the link card |
ctaText | Call-to-action button text (e.g. "Shop Now", "Install Now") |
ctaUrl | CTA destination URL |
images | Direct URLs to all ad image creatives |
videos | Direct URLs to all ad video creatives |
startDate | Ad delivery start date (Unix timestamp) |
endDate | Ad delivery end date, or empty if still active |
format | Creative format — video, image, or unknown |
Filters & targeting
| Parameter | Description |
|---|---|
country | ISO 2-letter country code for ad targeting (e.g. US, GB, IN) — required in Option B |
activeStatus | active, inactive, or all |
adType | all, political_and_issue_ads, housing, employment, or credit |
mediaType | all, image, video, or meme |
isTargetedCountry | If true, only returns ads that specifically target your chosen country |
contentLanguages | Restrict results to specific languages (e.g. en, es, it) |
sortMode | Sort by total_impressions (reach), relevance, or start_date |
sortDirection | desc (highest first) or asc |
How to scrape the Meta Ad Library
Option A: Paste a Facebook Ad Library URL
- Visit facebook.com/ads/library and search with your desired filters (keyword, brand, or
view_all_page_id=...for a specific page) - Copy the URL from your browser address bar
- Paste it into Facebook Ad Library URLs (Direct) (
startUrls) — you can add more than one - Click Start
Option B: Build the search from parameters
- Open Meta (Facebook) Ad Library Scraper on Apify and click Try for free
- Enter your Target Country (
country) - Add one or more Search Keywords, Facebook Page IDs, or Specific Ad IDs
- Apply filters — ad status, ad category, media type, languages, sort order
- Set Maximum Ads to Scrape (
maxItems) - Click Start
- When the run finishes, click Export to download JSON, CSV, or Excel
Input example
{"country": "US","searchQueries": ["nike"],"activeStatus": "active","adType": "all","mediaType": "all","isTargetedCountry": false,"sortMode": "total_impressions","sortDirection": "desc","maxItems": 100,"maxConcurrency": 1,"requestHandlerTimeoutSecs": 900,"proxyConfiguration": {"useApifyProxy": true,"apifyProxyGroups": ["RESIDENTIAL"]}}
Output example
Each result is a clean, flat ad object ready for analysis:
{"libraryID": "971661872066048","brand": "H&M","industry": "","active": true,"platforms": [],"totalPlatforms": 0,"similarAdCount": 2,"multipleVersions": true,"body": "{{product.brand}}","linkTitle": "{{product.name}}","linkUrl": "http://itunes.apple.com/app/id834465911","linkDescription": "itunes.apple.com","ctaText": "Install now","ctaUrl": "http://itunes.apple.com/app/id834465911","images": [],"videos": [],"startDate": "1777273200","endDate": "1785913200","format": "unknown"}
You can download the full dataset in JSON, CSV, Excel, or HTML directly from the Apify Console, or fetch it programmatically via the API.
Pricing
This actor is pay-per-result — just $0.20 per 1,000 ads scraped, with no actor start fee. You only pay for the results you actually get. The Apify Free plan includes monthly platform credits, which is enough to scrape thousands of ads at no extra cost.
How to use the API
Run this scraper programmatically to feed Meta ad data into your own apps, dashboards, or automation pipelines.
Python
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_API_TOKEN")run_input = {"country": "US","searchQueries": ["nike", "adidas"],"activeStatus": "active","maxItems": 200,"proxyConfiguration": {"useApifyProxy": True,"apifyProxyGroups": ["RESIDENTIAL"]},}run = client.actor("mikolabs/meta-ads").call(run_input=run_input)for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item)
JavaScript / Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_APIFY_API_TOKEN' });const input = {country: 'US',searchQueries: ['nike', 'adidas'],activeStatus: 'active',maxItems: 200,proxyConfiguration: { useApifyProxy: true, apifyProxyGroups: ['RESIDENTIAL'] },};const run = await client.actor('mikolabs/meta-ads').call(input);const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
For the full API reference, see the API tab on this actor's page.
Advanced settings
| Setting | Description |
|---|---|
maxItems | Maximum number of ads to collect. Stops immediately when reached (default: 30, minimum: 1) |
maxConcurrency | Number of parallel browser tabs (1–10). We recommend 1–2 for best stability |
requestHandlerTimeoutSecs | Max seconds allowed to scroll a single URL before moving on (default: 900 / 15 min, handles lists with thousands of ads) |
proxyConfiguration | Residential proxy config — required to reliably bypass Facebook's anti-scraping measures |
Why use this instead of the official Meta Ad Library API?
| Feature | Mikolabs Meta (Facebook) Ad Library Scraper | Official Meta Ad Library API |
|---|---|---|
| Ad types | All ads — commercial, political, housing, employment, credit | Political/issue ads only |
| Countries | Any country you target | Limited coverage, EU-focused for political ads |
| Rate limit | No hard limit | 200 calls/hour |
| Approval required | No | Yes — identity verification required |
| Meta account needed | Not required | Required |
| Creative data | Full — images, videos, ad copy, CTA, links | Limited |
| Export formats | JSON, CSV, Excel, HTML | JSON only |
| Input flexibility | Direct URL, keyword, Page ID, or Ad ID | Query parameters only |
Use cases
- Competitor ad research — see exactly what creatives, copy, and landing pages competitors run on Facebook and Instagram
- Facebook & Instagram ad spy tool — monitor any brand's Meta advertising activity without manual browsing
- Market research — surface ad copy trends, creative formats, and messaging patterns by keyword, industry, or country
- Ad creative inspiration — browse top-performing ads by keyword, niche, or brand
- eCommerce & dropshipping research — find products being advertised heavily on Facebook and Instagram
- Lead generation — identify actively advertising businesses in any niche or market
- Political ad monitoring — track political and issue-based ads for journalism or compliance
- Brand monitoring — track how brands present themselves across paid channels on Meta
- AI training data — feed structured ad creative data into models for analysis or classification
- Marketing analytics — build dashboards tracking competitor ad activity and creative rotation over time
FAQ
Do I need a Facebook account or Meta API key? No. The Meta Ad Library is publicly accessible without login. This scraper requires no Facebook credentials, Meta API keys, access tokens, or approval process.
What proxy should I use?
A residential proxy is required for reliable scraping — Facebook blocks datacenter IPs. The default proxyConfiguration uses Apify's Residential Proxy group, which works reliably for most use cases.
Can I scrape ads from multiple countries at once?
Yes. Run separate searches per country by setting country and re-running, or queue multiple direct URLs targeting different countries in startUrls.
Can I scrape Instagram ads?
Yes. The Meta Ad Library includes ads running across Meta platforms — Facebook, Instagram, Messenger, and Audience Network. Instagram ads appear with "instagram" in the platforms field.
Can I target a specific brand directly?
Yes. Provide the brand's numeric Facebook Page ID in pageIds, or paste a Page's Ad Library URL (containing view_all_page_id=...) into startUrls.
Can I look up one specific ad?
Yes. Provide its numeric ID in adIds to fetch that ad directly.
What if the run is interrupted mid-scrape? Data is not lost — any ads already collected before the interruption remain available in the run's default dataset.
How many ads can I scrape per run?
There's no hard cap. Set maxItems to any value; actual throughput depends on proxy quality, maxConcurrency, and Facebook's own rate limiting.
Can I use this as an unofficial Meta Ads API? Yes. Run this scraper programmatically via the Apify API and get structured ad data back in JSON — without the account, approval, and rate-limit restrictions of Meta's official API.
Support
Found a bug, got a feature request, or have a question? Open an issue on the Issues tab on this actor's page.
Built by Mikolabs — fast, reliable, production-ready Apify actors for data extraction at scale.