Search Ads
fb-adlibrary.ad.search
Searches the Facebook Ad Library by keyword. Returns raw ad data including creative content, targeting info, spend data, and all metadata. Supports filtering by language, platform, media type, active status, date range, and sorting.
Request
curl -X POST https://data.upscrape.com/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"country":"US","limit":5,"query":"nike"},"capability":"fb-adlibrary.ad.search"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
active
| string | optional | Filter by active status: all, active, inactive (default: all) |
country
| string | optional | ISO country code (default: US) |
end_date
| string | optional | Filter ads with impressions until this date (YYYY-MM-DD) |
languages
| array<string> | optional | Filter by content language codes (e.g. ["en", "es"]) |
limit
| integer | optional | Maximum number of ads to return (default: 50) |
media_type
| string | optional | Filter by media type: all, image, video, meme, none (default: all) |
platforms
| array<string> | optional | Filter by publisher platform: facebook, instagram, messenger, audience_network |
query
| string | required | Search keyword or phrase |
sort_by
| string | optional | Sort results: relevance, date, impressions (default: impressions) |
start_date
| string | optional | Filter ads with impressions from this date (YYYY-MM-DD) |
Output
| Field | Type | Required | Description |
|---|---|---|---|
items
| array<object> | required | Raw ad payloads returned by Facebook's GraphQL API. |
next_cursor
| string | optional | Pagination cursor for the next page, if present. |
total_items
| integer | required | Number of items returned in this response. |