# TikTok Ads Library Search Ads API

> Search the TikTok Ad Library for ads matching a query (advertiser name or keyword).

Source: https://www.sandbase.ai/apis/tiktok-ads-library/search-ads
API reference: https://www.sandbase.ai/apis/tiktok-ads-library/search-ads#api

## Facts

- Provider: TikTok Ads Library
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/tiktok-ads-library/search-ads`
- Price: $0.06 per call
- Capabilities: api, tiktok ads library, ads, ad library
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/tiktok-ads-library/search-ads` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `query` | string | yes |  |
| `limit` | integer | no |  |
| `offset` | integer | no |  |
| `region` | string | no | all, FR, DE, GB |
| `sort_by` | string | no | last_shown_date,desc, last_shown_date,asc |
| `end_time` | integer | no |  |
| `search_id` | string | no |  |
| `start_time` | integer | no |  |

## FAQ

### How do I use the TikTok Ads Library Search Ads API?

Send a POST request to https://api.sandbase.ai/v1/api/tiktok-ads-library/search-ads with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the TikTok Ads Library Search Ads API cost?

$0.06 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.

### What parameters does the TikTok Ads Library Search Ads API accept?

Required: query (string). Optional: limit (integer), offset (integer), region (one of all, FR, DE, GB), sort_by (one of last_shown_date,desc, last_shown_date,asc), end_time (integer) and search_id (string) and 1 more. The Parameters table and the Playground on this page list every field.

### What does the TikTok Ads Library Search Ads API return?

A JSON response returned in the same HTTP request (synchronous).

### Do I need a TikTok Ads Library developer account or API key?

No. TikTok Ads Library Search Ads runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for TikTok Ads Library API access separately.

## README

### TikTok Ads Library Search Ads API

Search the TikTok Ad Library for ads matching a query (advertiser name or keyword).

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "tiktok-ads-library/search-ads", "limit": 12, "query": "nike", "offset": 0, "region": "all", "sort_by": "last_shown_date,desc", "search_id": ""}'
```

The result is returned in `outputs[0].data`.

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | Search query (advertiser name or keyword) |
| `end_time` | integer | No | End of date range as Unix timestamp (seconds). Defaults to now. |
| `limit` | integer | No | Number of results per page (max 50) |
| `offset` | integer | No | Pagination offset (0-based). Requires search_id from a previous response for values > 0. |
| `region` | string | No | Region/country code filter (e.g. 'FR', 'DE', 'GB') or 'all' for all regions. Use get_supported_regions for the full list of accepted codes. One of: `all`, `FR`, `DE`, `GB`. |
| `search_id` | string | No | Search ID returned from a previous search_ads call. Required when offset > 0 to paginate through results. |
| `sort_by` | string | No | Sort order: 'last_shown_date,desc' or 'last_shown_date,asc' One of: `last_shown_date,desc`, `last_shown_date,asc`. |
| `start_time` | integer | No | Start of date range as Unix timestamp (seconds). Defaults to 1 year ago. |

#### Pricing

Flat $0.06 per call. Failed calls are not charged.
