Facebook Ads Scraper Pro avatar
Facebook Ads Scraper Pro

Pricing

Pay per event + usage

Go to Apify Store
Facebook Ads Scraper Pro

Facebook Ads Scraper Pro

Extract comprehensive Facebook Ad Library data including creative content, targeting info, performance metrics, and media downloads. Perfect for competitive analysis, market research, and advertising intelligence across all Meta platforms (Facebook, Instagram, WhatsApp, Messenger).

Pricing

Pay per event + usage

Rating

4.9

(21)

Developer

FlowExtract API

FlowExtract API

Maintained by Community

Actor stats

48

Bookmarked

533

Total users

76

Monthly active users

1.6 hours

Issues response

8 days ago

Last modified

Share

๐Ÿ” Facebook Ads Scraper Pro - Ad Library Intelligence

Extract comprehensive data from Facebook's Ad Library with real-time streaming, advanced filtering, and standby mode support.

Search Keywords & Advertisers โ†’ Stream Real-Time Ad Data โ†’ Get Complete Analytics


๐Ÿ’Ž Pricing Tiers - Choose Your Plan

FREE TIER โœ…

Get started with no upfront cost

Included:

  • โœ… Full access to Facebook Ad Library data
  • โœ… 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)

Trade-offs:

  • โš ๏ธ Shared proxy infrastructure
  • โš ๏ธ Occasional connection interruptions
  • โš ๏ธ Best for small to medium projects (< 500 ads)

Upgrade for enterprise-grade reliability

All Free Tier features PLUS:

  • ๐Ÿš€ Dedicated premium proxy - Your own reliable connection
  • ๐Ÿš€ No rate limiting - Unlimited continuous scraping
  • ๐Ÿš€ 90% 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?

  • 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

๐Ÿ“Š Feature Comparison

FeatureFREEPAID โญ
Ads per queryUp to 100โˆž+
Rate limitingYesNo
Connection stabilityOccasional issuesAlways stable
Best forTesting & small projectsAgencies & production
SupportStandardPriority

๐Ÿš€ Quick Start

Option 1: Run as Batch Job (One-Time Execution)

Perfect for: One-off scraping tasks, scheduled runs, offline processing

$apify call dz-omar/facebook-ads-scraper-pro --input input.json

Input format (input.json):

{
"searchQueries": ["nike", "adidas"],
"searchAdvertisers": ["15087023444"],
"maxResultsPerQuery": 50,
"countries": ["US"],
"activeStatus": "ACTIVE",
"mediaType": "IMAGE"
}

Process Flow:

  1. Actor starts
  2. Processes your request
  3. Returns results
  4. Actor stops

Perfect for: Real-time applications, multiple requests, APIs, instant responses

# Actor automatically runs in standby mode
# Access via: https://dz-omar--facebook-ads-scraper-pro.apify.actor

Standby Mode Advantages:

FeatureBatch ModeStandby Mode
Cold Start8-15 seconds0 seconds โšก
Response TimeSlow (start overhead)Instant
Best ForScheduled tasksReal-time apps
Concurrent RequestsSequentialParallel โˆž
Always RunningNoYes (pre-warmed)
CostLowerHigher (always on)
Ideal UseNightly scrapesLive dashboards

Real-World Comparison:

ScenarioBatch ModeStandby Mode
Track competitor ads dailyโœ… Goodโญ Excellent
Build a SaaS dashboardโš ๏ธ Too slowโœ… Perfect
One-time research projectโœ… BestOverkill
API for other appsโŒ Not viableโœ… Ideal
Monitor 50 keywords liveโŒ Noโœ… Yes

Example: Why Standby Mode is Better for Real-Time Dashboards

Imagine you're building a competitor monitoring dashboard that updates live:

Without Standby (Batch Mode):

User clicks "Refresh"
โ†“
Wait 10 seconds for cold start
โ†“
Wait 30 seconds for results
โ†“
40 seconds total โŒ (User closes browser)

With Standby Mode:

User clicks "Refresh"
โ†“
Results instantly (pre-warmed)
โ†“
2 seconds total โœ… (User stays engaged)

๐Ÿ“ก API Endpoints

POST / - Custom Scraping with Real-Time Streaming

Send search parameters and receive ad data in real-time NDJSON stream.

Full Example:

