Facebook Ad Library Scraper
Pricing
from $0.00005 / actor start
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
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
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 exampleUS,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:
searchTermssearchTypeadTypeadActiveStatusbrowserCountrymediaTypemaxItemsmaxScrollsstartUrls(optional custom Ad Library URLs)proxyConfiguration
Input schema path: .actor/input_schema.json
Output data
Each dataset item contains:
sourceretrievedAtsearchTermsad.libraryIdad.statusad.dateRangead.pageNamead.adBodyad.domainad.ctaad.adSnapshotUrlad.linksad.imagesad.videosad.cardTextad.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.useApifyProxyenabled 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-startcharged once per run ($0.00005)ad-itemcharged 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 loginapify push
Local development
npm installnode --check src/main.jsnpm start
Notes:
- Provide either
searchTermsor at least one entry instartUrls. - Keep
browserCountryas a 2-letter ISO country code such asUS,IN, orGB. - The Docker build now excludes local
storage/data andnode_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.