Facebook Ads Library Scraper
by corent1robert
Extract all ads from Facebook Ads Library for any page. Automatically extracts page IDs from Facebook URLs and retrieves complete ad details including...
Opens on Apify.com
About Facebook Ads Library Scraper
Extract all ads from Facebook Ads Library for any page. Automatically extracts page IDs from Facebook URLs and retrieves complete ad details including images, videos, captions, CTAs, and metadata. Supports bulk processing of multiple pages.
What does this actor do?
Facebook Ads Library Scraper is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
Facebook Ads Library Scraper Extract all ads from Facebook Ads Library for any page. Automatically extracts page ID from Facebook page URLs and retrieves essential ad details including images, videos, and metadata. ## What You Get Each ad entry includes essential data: - Page Information: Page ID, name, profile URI - Ad Details: Archive ID, active status, start/end dates, publisher platforms - Content: CTA text, link URL - Performance Metrics: Total impressions (reach), spend, and impression breakdowns (age/country/gender) when available - Media: Images and videos with full metadata (titles, descriptions, CTAs, URLs) ## Quick Start ### Input Enter one or multiple Facebook page URLs using the "Add" button in the Apify interface: Single Page: json { "urls": [ {"url": "https://www.facebook.com/shinetools/"} ] } Multiple Pages (Bulk Mode): json { "urls": [ {"url": "https://www.facebook.com/shinetools/"}, {"url": "https://www.facebook.com/getqonto/"}, {"url": "https://www.facebook.com/anotherpage/"} ] } The scraper will: 1. Automatically extract the page ID from each URL 2. Access Facebook's Ads Library for each page 3. Retrieve all available ads from all pages sequentially ### Optional Parameters json { "urls": [ {"url": "https://www.facebook.com/shinetools/"} ], "activeStatus": "active", "country": "FR", "adType": "ALL", "mediaType": "all", "maxAds": 50 } Parameters: - urls (required): Array of objects with url property containing Facebook page URLs - activeStatus (optional): "active" or "all" (default: "active") - country (optional): ISO country code like "FR", "US", "GB" (default: "FR") - adType (optional): "ALL" or "POLITICAL_AND_ISSUE_ADS" (default: "ALL") - mediaType (optional): "all", "image", or "video" (default: "all") - maxAds (optional): Maximum number of ads to collect per page (default: 100) ## Output Format Each ad in the dataset contains: json { "adArchiveId": "1168819121789187", "pageId": "1010888405712821", "pageName": "Shine", "pageProfileUri": "https://www.facebook.com/shinetools/", "isActive": true, "startDate": "2024-10-15T00:00:00.000Z", "endDate": "2025-01-15T00:00:00.000Z", "publisherPlatform": ["FACEBOOK", "INSTAGRAM", "MESSENGER", "THREADS"], "linkUrl": "https://www.shine.fr/...", "ctaText": "En savoir plus", "impressions": 30797, "spend": 7412, "impressionsBreakdown": { "genderAudience": "Tous", "ageAudience": {"min": 24, "max": 65}, "locations": [ {"name": "France", "type": "countries", "excluded": false, "obfuscatedCount": 0} ], "ageCountryGenderBreakdown": [ { "country": "FR", "breakdowns": [ {"ageRange": "25-34", "male": 6926, "female": 2688, "unknown": 109} // ... ] } ] }, "images": [ { "original": "https://...", "resized": "https://...", "title": "1 600 points de dépôt en France", "body": "Déposez vos espèces en toute simplicité...", "ctaText": "Learn More", "ctaType": "LEARN_MORE", "linkUrl": "https://www.shine.fr/..." } ], "videos": [] } New fields: - impressions: Total reach/impressions for the ad in the EU (if available) - spend: Lifetime spend for the ad in the selected currency (if available) - impressionsBreakdown: Structured breakdown of impressions by country, age, gender, and declared audience information (if provided by Facebook) ## Features - Automatic Page ID Extraction: No need to manually find page IDs - the scraper extracts them automatically from Facebook page URLs - Bulk Processing: Process multiple pages in a single run using the "Add" button - GraphQL API Integration: Direct access to Facebook's Ads Library API - Automatic Pagination: Handles cursor-based pagination automatically - Complete Ad Data: Extracts all available ad information - Media Extraction: Collects images and videos with full metadata - Flexible Filtering: Filter by status, country, ad type, and media type - Rate Limiting Protection: Built-in delays to avoid rate limits ## Performance - Fast extraction using Facebook GraphQL API - ~10 ads per page (configurable) - Automatic pagination with cursor-based navigation - Rate limiting protection with delays between requests - Sequential processing of multiple pages with 2-second delays ## Use Cases - Competitive Analysis: Monitor competitor ad campaigns across multiple pages - Ad Research: Study ad creatives and messaging strategies - Market Intelligence: Track advertising trends and patterns - Content Inspiration: Analyze successful ad formats - Compliance Monitoring: Review political or issue ads ## Configuration ### Recommended Settings - Memory: 1 GB - Timeout: 1800s (30 minutes) - Restart on error: ON ## Notes - Facebook may rate limit requests if too many are made too quickly - Some ads may have limited data depending on privacy settings - The LSD token is automatically extracted from the library page - Cookies and session management are handled automatically - Page IDs are automatically extracted from Facebook page URLs - no manual lookup required
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Facebook Ads Library Scraper now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- corent1robert
- Pricing
- Paid
- Total Runs
- 61
- Active Users
- 8
Related Actors
🏯 Tweet Scraper V2 - X / Twitter Scraper
by apidojo
Instagram Scraper
by apify
TikTok Scraper
by clockworks
Instagram Profile Scraper
by apify
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support