---
title: "Search"
method: GET
path: "/v1/scrape/facebook-ad-library/search"
tags: ["facebookAdLibrary"]
---

# Search

`GET /v1/scrape/facebook-ad-library/search`

## Request

- Base URL: `https://api.sociavault.com`
- URL: `https://api.sociavault.com/v1/scrape/facebook-ad-library/search`
- Auth: API key in header `X-API-Key`

Search the Facebook (Meta) Ad Library by keyword. GET requests are capped at approximately 1,500 results due to cursor size limits. For larger result sets, use this endpoint as a POST request with the query parameters passed in the request body.

## Query parameters

- `query` string, required
- `sort_by` 'total_impressions' | 'relevancy_monthly_grouped'
- `search_type` 'keyword_unordered' | 'keyword_exact_phrase'
- `ad_type` 'all' | 'political_and_issue_ads'
- `country` string
- `status` 'ALL' | 'ACTIVE' | 'INACTIVE'
- `media_type` 'ALL' | 'IMAGE' | 'VIDEO' | 'MEME' | 'IMAGE_AND_MEME' | 'NONE'
- `start_date` string
- `end_date` string
- `cursor` string
- `trim` boolean

## Response `200`

Successful response

**Key Response Fields:**
- `is_active`: Whether the ad is currently running
- `ad_archive_id`: The *actual* ad id

## Other responses

- `400`: Bad Request - Invalid parameters or missing required fields
- `401`: Unauthorized - Invalid or missing API key
- `402`: Payment Required - Insufficient credits
- `500`: Internal Server Error - Service configuration or processing error

---

[API](https://skmtc.dev/sociavault/apis/sociavault-api.md) · [All operations](https://skmtc.dev/sociavault/apis/sociavault-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sociavault/apis/sociavault-api/revisions/0a430c97f53a?raw)