curl -X POST https://dz-omar--facebook-ads-scraper-pro.apify.actor \
-H "Content-Type: application/json" \
-d '{
"searchQueries": ["nike", "adidas"],
"searchAdvertisers": ["Nike Football", "15087023444"],
"maxResultsPerQuery": 100,
"countries": ["US"],
"contentLanguages": ["en"],
"activeStatus": "ACTIVE",
"adType": "ALL",
"mediaType": "IMAGE",
"publisherPlatforms": ["FACEBOOK", "INSTAGRAM"],
"sortBy": "SORT_BY_TOTAL_IMPRESSIONS",
"startDate": "2024-01-01",
"endDate": "2025-01-31"
}'

Minimal Example:

curl -X POST https://dz-omar--facebook-ads-scraper-pro.apify.actor \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["nike"]}'

Advertiser-Only Search:

curl -X POST https://dz-omar--facebook-ads-scraper-pro.apify.actor \
-H "Content-Type: application/json" \
-d '{"searchAdvertisers": ["Nike"], "maxResultsPerQuery": 200}'

Save Results to File:

curl -X POST https://dz-omar--facebook-ads-scraper-pro.apify.actor \
-H "Content-Type: application/json" \
-d '{"searchQueries": ["nike"]}' \
> results.ndjson

๐Ÿ“‹ Input Parameters

ParameterTypeDefaultMinMaxDescription
searchQueriesarray[]0โˆžKeywords to search (e.g., ["nike", "adidas"])
searchAdvertisersarray[]0โˆžAdvertiser names or page IDs
maxResultsPerQueryinteger1010โˆžMax ads per query/advertiser
batchSizeinteger3010100Ads per batch request
countriesarray/string["ALL"]--Country codes (e.g., ["US", "GB", "FR"])
contentLanguagesarray[]0โˆžLanguage codes (e.g., ["en", "es", "fr"])
activeStatusstring"ALL"--"ALL", "ACTIVE", "INACTIVE"
adTypestring"ALL"--Ad category filter
mediaTypestring"ALL"--Media type filter
publisherPlatformsarray[]06Platforms to search
sortBystring"SORT_BY_TOTAL_IMPRESSIONS"--Sort method
startDatestringnull--Start date (YYYY-MM-DD)
endDatestringnull--End date (YYYY-MM-DD)

โš ๏ธ Important: Input Does Not Exist

At least one of these MUST be provided:

  • searchQueries - Contains search keywords (required if no advertisers)
  • searchAdvertisers - Contains advertiser names/page IDs (required if no queries)

Invalid Input Examples (Will Fail):

{
"maxResultsPerQuery": 50
}

โŒ Error: "Must provide either searchQueries or searchAdvertisers"

{
"searchQueries": [],
"searchAdvertisers": []
}

โŒ Error: "Both arrays are empty - no search criteria provided"

{
"countries": ["US"],
"activeStatus": "ACTIVE"
}

โŒ Error: "Input does not exist - missing searchQueries or searchAdvertisers"

Valid Input Examples:

{
"searchQueries": ["nike"]
}

โœ… Valid - Uses all defaults, searches for "nike"

{
"searchAdvertisers": ["15087023444"]
}

โœ… Valid - Searches all ads from page ID

{
"searchQueries": ["marketing"],
"searchAdvertisers": ["Nike", "Apple"],
"maxResultsPerQuery": 100,
"countries": ["US"]
}

โœ… Valid - Searches keywords in ads from specific advertisers

Valid Values Reference

Ad Types:

  • ALL - All ad types
  • POLITICAL_AND_ISSUE_ADS - Political/election ads
  • HOUSING_ADS - Real estate & housing
  • EMPLOYMENT_ADS - Job postings
  • CREDIT_ADS - Financial products

Media Types:

  • ALL - All media types
  • IMAGE - Static images only
  • VIDEO - Video ads only
  • MEME - Text-heavy images
  • IMAGE_AND_MEME - Both image types
  • NONE - Text-only ads

Publisher Platforms:

  • FACEBOOK - Main Facebook feed
  • INSTAGRAM - Instagram feed & stories
  • MESSENGER - Facebook Messenger
  • WHATSAPP - WhatsApp Business
  • THREADS - Threads social platform
  • AUDIENCE_NETWORK - Third-party apps/sites

