Facebook Ad Library Scraper
Pricing
from $0.40 / 1,000 results
Facebook Ad Library Scraper
Scrapes ads from Facebook Ad Library. Select the brand and extract the historical ads.
Pricing
from $0.40 / 1,000 results
Rating
0.0
(0)
Developer
Rastriq — Structured data from the world
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
0
Monthly active users
2 days ago
Last modified
Categories
Share
Extracts ads from Facebook's public Ad Library by intercepting internal GraphQL calls. No API key or Facebook login required.
Uses Playwright + residential proxy to load the Ad Library page and capture GraphQL ad data. 4 GB memory recommended.
What it does
Navigates to facebook.com/ads/library with your search query, scrolls to load more results, and intercepts the internal GraphQL responses that contain ad data.
Three search modes
| Mode | Field | When to use |
|---|---|---|
| Domain search | domain | You know the advertiser's website (e.g. toyota.cl). More precise — uses exact-phrase matching. |
| Keyword search | keyword | You only know the brand name. Broader results. |
| Page ID search | view_all_page_id | You know the Facebook Page ID. Zero-noise mode — returns ONLY ads from that specific page. Most precise. |
If multiple fields are set, priority is: view_all_page_id > domain > keyword.
Finding a Page ID
- Go to
facebook.com/ads/libraryand search for the brand - Click on an ad from the advertiser you want
- Click "See all ads from this advertiser"
- The URL will contain
view_all_page_id=XXXXXXXXXXXX— that number is the Page ID
Output fields
Core fields (all modes)
| Field | Type | Description |
|---|---|---|
ad_archive_id | string | Facebook ad archive ID (deduplication key) |
page_id | string | Advertiser page ID |
page_name | string | Advertiser page name |
page_url | string | Advertiser page URL |
status | string | active / inactive |
body | string | Ad text content (max 600 chars) |
link_url | string | Destination URL |
link_title | string | Link card title |
start_date | string | First shown date (YYYY-MM-DD) |
end_date | string | Last shown date (YYYY-MM-DD, null if still active) |
platforms | string | Platforms (facebook, instagram, etc.) |
media_type | string | text / image / video |
v0.6 new fields
| Field | Type | Description |
|---|---|---|
ad_url | string | Direct URL to view the ad in Facebook Ad Library (facebook.com/ads/library/?id=...) |
creative_url | string | URL of the ad creative asset (video HD/SD URL or image URL). Extracted from the ad snapshot. |
cta_type | string | Call-to-action type (e.g. LEARN_MORE, SHOP_NOW, SIGN_UP). From the ad snapshot. |
impressions_lower | integer | Lower bound of estimated impressions (EU transparency data only). |
impressions_upper | integer | Upper bound of estimated impressions (EU transparency data only). |
spend_lower | integer | Lower bound of estimated ad spend (EU transparency data only). |
spend_upper | integer | Upper bound of estimated ad spend (EU transparency data only). |
spend_currency | string | Currency code for spend fields (e.g. EUR). |
Note:
impressions_*andspend_*fields are populated only for EU countries where Facebook is required to disclose this data under the EU Digital Services Act. For non-EU countries (e.g. CL, MX, US), these fields will benull.
Example inputs
Domain mode
{"domain": "toyota.cl","country": "CL","maxResults": 100}
Page ID mode (zero-noise)
{"view_all_page_id": "303915015690","country": "CL","maxResults": 200}
Cost estimate
- 50 ads (test): ~$0.003, ~1–2 minutes
- 200 ads: ~$0.01, ~3–5 minutes
- 500 ads: ~$0.02, ~8–12 minutes
Memory: 4096 MB (Playwright required; Facebook runs heavy JS).
Proxy
Residential proxies are required — Facebook blocks datacenter IPs systematically. The actor defaults to RESIDENTIAL proxy group.
Notes
- Facebook may show a cookie consent dialog; handled automatically
- Results depend on scroll depth: more
maxResults= more scrolling = more time - Deduplicates by
ad_archive_id - The Ad Library shows all active and recently inactive ads (last 7 years for political ads, 90 days for others)
creative_urlandcta_typeare extracted from Facebook's inline snapshot data — coverage depends on the ad format (typically 70-80% for creative_url, 40-50% for cta_type)
Legal
Accesses only publicly visible ad data — the same data available at facebook.com/ads/library without login. No personal user data is collected.
Related Rastriq Actors
Ad library scrapers
All four share a normalized output schema — same field names, same formats. Merge datasets from different platforms without a mapping layer.
| Actor | What it adds |
|---|---|
| TikTok Ad Library Scraper | Ad creatives, targeting and spend data from TikTok's EU transparency archive |
| Google Ads Transparency Scraper | Search, Display and YouTube ads from Google's Ads Transparency Center |
| LinkedIn Ad Library Scraper | B2B ads from LinkedIn's Ad Library |