Meta Ad Scrapper - 100% working avatar
Meta Ad Scrapper - 100% working

Pricing

$1.25 / 1,000 ads

Go to Apify Store
Meta Ad Scrapper - 100% working

Meta Ad Scrapper - 100% working

Developed by

Anas Nadeem

Anas Nadeem

Maintained by Community

Scrapes Meta/Facebook ads from the ad library with detailed ad information including title, description, images, videos, CTA, Social platform and metadata

0.0 (0)

Pricing

$1.25 / 1,000 ads

0

6

6

Last modified

8 days ago

Meta Ads Scraper

A powerful Apify actor that scrapes Meta/Facebook ads from the ad library, extracting detailed information including images, videos, and metadata.

Features

  • Comprehensive Ad Data: Extracts brand, body text, CTA, links, images, videos, and metadata
  • Multiple Platform Support: Tracks ads across different platforms
  • Robust Scraping: Handles dynamic content loading and multiple selectors
  • Error Handling: Gracefully handles failures and logs detailed information
  • Scalable: Configurable concurrency and timeout settings

Input Parameters

Required

  • targetUrl (string): Meta ad library URL to scrape

Optional

  • maxConcurrency (integer): Maximum number of concurrent requests (default: 1, max: 10)
  • requestHandlerTimeoutSecs (integer): Timeout for each request in seconds (default: 300, max: 600)

Output Format

The actor outputs structured data for each scraped ad:

{
[
{
"libraryID": "12345678900",
"brand": "Example Brand",
"industry": "Technology",
"active": true,
"platforms": ["Facebook", "Instagram"],
"totalPlatforms": 2,
"similarAdCount": 3,
"multipleVersions": true,
"body": "Check out our amazing new product!",
"linkTitle": "Amazing Product",
"linkUrl": "https://example.com/product",
"linkDescription": "The best product you'll ever use",
"ctaText": "Shop Now",
"ctaUrl": "https://example.com/shop",
"images": [
{
"url": "https://example.com/image1.jpg"
}
],
"videos": [
{
"url": "https://example.com/video1.mp4",
"duration": 30
}
],
"scrapeDate": "2024-01-01T12:00:00.000Z",
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-01-31T23:59:59.000Z",
"runningTAT": 30,
"format": "video"
}
]
}

Usage Examples

Basic Usage

{
"targetUrl": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&media_type=all"
}

Advanced Usage

{
"targetUrls": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=US&media_type=all"
,
"maxConcurrency": 2,
"requestHandlerTimeoutSecs": 300
}

Error Handling

The actor includes comprehensive error handling:

  • Failed URLs are logged and saved to key-value store
  • Individual ad parsing errors don't stop the entire process
  • Detailed console logging for debugging
  • Graceful handling of page loading issues

Performance Considerations

  • Concurrency: Start with maxConcurrency: 1 and increase based on your needs
  • Timeout: Adjust requestHandlerTimeoutSecs based on page complexity
  • Rate Limiting: The actor respects website rate limits and includes delays

Common Issues

  1. No ads found: Check if the URL is accessible and contains ads
  2. Timeout errors: Increase requestHandlerTimeoutSecs for slow-loading pages
  3. Selector changes: Facebook may update their CSS selectors; the actor uses multiple fallback selectors

Technical Details

  • Built with Apify SDK and Crawlee
  • Uses Puppeteer for browser automation
  • Handles dynamic content loading with scroll-based pagination
  • Implements duplicate detection to avoid scraping the same ad multiple times

Support

For issues or questions, please check the Apify Console logs for detailed error information.

Contact - anas5678go@gmail.com for enterprise support