List Facebook Ad Library company ads
Returns ads from one company or page in the Facebook Ad Library, ordered by impressions or recency depending on sort_by. Same per-ad shape as /v1/facebook/adlibrary/ad: video creatives in content.media_urls and content.thumbnail_url, every ad signal on the post.ext.ad envelope (CTA, link_url, active status, dates, display format, headline, video URLs, plus the advertiser's page_profile_uri, page_like_count and page_categories). spend and reach_estimate are populated for POLITICAL and issue ads only and read null on commercial advertisers. engagement.views carries Facebook's audience REACH ESTIMATE, not a view count (an ad has no public view count); it is null on commercial advertisers and the same figure rides post.ext.ad.reach_estimate under its real name. published_at is the ad's first-run DATE: the 07:00:00Z clock component is an artefact of Facebook's US Pacific day boundary and carries no sub-day meaning. post.author.username is null by design (an Ad Library record carries the page name, not its handle). A plain row carries no audience breakdown. Send include=audience and every ad is joined, in the same call, to the per-ad lookup: on an ad that ran in the EU, post.ext.ad.eu_total_reach is the total EU reach, post.ext.ad.eu_reach_breakdown lists each EU country with that reach split into age bands (18-24 to 65+) by male, female and unknown, and target_ages, target_gender and target_locations are who the advertiser targeted. These are counts Facebook publishes under EU transparency rules, so an ad that never ran in the EU has none of them and its row is refunded. Cost: 5 credits for the page plus 1 credit per ad filled from a fresh lookup (30 ads a page, so 35 credits at most); rows already in cache are free, rows that could not be filled are refunded, and a repeat of the same call within the cache window is 0 credits. Time: include=audience adds 3 to 6 seconds on a fresh page (the lookups run in parallel and the call waits for the slowest, never more than 12 seconds). The response carries a hydration block itemising rows, lookups, cache hits, credits and milliseconds.
Request
- Base URL: https://www.socialcrawl.dev/v1
- URL: https://www.socialcrawl.dev/v1/facebook/adlibrary/company/ads
- Auth: API key in header x-api-key
Query parameters
Facebook page ID of the advertiser (one of: pageId, companyName; at least one required)
The name of the company. Can either use this or pageId (one of: pageId, companyName; at least one required)
This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
Status of the ad. Defaults to ACTIVE.
Media type of the ad. Defaults to ALL. Meme refers to ads with image and text. Not sure why they call it meme.
Language to filter ads on. Needs to be 2 letter language code, ie EN, ES, FR, etc
Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
Start date to search for. Format: YYYY-MM-DD
End date to search for. Format: YYYY-MM-DD
Cursor to paginate through results
Set to true for a trimmed down version of the response
Set to audience (one token only) to fill, on every ad that ran in the EU, post.ext.ad.eu_total_reach, post.ext.ad.eu_reach_breakdown (reach per EU country by age band and gender), post.ext.ad.targets_eu, target_ages, target_gender and target_locations. Holds 1 credit per ad (30 a page) and keeps only the rows filled from a fresh lookup; rows already in cache, ads that never ran in the EU and rows the lookup cannot fill are refunded, so a page is never more than 35 credits. The join takes 3 to 6 seconds on a fresh page, never more than 12 seconds a row, and nothing when the rows are already cached; read data.hydration for the rows, the credits held and kept, and the time. Without it the call is unchanged.
Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Rows older than it are left off each page. This list is not in date order, so the walk does not stop at the date: keep following next_cursor, and each page costs what a page costs even when every row on it is filtered out. A row with no date is kept. published_after, start_date, from_date, publish_time (yesterday, this-week, this-month, last-3-months, last-6-months) and max_age_days are accepted and applied as since.
Only rows published on or before this date: YYYY-MM-DD (that whole UTC day is included) or an ISO 8601 timestamp. Newer rows are left off each page and the walk does not stop, so older pages follow. A row with no date is kept. published_before, end_date and to_date are accepted and applied as until.
Headers
Send no-cache to bypass the response cache and force a live fetch. Billed at the normal endpoint cost; the fresh result is written back to cache for the next caller. Only the no-cache directive triggers this. See the Response Schema guide for details.
Optional UUID that makes the request safely retriable. The key is reserved atomically per account before billing. A concurrent retry receives 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After of 1 second while the original is young, growing to a quarter of the time it has been running (at most 30); a crashed reservation expires after 5 minutes. A replay keeps the cached payload immutable except for billing metadata: credits_used becomes 0, idempotent_replay becomes true, and credits_remaining is refreshed to the current balance. A known current balance appears in both the body and X-Credits-Remaining header; no balance row resolves to 0. On a transient lookup failure, body credits_remaining is null and X-Credits-Remaining is omitted. Completed outcomes expire after 24 hours. If the claim store is unavailable, the request fails closed before billing. GET endpoints do not combine idempotent replay with Server-Sent Events: use Accept: application/json when sending this header. The unsupported key-plus-SSE combination is rejected before billing.
Response
Successful response
Example response
{
"success": true,
"platform": "facebook",
"endpoint": "/v1/facebook/adlibrary/company/ads",
"credits_used": 1,
"credits_remaining": 4999,
"request_id": "req-abc123",
"idempotent_replay": true,
"meta": {
"hint": {
"code": "search_multi",
"message": "You searched \"matcha\" on 3 platforms one call at a time; /v1/search/multi returns each platform's own search rows in one call at the same price per platform, and a platform with no rows is not charged.",
"method": "GET",
"path": "/v1/search/multi?query=matcha&platforms=instagram,tiktok,youtube"
}
},
"pagination": {
"next_cursor": "sc.eyJ2IjoyLCJjIjoiMiIsInAiOiJwYWdlIn0",
"has_more": true,
"page_size": 30,
"stopped_at": "known_id"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.