Facebook Ad Library Scraper avatar

Facebook Ad Library Scraper

Pricing

from $0.00005 / actor start

Go to Apify Store
Facebook Ad Library Scraper

Facebook Ad Library Scraper

Scrape Facebook Ad Library data including ad creatives, targeting info, performance metrics, and advertiser details. Extract ads by keyword, advertiser, or country for competitive research and marketing analysis.

Pricing

from $0.00005 / actor start

Rating

0.0

(0)

Developer

Akash Kumar Naik

Akash Kumar Naik

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Facebook Ad Library Scraper (Apify Actor)

Browser-based Facebook Ad Library scraper for competitor ad research, marketing intelligence, and transparency analysis.

This Actor uses Playwright (no private API) to extract ads from Meta Ad Library search results and deliver structured output in Apify Dataset format.

Why use this scraper

  • Scrape Facebook Ad Library with real browser rendering
  • Collect ad metadata, creatives, links, and snapshot URLs
  • Filter by keyword, ad type, status, media type, and country
  • Run at scale with proxy/session support
  • Monetize efficiently with Apify pay-per-event pricing

Best use cases

  • Competitor ad monitoring
  • Creative trend tracking
  • Paid social market research
  • Brand safety and compliance workflows
  • Regional ad intelligence by country

Key features

  • Browser scraping mode for dynamic Ad Library pages
  • Keyword search with unordered or exact phrase matching
  • GEO targeting through browserCountry (for example US, IN, GB)
  • Pagination-by-scroll extraction with stability stop conditions
  • Duplicate suppression by libraryId
  • Structured dataset and output schemas for downstream automation

Input configuration

Primary fields:

  • searchTerms
  • searchType
  • adType
  • adActiveStatus
  • browserCountry
  • mediaType
  • maxItems
  • maxScrolls
  • startUrls (optional custom Ad Library URLs)
  • proxyConfiguration

Input schema path: .actor/input_schema.json

Output data

Each dataset item contains:

  • source
  • retrievedAt
  • searchTerms
  • ad.libraryId
  • ad.status
  • ad.dateRange
  • ad.pageName
  • ad.adBody
  • ad.domain
  • ad.cta
  • ad.adSnapshotUrl
  • ad.links
  • ad.images
  • ad.videos
  • ad.cardText
  • ad.sourceUrl

Schemas:

  • Input schema: .actor/input_schema.json
  • Dataset schema: .actor/dataset_schema.json
  • Output schema: .actor/output_schema.json

Run summary is stored in key-value store record OUTPUT.

Proxy best practices

  • On Apify platform, keep proxyConfiguration.useApifyProxy enabled for stability.
  • Use Apify Proxy groups/country settings according to your collection goals.
  • The Actor uses session pool and cookie persistence to reduce blocking risk.

Pay-per-event (PPE) optimization

This Actor is optimized for pay-per-event pricing with:

  • apify-actor-start charged once per run ($0.00005)
  • ad-item charged per stored ad record ($0.01)

Behavior:

  • Stops gracefully when event charge limits are reached
  • Exposes charge counts and limit metadata in run summary

Default event config is stored in .actor/pay_per_event.json. Set event pricing in Apify Console using the exact event names above.

Deploy to Apify

apify login
apify push

Local development

npm install
node --check src/main.js
npm start

Notes:

  • Provide either searchTerms or at least one entry in startUrls.
  • Keep browserCountry as a 2-letter ISO country code such as US, IN, or GB.
  • The Docker build now excludes local storage/ data and node_modules/ to keep Apify builds smaller and reproducible.

FAQ

Does this use an official Facebook API?

No. It is a browser scraper that extracts public Ad Library data from rendered pages.

Can I collect ads by country?

Yes. Set browserCountry to a 2-letter country code.

Is the output ready for BI tools and automation?

Yes. Data is stored in Apify Dataset JSON format with stable field names and schema definitions.

Compliance

  • Meta Ad Library content is governed by Meta terms and policies.
  • Use this Actor only for lawful and compliant research or analytics workflows.