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.
Make a request
GET /tiktok/search accepts query parameters. POST /tiktok/search accepts the same inputs as JSON. Send your project key in the x-access-key header; keep it on your server.
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 request example
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 request example
// 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 request example
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'])Replace placeholder source IDs with real public URLs. See limits and retries before automating calls.
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.