VOOZH about

URL: https://apify.com/taupe_thrush/fb-ads-library-scraper-actor

โ‡ฑ Facebook Ads Library Scraper ยท Apify


Pricing

from $4.00 / 1,000 results

Go to Apify Store

Facebook Ads Library Scraper

This Apify Actor scrapes ads from Facebook's Ad Library based on the provided URL. It will extract ad data, including ad content, page information, and targeting details. It automates the browsing process, handles dynamic content loading, and provides structured data output.

Pricing

from $4.00 / 1,000 results

Rating

5.0

(1)

Developer

๐Ÿ‘ MT

MT

Maintained by Community

Actor stats

6

Bookmarked

232

Total users

9

Monthly active users

2 months ago

Last modified

Share

Facebook Ad Library Scraper

This Apify Actor scrapes ads from Facebook's Ad Library based on provided URL. It will extract comprehensive ad data including ad content, page information, and targeting details. It automates the browsing process, handles dynamic content loading, and provides structured data output.

Features

  • Complete Ad Extraction: Extracts all ads from Facebook Ad Library pages, not just the first few
  • Dynamic Content Loading: Automatically scrolls and loads additional ads through GraphQL responses
  • Deduplication: Prevents duplicate ads using persistent storage across runs
  • Comprehensive Data: Extracts ad content, page details, timestamps, and targeting information
  • Flexible Input: Configure the scraper using Facebook Ad Library URLs or page URLs
  • Structured Output: Provides results in clean, machine-readable JSON format

Input Schema

The actor is configured using a JSON object with the following properties.

URLs (Required)

You must provide Facebook Ad Library URLs or Facebook page URLs to scrape.

{
"startUrls":[
{
"url":"https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=123456789",
"method":"GET"
},
{
"url":"https://www.facebook.com/examplepage/",
"method":"GET"
}
]
}

Input Parameters

{
"startUrls":[
{
"url":"https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=123456789",
"method":"GET"
}
],
"maxScrolls":10,
"waitTime":5000
}

Input Fields

  • startUrls (array, required): List of Facebook Ad Library URLs or Facebook page URLs to scrape
  • maxScrolls (integer, optional): Maximum number of scroll attempts to load more ads (default: unlimited)
  • waitTime (integer, optional): Wait time in milliseconds between actions (default: 5000)

Supported URL Types

  1. Facebook Ad Library URLs: Direct links from Facebook's Ad Library with search parameters

    • Example: https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=123456789
  2. Facebook Page URLs: Direct Facebook page URLs that will be converted to Ad Library searches

    • Example: https://www.facebook.com/examplepage/

Output

The actor returns a dataset where each item represents a scraped Facebook ad.

Example Ad Output Item

{
"ad_archive_id":"123456789012345",
"page_id":"987654321098765",
"snapshot":{
"body":{
"text":"Discover our latest collection! Limited time offer."
},
"caption":"shop.example.com",
"ctaText":"Shop Now",
"ctaType":"SHOP_NOW",
"linkUrl":"https://shop.example.com/collection",
"title":"Summer Collection 2024",
"images":[
"https://scontent.example.com/image1.jpg"
],
"videos":[],
"pageId":"987654321098765",
"pageName":"Example Store"
}
}

Output Fields

The actor extracts the following fields for each ad:

  • Ad Identification: ad_archive_id, page_id
  • Ad Content: snapshot.body.text, snapshot.title, snapshot.caption
  • Call-to-Action: snapshot.ctaText, snapshot.ctaType, snapshot.linkUrl
  • Media: snapshot.images, snapshot.videos
  • Page Information: snapshot.pageId, snapshot.pageName

How It Works

  1. Page Loading: The scraper loads Facebook Ad Library pages or converts page URLs to Ad Library searches
  2. Initial Extraction: Extracts ads from initial page scripts containing ad_library_main data
  3. Dynamic Loading: Scrolls through the page to trigger GraphQL requests for additional ads
  4. Deduplication: Uses persistent storage to prevent duplicate ads across runs
  5. Data Processing: Processes each ad's collated results and snapshot data
  6. Output: Saves each unique ad as a separate item in the dataset

Why Scrape Facebook Ads?

๐Ÿ’ช Competition Intelligence: Analyze competitor advertising strategies and messaging

๐Ÿ•ต๏ธ Market Research: Understand industry trends and advertising patterns

๐Ÿ“ˆ Brand Monitoring: Track how brands present themselves across different campaigns

