Chinese Script Conversion API Guide

Convert Simplified and Traditional Chinese text with clear request examples, response fields, input limits, and integration guidance.

Try the live demoView API details →

Chinese Script Conversion API Guide

Convert text between Simplified and Traditional Chinese for content preparation, search indexing, and document workflows.

View API details or try the Demo.

Request

Send JSON to POST https://api.gugudata.io/v1/text/stconvert, with your appkey in the query string.

curl 'https://api.gugudata.io/v1/text/stconvert?appkey=YOUR_APPKEY' \
  -H 'Content-Type: application/json' \
  --data '{"content":"简体中文","from":"s","to":"t"}'
Parameter Required Meaning
content Yes Nonblank text, up to 100,000 Unicode code points and 512 KiB UTF-8
from Yes Source script: s for Simplified or t for Traditional
to Yes Target script: s or t

The service accepts either case and trims surrounding whitespace in the script codes. Content itself is not trimmed or Unicode-normalized. When source and target match, the original text is returned unchanged.

Only s and t are supported. There are no separate Hong Kong or Taiwan modes.

Response

For the request above, data.convertedContent is 簡體中文. A request with 繁體中文, from=t, and to=s returns 繁体中文.

Field Type Meaning
dataStatus.statusCode integer This endpoint retains success code 100
dataStatus.statusDescription string Existing status message
dataStatus.requestParameter string Content length and normalized script codes, without the source text
dataStatus.responseDateTime string Timestamp in yyyy-MM-dd HH:mm:ss.SSS form
dataStatus.dataTotalCount integer 1 for a successful conversion
data.convertedContent string Converted text

Do not assume this endpoint uses business success code 200 just because the HTTP response is 200.

const response = await fetch(
  'https://api.gugudata.io/v1/text/stconvert?appkey=YOUR_APPKEY',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ content: '繁體中文', from: 't', to: 's' })
  }
);
const result = await response.json();
if (!response.ok || result.dataStatus?.statusCode !== 100) {
  throw new Error(result.dataStatus?.statusDescription || 'Conversion failed');
}
console.log(result.data.convertedContent);

Conversion boundaries

Script conversion is not translation, proofreading, or regional terminology localization. Review names, context-sensitive characters, and specialist terminology before publishing. A round trip is not guaranteed to reproduce the source exactly.

Spacing, line breaks, numbers, Latin text, and other non-Chinese content can remain alongside the converted text. The API does not accept files or offer multiple texts in one request; applications can submit individual requests within their plan limits.

Errors and Demo

Invalid JSON, blank or oversized content, and unsupported script codes return HTTP/business 400. Authentication and access checks retain HTTP 401/403; rate limiting uses 429. Internal failures use HTTP 500. Never treat a failed response as an empty successful conversion.

The Demo performs an actual Traditional-to-Simplified conversion of a public Chinese poem and caches successful results for 15 minutes. X-GuGuData-Demo-Mode indicates live or cached, and X-GuGuData-Generated-At identifies the cache generation time. Use the authenticated endpoint for your own text.