TikTok Translate Content
Translate text into a chosen language. Provide the source text and target language in request_body: trg_lang is the target language code (defaults to zh-Hans), and src_content is the text to translate. Supported codes are zh-Hans, zh-Hant, en, ja, ko, fr, de, ru, es, pt, vi, th, id, ar, it, tr, he, pl, nl, sv, da, fi, no, cs, and hu. If src_content exceeds 5,000 characters, only its first 5,000 characters are translated. The response returns translation data; the data field may be null if no result is available.
Pricing
| Condition | Charge |
|---|---|
| Each call | 2.07 credits/call |
2.07 credits/call Charges are per query. A successful query is billed even if it returns no results.
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
request_body | object | Yes | Request body object containing trg_lang, the target language, and src_content, the source text to translate. | — |
request_body.trg_lang | string | No | 目标语言ISO639-1代码,例如:zh-Hans/ Target language ISO639-1 code, e.g. zh-Hans | zh-Hans |
request_body.src_content | string | No | 源语言内容,也就是需要翻译的内容/ Source language content, i.e. the content to be translated | Hello, welcome to TikHub! |
Invocation example
Copy the request and explore its response example.
/agent-api/v1/tool/executeX-Api-Keycurl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_tiktok_translate_content' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"request_body": {
"src_content": "discoverwildlife.com BBC WILDLIFE 3\n\nRare Earth\nHow will the environment be changed by an Andy Burnham government? Tom Heap and Helen Czerski reveal the big decisions that will need to be taken on nature protection, energy and transport in the episode Andy'\''s Green In-Tray. Catch up on BBC Sounds\n\nThe Inquiry\nIn Should Rivers Have Personhood? Professor Nick Mount, geographer and river scientist; Pier-Olivier Boudreault, director of conservation for the Canadian Parks and Wilderness Society; and others, discuss the ins and outs of this concept. Catch up on BBC Sounds\n\nCrowdScience\nIn the recent episode How Do Electric Fish Make Electricity? Brazilian ecologist Nonato Junior is among the experts who help to explain how fish such as electric eels have developed this weapon - and how on Earth they manage not to electrocute themselves. Catch up on BBC Sounds\n\nBack during the Covid-19 pandemic, when we were allowed out for an hour a day, my son and I used to play football or cricket on a field next to a small community garden with a pond. Every day, before heading home at the end of our allotted time, we always stole a look at the frogspawn, following the tiny amphibians'\'' development over the weeks. Ever since, I'\''ve looked at frogs as tiny beacons of hope, symbolic of the way life carries on regardless. For me, Ema Biggi'\''s portfolio this month captures the very essence of frogginess, and transports me to Costa Rica'\''s rainforests - hot, wet and incredibly green. What more could a frog wish for?\n\nBefore I go, I'\''d just like to flag that the new series of Wild Lives, the podcast from us here at BBC Wildlife, is now available. More details are on page 7. Do give it a listen!\n\nIt'\''s not that easy being green\nPAUL McGUINNESS, EDITOR\nwildlifemagazine@ourmedia.co.uk\ninstagram.com/bbcwildlifemagazine\nfacebook.com/wildlifemagazine\n\nKeep in touch\n\nON THE THIS MONTH\nDon'\''t miss this month'\''s stunning portfolio on Costa Rican frogs",
"trg_lang": "zh-Hans"
}
}
}'{
"code": 200,
"data": {
"extra": {
"fatal_item_ids": [],
"logid": "202611110851191E2A66240C020904D850",
"now": 1794387079000
},
"log_pb": {
"impr_id": "202611110851191E2A66240C020904D850"
},
"status_code": 0,
"status_msg": "",
"translated_content_list": [
{
"src_content": "discoverwildlife.com BBC WILDLIFE 3\n\nRare Earth\nHow will the environment be changed by an Andy Burnham government? Tom Heap and Helen Czerski reveal the big decisions that will need to be taken on nature protection, energy and transport in the episode Andy",
"translated_content": "discoverwildlife.comBBC野生动物3\n\n稀土\n安迪·伯纳姆政府将如何改变环境?汤姆·希普和海伦·切尔斯基在《安迪的绿色托盘》一集中揭示了在自然保护、能源和交通方面需要做出的重大决定。赶上英国广播公司的声音\n\n调查\n在《河流应该有个性吗?地理学家和河流科学家尼克·芒特教授;皮尔-奥利维尔·布德罗,加拿大公园和荒野协会保护主任;和其他人,讨论这个概念的来龙去脉。赶上英国广播公司的声音\n\n众筹\n在最近的一集《电鱼如何发电》中,巴西生态学家诺纳托·朱尼尔是帮助解释电鳗等鱼类是如何开发出这种武器的",
"variant": "default"
}
]
},
"docs": "https://api.tikhub.io/#/TikTok-App-V3-API/fetch_content_translate_api_v1_tiktok_app_v3_fetch_content_translate_post",
"message": "Request successful. This request will incur a charge.",
"message_zh": "请求成功,本次请求将被计费。",
"params": {}
}This example shows part of the response. Copied content is valid JSON.