๐Ÿคณ Creative Analysis: Study ad creative elements and copywriting approaches

๐Ÿ“Š Performance Insights: Gather data for advertising strategy optimization

Usage

  1. Navigate to the Actor page on the Apify platform
  2. Click "Try actor"
  3. Enter your input configuration in the JSON editor with Facebook Ad Library URLs or page URLs
  4. Configure optional parameters like maxScrolls and waitTime if needed
  5. Click "Start" to run the actor
  6. Once the run is complete, view and download the results from the "Dataset" tab

Technical Notes

  • The scraper handles dynamic content loading through GraphQL responses
  • Deduplication is implemented using persistent KeyValue storage
  • Each ad is saved as a separate dataset item for easier analysis
  • The scraper respects Facebook's rate limits and includes appropriate delays
  • Supports both initial page script extraction and dynamic content loading

Legal and Ethical Considerations

This scraper only extracts publicly available advertising data from Facebook's Ad Library. It does not:

  • Extract private user information
  • Bypass Facebook's intended public access mechanisms
  • Violate Facebook's terms of service for public ad data

The Facebook Ad Library is designed for transparency and public access to advertising content. However, you should:

  • Respect rate limits and avoid overwhelming Facebook's servers
  • Use the data responsibly and in compliance with applicable laws
  • Consider Facebook's Terms of Service and robots.txt guidelines

Limitations

  • The scraper may not capture ads that are heavily restricted by geographic or demographic targeting
  • Some ads may have limited visibility based on Facebook's algorithmic decisions
  • Performance may vary based on page size and ad volume
  • Dynamic content loading depends on Facebook's current implementation

You might also like

Zapier App Scraper

creatormagic/zapier-app-scraper

Scrapes application data from the Zapier apps directory based on category and sorting preferences.

20

Facebook Ads Library Scraper

scraper-engine/facebook-ads-library-scraper

The Facebook Ads Library Scraper extracts ad data from Facebookโ€™s Ad Library, including advertiser details, ad text, impressions, and targeting info. Ideal for ad research, marketing insights, and competitor analysis, it delivers clean, structured data for analysis or integration via API.

๐Ÿ‘ User avatar

Scraper Engine

403

4.2

Facebook Ad Library Scraper

practicaltools/facebook-ad-library-scraper

Scrapes ads from the Facebook Ad Library. Accepts search URLs or Facebook page URLs and returns structured ad data.

๐Ÿ‘ User avatar

Practical Tools

49

Facebook Ad Library Scraper

rastriq/fb-adlibrary-scraper

Scrapes ads from Facebook Ad Library. Select the brand and extract the historical ads.

๐Ÿ‘ User avatar

Rastriq โ€” Structured data from the world

2

Facebook Ad Library Scraper

agenscrape/facebook-ad-library-scraper

Extract ads from Facebook Ad Library instantly. Get complete ad details, images, videos, page info, impressions, and targeting data. Just paste the Ad Library URL and run. Fast, reliable extraction for competitor research and market analysis.

Facebook Ad Library Scraper

corner_cutter/facebook-ad-library-scraper

Comprehensive Meta ad library tool that fetches all ads for a given Facebook Ad Library URL or page URL. Extract ad creatives, copy, targeting info, and more.

650

3.9

Facebook Ad Library Scraper

scraper-engine/facebook-ad-library-scraper

Facebook Ad Library Scraper extracts ads from the Facebook Ad Library. It collects ad text, advertiser names, ad creatives, start dates, platforms, and engagement details. Ideal for competitor analysis, ad research, marketing insights, and tracking advertising trends.

๐Ÿ‘ User avatar

Scraper Engine

2

Facebook Ads Library Scraper API

api_creators/facebook-ads-library-scraper-api

$1 per 1000 ads! Scrape Facebook Ad Library: Extract ad data, copy & creatives from FB & Instagram. Powerful Facebook Ads Scraper for competitor research & ad intelligence. Search by keyword or Page ID. Export JSON, CSV, or Excel. Fast, reliable, and cheap Facebook Ad Library API.

150

5.0

Facebook Ad Library Scraper

prodiger/facebook-ads-library-scraper

Scrape Facebook ads from Ad Library search results and ads run by Facebook pages. Pay per ad at $0.75 per 1,000 ads.

Facebook Ad Library Scraper (Keyword Search)

scraped/facebook-ad-library-scraper-keyword-search

Scrape data from Facebook Ad Library based on your keyword.