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
Use locale to specify the target language and read the result according to its format.
Start with Your First Request
Get a Key, copy the request, and view the corresponding response JSON 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 identifier, usage, and generated content depend on the values returned by 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 quota errors, check the Key's application, expiration, and usage restrictions. Retain 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.