Sort Methods:

  • SORT_BY_TOTAL_IMPRESSIONS - Most viewed first (default)
  • SORT_BY_RELEVANCY_MONTHLY_GROUPED - Most recent first

๐Ÿ“ค Response Format (NDJSON Stream)

Each line is a JSON object representing real-time data. Process line-by-line as they arrive:

Log Messages

{"type":"log","level":"info","message":"๐Ÿ” Processing 2 keyword queries","timestamp":"2026-01-25T23:14:09Z"}
{"type":"log","level":"success","message":"๐Ÿ“ค Sent batch: 30 ads for \"nike\"","timestamp":"2026-01-25T23:14:15Z"}
{"type":"log","level":"error","message":"โŒ Query failed: No ads found","timestamp":"2026-01-25T23:14:20Z"}

Ad Batches (Real-Time)

{
"type":"batch",
"source":"keyword_query",
"query":"nike",
"batchSize":30,
"ads":[{ad_object}, {ad_object}, ...],
"timestamp":"2026-01-25T23:14:15Z"
}

Completion Events

{"type":"query_complete","query":"nike","totalAds":100,"timestamp":"2026-01-25T23:14:30Z"}
{"type":"advertiser_complete","advertiser":"Nike","totalAds":50,"timestamp":"2026-01-25T23:14:35Z"}

Error Events

{"type":"query_error","query":"test","error":"No ads found","timestamp":"2026-01-25T23:14:25Z"}
{"type":"advertiser_error","advertiser":"invalid","error":"Could not resolve advertiser","timestamp":"2026-01-25T23:14:40Z"}

Summary Statistics

{
"type":"summary",
"stats":{
"queries":{
"total":2,
"success":2,
"failed":0,
"ads":150
},
"advertisers":{
"total":1,
"success":1,
"failed":0,
"ads":50
}
},
"timestamp":"2026-01-25T23:14:40Z"
}

Completion

{"type":"complete","timestamp":"2026-01-25T23:14:45Z"}

๐Ÿ“Š Ad Data Structure

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"
}

๐ŸŽฏ Search Modes Explained

Search for ads by keywords or brand names:

{
"searchQueries": ["nike", "adidas"],
"maxResultsPerQuery": 100
}

Use Case: Find all ads mentioning your keywords across all advertisers

Search ads from specific Facebook pages:

{
"searchAdvertisers": ["Nike", "15087023444"],
"maxResultsPerQuery": 100
}

Use Case: Monitor what a specific brand/company is advertising

Both keywords and advertisers in one request:

{
"searchQueries": ["marketing"],
"searchAdvertisers": ["Nike", "Apple"],
"maxResultsPerQuery": 50
}

Use Case: Find specific keywords in ads from selected companies


๐ŸŒ Supported Countries & Languages

Countries (200+)

ALL, US, GB, CA, AU, DE, FR, ES, IT, BR, IN, JP, DZ, and 190+ more ISO 2-letter codes

Languages (100+)

en, es, fr, de, it, pt, ja, ko, zh, ar, and 90+ more ISO 2-letter codes


๐Ÿ”„ Standby Mode Deep Dive

What is Standby Mode?

Standby Mode keeps the actor running 24/7 as an HTTP API server, ready to handle requests instantly without startup delays.

Traditional Batch Mode:

Request โ†’ Start Actor (8-15s) โ†’ Process โ†’ Stop Actor

Standby Mode:

Request โ†’ Instant Response (pre-warmed instance)

Why Choose Standby Mode?

Use CaseBatch ModeStandby Mode
Nightly automated scrapeโœ… Best choiceOverkill
Live competitor dashboardโŒ Too slowโœ… Essential
API for external appsโŒ Not viableโœ… Perfect
Real-time alertsโŒ Noโœ… Yes
Webhook integrationsโŒ Doesn't workโœ… Works great
Mobile app backendโŒ Noโœ… Great
Research projectโœ… GoodExpensive

Technical Advantages

Cold Start Elimination:

  • Batch: 10-15 seconds to start
  • Standby: 0 seconds (instant)
  • Difference: 10-15 seconds per request saved

Scalability:

  • Batch: One request at a time
  • Standby: Handle 100+ concurrent requests
  • Difference: 100x throughput

User Experience:

  • Batch: User waits for response
  • Standby: Instant results
  • Difference: User stays engaged

Example: Competitor Monitoring Dashboard

