Docs/Facebook Ads Search
Docs / API reference
POST/v1/data/facebook-ads/search
Facebook Ads Search
Search public Facebook Ads Library records by keyword, page ID, or direct Ads Library URLs. Returns ad archive IDs, page metadata, copy, CTA, media counts/assets, platforms, activity dates, and library URLs.
Execution model
Live request
Runtime depends on endpoint, target, pagination, rendering mode, and active plan limits.
Credit weight
Live catalog
Current weights are managed from the Data API Weights admin table and shown on pricing before use.
Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
| query | string | Optional | Keyword search query. Required unless url, urls, or page_id is supplied. |
| url | string | Optional | Direct Facebook Ads Library URL. |
| urls | string[] | Optional | Batch of direct Ads Library URLs. |
| country | string | Optional | Two-letter country code. |
| active_status | string | Optional | all, active, or inactive. |
| media_type | string | Optional | Media type filter. |
| page_id | string | Optional | Facebook page ID. |
| start_date | string | Optional | Start date filter. |
| end_date | string | Optional | End date filter. |
| publisher_platforms | string[] | Optional | Publisher platforms such as facebook or instagram. |
| scrape_ad_details / scrapeAdDetails | boolean | Optional | Return full snapshot media/detail fields when available. |
| limit / count / limitPerSource | number | Optional | Maximum ads to return (1-50). |
| cursor | string | Optional | Pagination cursor from a previous response. |
| timeout_ms | number | Optional | Provider timeout in milliseconds (5000-90000). |
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the request completed successfully. |
| ads | array | Ad rows with ad_archive_id, active status, page metadata, body, title, caption, CTA, link URL, images, videos, platforms, dates, reach/spend, and ad_library_url. |
| cursor / has_next_page | string | boolean | Pagination metadata. |
| time_taken | number | API response time in seconds. |
Request and response
curl -X POST "https://api.datablue.dev/v1/data/facebook-ads/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "kiro beauty",
"country": "IN",
"active_status": "active",
"limit": 10,
"scrapeAdDetails": true
}'Example response
{
"success": true,
"source": "facebook_ads_library",
"operation": "search",
"query": "kiro beauty",
"country": "IN",
"total_results": 1,
"time_taken": 2.5,
"ads": [
{
"position": 1,
"ad_archive_id": "1234567890",
"is_active": true,
"page_name": "Kiro Beauty",
"body": "Clean beauty essentials",
"cta_text": "Shop Now",
"image_count": 1,
"video_count": 0,
"publisher_platforms": [
"facebook",
"instagram"
],
"ad_library_url": "https://www.facebook.com/ads/library/?id=1234567890"
}
]
}