Facebook Ads Library Scraper avatar
Facebook Ads Library Scraper

Pricing

$5.00/month + usage

Go to Apify Store
Facebook Ads Library Scraper

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.

Pricing

$5.00/month + usage

Rating

0.0

(0)

Developer

Corentin Robert

Corentin Robert

Maintained by Community

Actor stats

0

Bookmarked

5

Total users

2

Monthly active users

4 days ago

Last modified

Share

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:

{
"urls": [
{"url": "https://www.facebook.com/shinetools/"}
]
}

Multiple Pages (Bulk Mode):

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

{
"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:

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

  • 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