# TikTok keyword search API

Discover public TikTok videos matching a keyword. Use the results as a bounded research sample or as input to your own recurring topic-monitoring workflow.

Canonical: https://fetchfox.net/docs/tiktok-search-api

## Request

GET /tiktok/search (query parameters) or POST /tiktok/search (JSON). Authenticate with x-access-key. Keep keys server-side.

Credits: Minimum 1 credit; 1 per 50 returned results. The API reserves 1 per 20 requested results before processing and settles on the returned count.

### curl

```
curl --fail-with-body --get 'https://api.fetchfox.net/tiktok/search' \
  -H 'x-access-key: YOUR_KEY' \
  --data-urlencode 'query=ceramics' \
  --data-urlencode 'limit=20'
```

### JavaScript

```
// Run on your server with FETCHFOX_API_KEY set.
const url = new URL('https://api.fetchfox.net/tiktok/search');
url.searchParams.set('query', 'ceramics');
url.searchParams.set('limit', '20');
const response = await fetch(url, {
  headers: { 'x-access-key': process.env.FETCHFOX_API_KEY },
  signal: AbortSignal.timeout(130000)
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const result = await response.json();
if (!result.success) throw new Error('Request unsuccessful');
console.log(result.data);
```

### Python

```
import json, os
from urllib.parse import urlencode
from urllib.request import Request, urlopen

query = urlencode({"query":"ceramics","limit":20})
request = Request('https://api.fetchfox.net/tiktok/search?' + query,
    headers={'x-access-key': os.environ['FETCHFOX_API_KEY']})
with urlopen(request, timeout=130) as response:
    result = json.load(response)
if not result.get('success'):
    raise RuntimeError('Request unsuccessful')
print(result['data'])
```

## Search by query, not URL

Send the required query string and an optional limit. The search operation uses query rather than the url parameter used by profile and video reads. A limit is a maximum request size, not a promise of that many results.

## Understand result coverage

Search results can change with the platform’s ranking and availability. The response is not a complete or statistically representative census of videos about a topic. This endpoint does not expose a cursor or a date filter; do not invent those parameters.

## Monitor with a fixed budget

Save the query, retrieval time, source identifiers, and returned data for each run. Deduplicate previously seen items before alerting. If you need to revisit a known video’s metrics, use the single-video stats endpoint.

Start with limit=20 and a manual request. Then choose a schedule whose attempt count and worst-case credit reservation fit your plan. Scheduling, alert delivery, and historical storage belong to your application.

## Related pages

- https://fetchfox.net/guides/tiktok-keyword-monitoring

- https://fetchfox.net/integrations/n8n

- https://fetchfox.net/docs/tiktok-video-stats-api

