Endpoint
Response
Parameters
Required
| Parameter | Type | Description |
|---|---|---|
q | string or string[] | Text to translate. Can be a single string or array for batch translation. |
target | string | Target language code (ISO 639-1), e.g., es, fr, de, zh |
Optional
| Parameter | Type | Default | Description |
|---|---|---|---|
source | string | auto-detect | Source language code. If omitted, language is automatically detected. |
format | string | text | Format of source text: text or html |
model | string | nmt | Translation model: nmt (neural) or base |
Batch translation
Translate multiple strings in a single request:HTML preservation
Preserve HTML tags during translation withformat: 'html':
Common language codes
| Language | Code |
|---|---|
| English | en |
| Spanish | es |
| French | fr |
| German | de |
| Chinese (Simplified) | zh |
| Chinese (Traditional) | zh-TW |
| Japanese | ja |
| Korean | ko |
| Arabic | ar |
| Portuguese | pt |
| Russian | ru |
| Italian | it |
See the Supported Languages endpoint for a complete list.
Examples
Translate a legal document
TypeScript
Auto-detect source language
TypeScript
Pricing: 1.50.