# Search Meta ads by keyword

Searches the public Meta Ad Library (Facebook and Instagram ads) for required `q`. Filter by country, delivery status, ad type, media type, dates, language, platform, advertiser page, and reach. Use `cursor` to page; `page_size` is 1-50.

- Platform: Meta Ads
- Request: `GET https://api.toolzerhub.com/v1/meta/search`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/meta-ads/search-ads

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `q` | query | yes | string | Search keyword, phrase, or advertiser name. |
| `country` | query | no | string | ISO 3166-1 alpha-2 country code. Examples: IN, US, GB, DE. |
| `active_status` | query | no | enum: all, active, inactive | Ad delivery status. all = active and inactive ads, active = currently running ads, inactive = stopped ads. |
| `ad_type` | query | no | enum: ALL, POLITICAL_AND_ISSUE_ADS, HOUSING_ADS, EMPLOYMENT_ADS, CREDIT_ADS | Ad category. ALL includes all ad types; other values narrow results to the selected category. |
| `search_type` | query | no | enum: keyword_unordered, keyword_exact_phrase | Query match mode. keyword_unordered matches all words in any order; keyword_exact_phrase matches the exact phrase. |
| `media_type` | query | no | enum: all, image, video, meme | Creative format filter. all = every format, image = static images, video = videos, meme = image/text meme-style creatives. |
| `sort_mode` | query | no | enum: total_impressions | Sort by total impressions. |
| `sort_direction` | query | no | enum: desc | Sort direction. Use with sort_mode. |
| `cursor` | query | no | string | Pass pageInfo.cursor from the previous response to get the next page. Omit for the first page. |
| `page_size` | query | no | integer | Number of ads to return per request. Accepted range: 1-50. |
| `date_min` | query | no | string | Start Date in YYYY-MM-DD format. |
| `date_max` | query | no | string | End Date in YYYY-MM-DD format. |
| `content_languages` | query | no | string | Comma-separated ISO 639-1 language codes, for example en,hi. |
| `publisher_platforms` | query | no | string | Comma-separated platforms. Accepted values: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER. |
| `page_ids` | query | no | string | Comma-separated page IDs to limit results to selected advertisers. |
| `is_targeted_country` | query | no | boolean | When true, only return ads targeted to the selected country. |
| `potential_reach_min` | query | no | integer | Minimum estimated audience size. |
| `potential_reach_max` | query | no | integer | Maximum estimated audience size. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/meta/search?q=<q>" \
  -H "x-api-key: $TOOLZERHUB_API_KEY"
```

Success responses are wrapped as `{ "data": ... }`. Errors return `{ "error": { "code", "status", "message", "retryable", "details" } }`. See https://docs.toolzerhub.com/docs/responses-and-errors.
