# Search TikTok Ads Library ads

Returns public Ads Library ads for `region`, `start_time`, `end_time`, and `query`. `search_type` and `advertiser_id` narrow the match; `sort` orders results. Pages hold up to 12 ads: send `search_id` with `offset` to page.

- Platform: TikTok Ads Library
- Request: `GET https://api.toolzerhub.com/v1/tiktok-ads/search`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/tiktok-ads-library/public-library/tik-tok-ads-search

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `region` | query | yes | string | Two-letter region code returned by /regions. Must be a country the Ads Library covers — the EEA, Switzerland, the UK, or Turkey. A country served only by Creative Center's Top Ads, such as the US or Brazil, is rejected; use the Top Ads endpoints for those. |
| `start_time` | query | yes | string | Inclusive start of the requested date range as a Unix timestamp in seconds. |
| `end_time` | query | yes | string | End of the requested date range as a Unix timestamp in seconds. Must be greater than or equal to start_time. |
| `query` | query | yes | string | Search text, selected advertiser name, selected keyword, or exact phrase, according to search_type. |
| `search_type` | query | no | enum: free_text, advertiser, keyword, exact_phrase | How query is matched: free_text for typed text, advertiser for a selected advertiser (needs advertiser_id), keyword for a selected keyword, exact_phrase for the whole phrase. Default: free_text. |
| `advertiser_id` | query | no | string | Advertiser id from the /suggestions response. Required when search_type is advertiser. |
| `sort` | query | no | enum: last_shown_desc, last_shown_asc, published_desc, published_asc, impressions_asc, impressions_desc | Sort by last-shown date, publication date, or impressions in ascending or descending order. Default: last_shown_desc. |
| `offset` | query | no | integer | Where the page starts. Page one is 0; for later pages send search_id from the previous response alongside it. Default: 0. |
| `search_id` | query | no | string | Cursor from the previous search response. Send it to get the next page, and use the newest one each time. |
| `limit` | query | no | integer | Ads per page, 1 to 12. TikTok caps public search pages at 12. Default: 12. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/tiktok-ads/search?region=<region>&start_time=<start_time>&end_time=<end_time>&query=<query>" \
  -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.
