TikTok Content Translation API
Translates a block of text into a target language and returns the translated string. Send the text in src_content and the target language code in trg_lang. Text over 5000 characters is cut to the first 5000 before translation.
Use cases
- Translate a TikTok video caption into your own language before you review it.
- Convert comments from a video into one language so you can compare them.
- Localize a short marketing message into the language of a target audience.
- Translate hashtag or bio text collected from other TikTok APIs.
Request
curl -X POST "https://api.sandbase.ai/v1/api/tiktok/app-v3/content-translate" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
Parameters
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"extra": {
"fatal_item_ids": [],
"logid": "20261103074351BB9CC598720C27019497",
"now": 1793691831000
},
"log_pb": {
"impr_id": "20261103074351BB9CC598720C27019497"
},
"status_code": 0,
"status_msg": "",
"translated_content_list": [
{
"translated_content": "您好,欢迎来到TikHub!",
"variant": "default"
}
]
}
Response fields
Notes
trg_lang defaults to zh-Hans. Pass a different language code to change the target language.
- Both parameters are optional. If you send nothing, the API translates its default sample text to
zh-Hans.
- Read the translation from
translated_content_list[0].translated_content.
- To get text to translate, fetch captions or comments first, for example with TikTok Video Details or TikTok Video Comments (App V3).
Pricing
$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.