Make your first API call in 5 minutes.
Get your API Key
Visit trenz.ai or email us at support@trenz.ai to obtain an API Key (starts with sk_live_).
Your first request
Search TikTok for products related to "phone case":
curl -X GET "https://openapi.gateway.trenz.ai/open/v1/products/search?keyword=phone%20case&country=us&sort=gmv_7d:desc&page=1&page_size=5" \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxx"
Example response:
{
"data": {
"items": [
{
"id": "123456",
"title": "Silicone Phone Case for iPhone 15",
"price": 4.99,
"sales": 52300,
"country": "us"
}
],
"total_count": 1580
},
"request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Code samples
Python
import requests
headers = {
"Authorization": "Bearer sk_live_xxxxxxxxxxxxxxxx"
}
resp = requests.get(
"https://openapi.gateway.trenz.ai/open/v1/products/search",
headers=headers,
params={"keyword": "phone", "country": "us", "page": 1, "page_size": 20}
)
print(resp.json())
Node.js
const resp = await fetch(
"https://openapi.gateway.trenz.ai/open/v1/products/search?keyword=phone&country=us&page=1&page_size=20",
{
headers: {
"Authorization": "Bearer sk_live_xxxxxxxxxxxxxxxx"
}
}
);
const data = await resp.json();
console.log(data);
Authentication
| Method | Example |
|---|
| Authorization header | Authorization: Bearer sk_live_xxx |
| X-API-Key header | X-API-Key: sk_live_xxx |
API keys must start with sk_live_, otherwise the API returns AUTH_INVALID_KEY. Treat your API key as a password and keep it secret.
Last modified on