Scenario: Build a live dashboard monitoring Nike, Adidas, and Puma ads

With Batch Mode:

Dashboard loads
โ†“
User clicks "Nike" tab
โ†“
API call to scraper
โ†“
Wait 10 seconds (cold start) โŒ
โ†“
Wait 20 seconds (scraping) โŒ
โ†“
Display results
โ†“
Total time: 30 seconds (user frustrated)

With Standby Mode:

Dashboard loads (scraper pre-warmed)
โ†“
User clicks "Nike" tab
โ†“
API call to scraper
โ†“
Results instantly โœ…
โ†“
Display results
โ†“
Total time: 2 seconds (user delighted)

How to Access Standby Mode

Automatic Access: Simply use the actor URL directly:

https://dz-omar--facebook-ads-scraper-pro.apify.actor

No Configuration Needed:

  • Instance is always running
  • Ready 24/7
  • No startup delay
  • Just send HTTP requests

Direct Integration Example:

Your application can make direct API calls:

POST https://dz-omar--facebook-ads-scraper-pro.apify.actor
Content-Type: application/json
{
"searchQueries": ["nike"],
"maxResultsPerQuery": 50
}

Standby Mode Pricing

  • Higher Cost: Actor runs continuously
  • Break-even Point: ~3-4 requests per day
  • Best For: High-frequency usage patterns
  • Not Ideal For: Low-frequency, scheduled tasks

Cost Comparison (Example):

100 daily requests
- Batch mode: 100 starts ร— 30 sec = 50 min/day = $$
- Standby mode: Always on = $ (often cheaper!)

Standby Mode Limitations

  • Maximum continuous run: ~30 minutes idle timeout
  • Reconnect is automatic if disconnected
  • Not suitable for very low-frequency usage
  • Higher base cost even if no requests

Standby Mode Best Practices

  1. Keep Connections Alive: Send heartbeat requests periodically
  2. Handle Reconnections: Implement retry logic on client side
  3. Batch Related Requests: Send multiple queries in one request when possible
  4. Monitor Performance: Track response times and errors
  5. Set Reasonable Limits: Don't request 10,000 ads if you need 100

AspectDetails
RequestsNo hard limit, respects Facebook's rate limits
Batch SizeDefault 30 ads, configurable 10-100
Results per Query1-10,000 ads per query
Concurrent RequestsUnlimited (standby mode scales automatically)
Response TimeReal-time streaming - results as they arrive
Memory UsageNo limits - stream handles 1000s of ads

๐Ÿ›ก๏ธ Error Handling & Migration

Automatic Retry Logic

  • Failed queries are retried up to 3 times
  • Exponential backoff prevents rate limiting
  • Failed queries are logged but don't stop the job

Migration Handling

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

๐Ÿ› ๏ธ Troubleshooting

Search Issues

  • No results: Try broader keywords or check spelling
  • Limited data: Increase maxResultsPerQuery or expand date ranges
  • Missing recent ads: Facebook may have indexing delays

Connection Issues (Free Tier)

  • Intermittent failures: Consider upgrading to Paid tier 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 Paid

Geographic Filtering

  • 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

Media Access

  • 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

Performance Optimization

  • Large datasets: Use date ranges to limit scope
  • Free tier limits: Consider Paid tier for 1000+ ads per query
  • Better results: Upgrade to Paid tier for enterprise-grade stability

๐Ÿ“ˆ Business Intelligence Applications

๐ŸŽฏ Competitive Intelligence

  • Ad Strategy Analysis: Track competitor creative strategies
  • Platform Presence: Monitor competitor activity across platforms
  • Campaign Duration: Analyze campaign lengths and timing

๐Ÿš€ Campaign Optimization

  • Creative Inspiration: Download high-quality assets
  • CTA Analysis: Study effective call-to-action strategies
  • Performance Benchmarking: Compare page engagement metrics

๐Ÿ“Š Market Research

  • Industry Trends: Filter by category for sector analysis
  • Geographic Patterns: Analyze regional strategies
  • Content Evolution: Track messaging changes over time

๐Ÿค Support & Resources

๐Ÿ“ž Support

Get Help

Social Media

๐ŸŽฌ Video & Media

๐Ÿ  Real Estate

๐Ÿ› ๏ธ Developer Tools

๐Ÿ“ฑ Social Media


  • 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