Extract comprehensive data from Facebook's Ad Library with real-time batch pushing, advanced filtering, and full ad-detail enrichment.
Search Keywords & Advertisers & URLs β Stream Real-Time Ad Data β Get Complete Analytics
https://www.youtube.com/watch?v=yNSIhZcDlNY
The Actor automatically detects whether your Apify account is on a free or a paid plan β you don't configure anything. The plan decides two things: how many results a single run returns, and which proxy network the run uses.
| Free plan | Paid plan | |
|---|---|---|
| Results per run | 200 maximum (a sample) | βΎοΈ Unlimited |
| Proxy network | Apify Proxy (shared residential pool) | Dedicated premium proxy |
| Ad Library data & fields | Full β nothing is stripped out | Full |
| All filters & search modes | β Included | β Included |
| Media assets (images & video) | β Included | β Included |
| Best for | Evaluating the output before you commit | Production, agencies, large datasets |
Get started with no upfront cost. You get the complete data shape, just not the complete dataset.
Included:
- β Full access to Facebook Ad Library data β every field, nothing redacted
- β Multi-language & multi-country filtering
- β Real-time batch pushing (results appear as they're collected)
- β Complete media asset extraction (images & videos)
- β All filtering options (date ranges, platforms, categories)
Limits:
- π 200 results per run β a hard cap, counted across the whole run, not per query.
A free run asking for 5 keywords Γ 100 results still stops at 200 results in total.
The run then finishes normally (
SUCCEEDED) β a short result set is the cap, not a failure. β οΈ Apify Proxy (shared residential pool) only β the dedicated premium proxy is a paid-plan benefitβ οΈ Occasional connection interruptions on the shared pool
Think of a free run as a free sample. Run your real query, inspect the fields, check the ad creatives and the EU reach data, confirm it fits your pipeline β then subscribe and re-run the exact same input to get everything.
π Subscribe to a paid Apify plan to remove the 200-result cap.
Upgrade for unlimited results and enterprise-grade reliability
All Free Plan features PLUS:
- π No 200-result cap - Every run returns the full result set
- π Dedicated premium proxy - Your own reliable connection, not the shared pool
- π No rate limiting - Unlimited continuous scraping
- π 100% success rate - Stable, uninterrupted operations
- π Extract β+ ads per query - No slowdowns or blocks
- π Perfect for production use - Enterprise-ready infrastructure
- π Consistent performance - No random connection errors
Why upgrade?
- Get all your data: The 200-result sample cap is lifted entirely
- Avoid interruptions: Your dedicated proxy won't hit Facebook's rate limits
- Reliability: No HTTP errors or temporary blocks
- Scale effortlessly: Handle large datasets with perfect stability
- Best for agencies: Reliable results for client reports and production systems
- Zero downtime: 24/7 stable scraping without worries
What it is: a free-plan run pushes at most 200 results in total, then stops cleanly.
How it behaves:
- The cap is run-wide, not per keyword, per URL or per advertiser. Five queries at
maxResultsPerQuery: 100will not return 500 results on a free plan β they return 200. - The run still succeeds. It is not an error, a crash, or a block.
- You are never charged for results you don't receive β the cap is applied before billing, so a capped run bills for exactly the results in your dataset.
- Once the cap is reached the Actor stops fetching immediately β it doesn't keep making requests for ads it can't give you.
- Every free run states the cap twice: once at the start of the log, and once in the finish summary and the run's status message.
What you'll see in the log when a free run hits the cap:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π FREE PLAN SAMPLE β 200 of a possible unlimited results returned
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This run stopped at the free-plan limit of 200 results.
What you are looking at is a SAMPLE β the full result set is larger.
π Subscribe to any paid Apify plan to unlock ALL results:
https://console.apify.com/billing/subscription
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
And on the finished run header:
β
Sample complete: 200 results (free-plan limit of 200 per run reached).
Subscribe to a paid Apify plan to unlock all results.
To remove the cap: subscribe to any paid Apify plan and re-run the same input. Nothing in your Actor input changes β the Actor detects the upgrade automatically on the next run.
Perfect for: One-off scraping tasks, scheduled runs, offline processing
apify call dz-omar/facebook-ads-scraper-pro --input input.jsonInput format (input.json):
{
"searchQueries": ["nike", "adidas"],
"searchAdvertisers": ["15087023444"],
"maxResultsPerQuery": 50,
"countries": ["US"],
"activeStatus": "ACTIVE",
"mediaType": "IMAGE"
}Process Flow:
- Actor starts
- Processes your request
- Returns results
- Actor stops
Perfect for: Copying searches directly from Facebook's Ad Library website, or fetching a specific ad by ID
{
"URLAds": [
{
"url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=nike&media_type=video"
},
{
"url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&q=adidas"
}
],
"maxResultsPerQuery": 50
}How URL Mode works:
- Go to Facebook Ad Library and set up your search
- Copy the URL from your browser
- Paste it into the
URLAdsfield - All filters from the URL (country, language, date range, media type, platforms, sort order) are extracted automatically
- The actor parses each URL and runs the search for you
π Single ad links supported:
URLs with ?id= fetch that specific ad directly no search query needed:
{
"URLAds": [
{ "url": "https://www.facebook.com/ads/library/?id=907653308384731" }
],
"enrichWithAdDetails": true
}Combining URL Mode with Manual Search:
You can provide URLs alongside keyword and advertiser searches all run sequentially:
{
"URLAds": [
{ "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=ALL&q=pokemon&media_type=video" }
],
"searchQueries": ["apify"],
"searchAdvertisers": ["Nike", "15087023444"],
"maxResultsPerQuery": 50,
"activeStatus": "ALL",
"adType": "ALL"
}Execution order:
- π All
URLAdsare processed first (each URL uses its own filters from the URL) - π’ Then
searchAdvertisersare resolved and scraped (using the input schema filters) - π Then
searchQueriesare run as keyword searches (using the input schema filters)
maxResultsPerQuery controls the maximum ads collected per URL, per advertiser page, and per keyword query.
π On a free Apify plan, every run stops at 200 results in total β across all URLs, advertisers and queries combined β no matter what
maxResultsPerQueryis set to. That's your free sample. Subscribe to a paid plan to unlock the full result set with the same input.
| Parameter | Type | Default | Description |
|---|---|---|---|
URLAds |
array | [] |
Facebook Ad Library URLs to scrape directly (new in v0.2) |
searchQueries |
array | [] |
Keywords to search (e.g., ["nike", "adidas"]) |
searchAdvertisers |
array | [] |
Advertiser names or page IDs |
maxResultsPerQuery |
integer | 10 |
Max ads per URL / per query / per advertiser page. Free plan: the run still stops at 200 results in total regardless of this value |
batchSize |
integer | 30 |
Ads per batch request |
countries |
array/string | ["ALL"] |
Country codes (e.g., ["US", "GB", "FR"]) |
contentLanguages |
array | [] |
Language codes (e.g., ["en", "es", "fr"]) |
activeStatus |
string | "ALL" |
"ALL", "ACTIVE", "INACTIVE" |
adType |
string | "ALL" |
Ad category filter |
mediaType |
string | "ALL" |
Media type filter |
publisherPlatforms |
array | [] |
Platforms to search |
sortBy |
string | "SORT_BY_TOTAL_IMPRESSIONS" |
Sort method |
startDate |
string | null |
Start date (YYYY-MM-DD) |
endDate |
string | null |
End date (YYYY-MM-DD) |
enrichWithAdDetails |
boolean | false |
Fetch full ad details per result (advertiser info, targeting, payer/beneficiary, violations) |
At least one of these MUST be provided:
URLAds- Contains Facebook Ad Library URLssearchQueries- Contains search keywordssearchAdvertisers- Contains advertiser names/page IDs
You can provide any combination all are processed sequentially.
Invalid Input Examples (Will Fail):
{
"maxResultsPerQuery": 50
}β Error: "No input provided. Supply either URLAds, searchQueries, or searchAdvertisers"
{
"searchQueries": [],
"searchAdvertisers": []
}β Error: "Both arrays are empty - no search criteria provided"
Valid Input Examples:
{
"URLAds": [{ "url": "https://www.facebook.com/ads/library/?q=nike&country=US" }]
}β Valid - Parses the URL and runs the search
{
"searchQueries": ["nike"]
}β Valid - Uses all defaults, searches for "nike"
{
"searchAdvertisers": ["15087023444"]
}β Valid - Searches all ads from page ID
{
"URLAds": [{ "url": "https://www.facebook.com/ads/library/?q=pokemon&media_type=video" }],
"searchQueries": ["marketing"],
"searchAdvertisers": ["Nike", "Apple"],
"maxResultsPerQuery": 100,
"countries": ["US"]
}β Valid - Runs URL first, then advertisers, then keywords
By default, each result contains the core ad data. Enable enrichWithAdDetails to fetch a richer detail page per ad:
{
"searchQueries": ["nike"],
"maxResultsPerQuery": 50,
"enrichWithAdDetails": true
}Extra data included when enabled:
- Advertiser info: page about text, category, likes, profile photo, cover photo, verification status
- Instagram: username, followers, verification status
- Targeting (EU): location audience, age/gender breakdown, total EU reach
- Payer/Beneficiary: who paid for and benefits from the ad
- Violations: any policy violation types flagged by Facebook
β οΈ Performance note: Each ad requires one extra API request. Scraping will be slower.
Ad Types:
ALL- All ad typesPOLITICAL_AND_ISSUE_ADS- Political/election adsHOUSING_ADS- Real estate & housingEMPLOYMENT_ADS- Job postingsCREDIT_ADS- Financial products
Media Types:
ALL- All media typesIMAGE- Static images onlyVIDEO- Video ads onlyMEME- Text-heavy imagesIMAGE_AND_MEME- Both image typesNONE- Text-only ads
Publisher Platforms:
FACEBOOK- Main Facebook feedINSTAGRAM- Instagram feed & storiesMESSENGER- Facebook MessengerWHATSAPP- WhatsApp BusinessTHREADS- Threads social platformAUDIENCE_NETWORK- Third-party apps/sites
Sort Methods:
SORT_BY_TOTAL_IMPRESSIONS- Most viewed first (default)SORT_BY_RELEVANCY_MONTHLY_GROUPED- Most recent first
Each ad object contains:
{
"id": "606497791453836",
"page_id": "15087023444",
"page_name": "Nike",
"page_url": "https://facebook.com/Nike",
"page_profile_picture_url": "https://...",
"page_likes": 5000000,
"page_category": "Brand",
"text": "Just Do It campaign",
"title": "Ad Title",
"caption": "Visit our store",
"link_url": "https://nike.com",
"cta_text": "Learn More",
"media": {
"type": "image|video",
"primary_thumbnail": "https://...",
"images": ["..."],
"videos": ["..."]
},
"additional_assets": {
"images": ["..."],
"links": ["..."],
"texts": ["..."],
"videos": ["..."]
},
"start_date": "2024-01-15",
"end_date": "2024-02-15",
"is_active": true,
"platforms": ["FACEBOOK", "INSTAGRAM"],
"countries": ["US", "GB", "CA"],
"ad_category": "MARKETING",
"contains_sensitive_content": false,
"scraped_at": "2026-01-25T23:14:50Z",
// Only present when enrichWithAdDetails: true
"ad_details": {
"advertiser": {
"page": { "id": "15087023444", "about": { "text": "https://nike.com" } },
"ad_library_page_info": {
"page_info": {
"ig_username": "nike",
"ig_followers": 306000000,
"ig_verification": true,
"page_verification": "BLUE_VERIFIED",
"page_cover_photo": "https://...",
"entity_type": "BRAND"
},
"page_spend": { "is_political_page": false }
}
},
"aaa_info": {
"targets_eu": true,
"gender_audience": "All",
"age_audience": { "min": 18, "max": 65 },
"eu_total_reach": 500000,
"location_audience": [{ "name": "France", "type": "countries" }, "..."],
"age_country_gender_reach_breakdown": ["..."],
"payer_beneficiary_data": [{ "payer": "Nike Inc.", "beneficiary": "Nike" }],
"has_violating_payer_beneficiary": false,
"is_ad_taken_down": false
},
"violation_types": [],
"verified_voice_context": {
"types": ["UNCATEGORIZED"],
"ad_library_all_geo_fin_serv_info": { "finserv_data": [] }
}
}
}Paste Ad Library URLs directly all filters are extracted automatically:
{
"URLAds": [
{ "url": "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=nike&media_type=video" }
],
"maxResultsPerQuery": 100
}Use Case: You've already set up the perfect search on Facebook's Ad Library website just copy the URL and let the actor handle it.
π Single ad links also supported:
URLs containing ?id= fetch that one specific ad directly no search, no pagination:
{
"URLAds": [
{ "url": "https://www.facebook.com/ads/library/?id=907653308384731" }
]
}Pair it with enrichWithAdDetails: true to get the full advertiser, targeting, and payer/beneficiary data for that ad:
{
"URLAds": [
{ "url": "https://www.facebook.com/ads/library/?id=907653308384731" }
],
"enrichWithAdDetails": true
}Search for ads by keywords or brand names:
{
"searchQueries": ["nike", "adidas"],
"maxResultsPerQuery": 100
}Use Case: Find all ads mentioning your keywords across all advertisers
β οΈ Important Keyword Search is Broad by DesignWhen using
searchQueries, Facebook Ads Scraper Pro performs a keyword search across all advertisers. This means it matches any ad whose text, title, or page name contains your keyword not just the brand you may have in mind.For example:
{ "searchQueries": ["SHEIN"] }This will return ads from SHEIN Brasil, SHEIN KIDS, SHEIN Mexico, and any other page or ad copy containing the word "SHEIN". The impression-based ranking may also surface different ads than you'd expect when targeting a specific page.
If you want precise, targeted results for a specific advertiser, use one of these instead:
- π’
searchAdvertisersresolves the brand name to its exact Facebook page(s) and fetches only their ads:{ "searchAdvertisers": ["SHEIN"] }- π
URLAdscopy the URL directly from Facebook's Ad Library after setting up your exact search filters:{ "URLAds": [{ "url": "https://www.facebook.com/ads/library/?q=SHEIN&country=ALL" }] }
Search ads from specific Facebook pages:
{
"searchAdvertisers": ["Nike", "15087023444"],
"maxResultsPerQuery": 100
}Use Case: Monitor what a specific brand/company is advertising. Names are resolved via Facebook's typeahead API all exact-match pages are scraped.
URLs, keywords, and advertisers all in one run:
{
"URLAds": [
{ "url": "https://www.facebook.com/ads/library/?q=pokemon&country=ALL&media_type=video" }
],
"searchQueries": ["marketing"],
"searchAdvertisers": ["Nike", "Apple"],
"maxResultsPerQuery": 50
}Use Case: Run a comprehensive competitive analysis in a single actor run. URLs are processed first with their own filters, then advertisers and keywords run with the input schema filters.
ALL, US, GB, CA, AU, DE, FR, ES, IT, BR, IN, JP, DZ, and 190+ more ISO 2-letter codes
en, es, fr, de, it, pt, ja, ko, zh, ar, and 90+ more ISO 2-letter codes
| Aspect | Details |
|---|---|
| Requests | No hard limit, respects Facebook's rate limits |
| Page size | ~10 ads per request β a Facebook-side cap, not a setting |
| Results per Query | 1-10,000 ads per query |
| Results per Run (free plan) | 200 total β a sample; subscribe to unlock all results |
| Results per Run (paid plan) | Unlimited β bounded only by your own maxResultsPerQuery and budget |
| Delivery | Real-time batch pushing β results appear in the dataset as they arrive |
| Memory Usage | No limits - handles 1000s of ads |
- Failed queries are retried up to 3 times
- Exponential backoff prevents rate limiting
- Failed queries are logged but don't stop the job
Server automatically handles Apify platform migrations:
{"type":"migrating","message":"Server is migrating to new instance","timestamp":"..."}Connection behavior:
- Connection closes gracefully
- Reconnect to resume if interrupted
- No data loss - state is preserved
- URL not recognized: Make sure you're copying from
https://www.facebook.com/ads/library/... - Filters not applied: Check that the URL contains the expected query parameters
- Wrong result count: Use
maxResultsPerQueryto control how many ads are fetched per URL
- No results: Try broader keywords or check spelling
- Limited data: Increase
maxResultsPerQueryor expand date ranges - Missing recent ads: Facebook may have indexing delays
- "I only got 200 results": That's the free-plan cap, not a bug β it applies to the whole run, not per query. Subscribe to a paid plan and re-run the same input to get everything. See The Free-Plan 200-Result Cap, in Detail above.
- "The run finished early": Check the end of the log for the
π FREE PLAN SAMPLEbanner β if it's there, the run stopped at the cap and completed successfully. - Intermittent failures: Free runs use the shared Apify Proxy pool. Upgrading to a paid plan switches you to the dedicated premium proxy for stability.
- Slow performance: Reduce batch size or split into multiple smaller runs
- Rate limiting errors: Wait a few minutes before retrying, or upgrade to a paid plan
- Empty countries String: Use
"ALL"for global targeting - Wrong country codes: Use ISO 2-letter codes (US, not USA)
- Missing regional ads: Some ads may not be available in all regions
- Missing media URLs: Some ads may have expired media
- Broken links: Media URLs may expire after extended periods
- Empty arrays: Check if media type matches your filter
- Large datasets: Use date ranges to limit scope
- Free plan limits: Free runs stop at 200 results in total β subscribe to a paid plan for 1000+ ads per query
- Better results: Upgrade to a paid plan for the dedicated proxy and enterprise-grade stability
- Ad Strategy Analysis: Track competitor creative strategies
- Platform Presence: Monitor competitor activity across platforms
- Campaign Duration: Analyze campaign lengths and timing
- Creative Inspiration: Download high-quality assets
- CTA Analysis: Study effective call-to-action strategies
- Performance Benchmarking: Compare page engagement metrics
- Industry Trends: Filter by category for sector analysis
- Geographic Patterns: Analyze regional strategies
- Content Evolution: Track messaging changes over time
- π Website: flowextractapi.com
- π§ Email: flowextractapi@outlook.com
- π Apify Profile: FlowExtract API
- π¬ GitHub Issues: FlowExtractAPI
- πΌ LinkedIn: flowextract-api
- π¦ Twitter: @FlowExtractAPI
- π± Facebook: flowextractapi
- YouTube Transcript Extractor - Extract transcripts with timestamps
- YouTube Scraper Pro - Complete channel and playlist extraction
- Zoom Scraper - Download recordings and transcripts
- Loom Scraper - Loom video and transcript extraction
- Idealista Scraper API - Spanish property data with API
- Idealista Scraper - Real estate listings extractor
- Screenshot - Fast webpage screenshots
- Ultimate Screenshot - Advanced screenshot tool
- Network Security Scanner - Security vulnerability scanner
- Facebook Ads Scraper Pro - Extract Facebook ads data
- Public Data Access: Only processes publicly available Facebook Ad Library data
- Rate Limiting: Respects Facebook's service limits and terms of use
- Data Protection: No storage of personal information or unauthorized data collection
- Commercial Use: Suitable for business intelligence and research applications