Localization API
Translate Markdown or JSON content while preserving the required document structure.
Markdown content
Translate text while preserving the document structure.
JSON content
Process structured text using valid JSON input.
Target language
Specify the target language with locale and read the result in the specified format.
Start with your first request
Get a Key, copy the request, and see the corresponding JSON response below.
export ACEDATACLOUD_API_KEY="YOUR_API_KEY"
curl --request POST "https://api.acedata.cloud/localization/translate" \
--header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"input": "# Welcome\n\nCreate your first project.",
"locale": "zh-CN",
"extension": "md"
}'The following is an excerpt of key fields from the current API response. The task ID, usage, and generated content depend on the response to your request.
{
"data": "# 标题 1\n\n这是一个段落。\n\n## 标题 2\n\n这是另一个段落。",
"usage": {
"prompt_tokens": 172,
"completion_tokens": 25
},
"locale": "zh-CN"
}Read the result
Read the returned translation and save it in the original format. For JSON input, provide valid JSON as described in the guide.
locale specifies the target language, and extension specifies md or json.
Requests and costs
Refer to the current API and pricing page for request parameters, available models, and costs. If you encounter authentication, balance, or limit errors, check the Key's application, expiration, and usage restrictions. Keep the trace_id when troubleshooting requests.
Integrate the Localization API into your application
Continue to the complete guide for parameters, result fields, and error handling.
