/v2/translate endpoint accepts up to 50 texts per request and request bodies up to 128 KiB. This guide shows how to make the most of each request when you have a lot of text to translate: sending whole paragraphs, batching texts, running requests in parallel, and protecting content that shouldn’t be translated.
Send whole paragraphs as one text
If your text is contiguous, submit entire paragraphs in a singletext value. Before translating, the engine splits the text into sentences, normally on punctuation marks and newlines, and returns the whole translated paragraph. Don’t assume every period acts as a sentence separator; the engine handles abbreviations and similar cases.
Example request
Example response
Control sentence splitting
Automatic splitting can occasionally divide what is really a single sentence, especially in text with uncommon character sequences that contain punctuation. Thesplit_sentences parameter controls this behavior:
| Value | Behavior |
|---|---|
1 | Split on punctuation and newlines (default) |
nonewlines | Split on punctuation only (default when tag_handling=html) |
0 | No splitting; the whole input is treated as one sentence |
text value, set split_sentences to 0 to prevent unintended splits. With splitting disabled, overlong inputs are cut off rather than translated, so split long text into sentences yourself before submitting.
Newlines split sentences under the default setting. If your text contains line breaks mid-sentence, either clean them up before sending or use split_sentences=nonewlines.
Batch up to 50 texts per request
Thetext array can carry up to 50 entries per request. Translations come back in the same order:
Example request
Example response
Run requests in parallel
For volumes beyond what batching covers, send multiple requests concurrently from several threads or processes. Watch for HTTP 429 responses and back off accordingly; see error handling best practices for retry strategies.Protect embedded markers
Uncommon character sequences that act as markers in your system, like placeholders or template syntax, might get translated or removed, corrupting your structure. Either split your text so markers don’t need to be sent, or convert markers to XML tags and enable XML handling or HTML handling.When to switch to document translation
The total request body is limited to 128 KiB, and atext array is capped at 50 entries. For complete files, or text that exceeds these limits, use document translation instead: upload limits are far higher and formatting is preserved. See usage and limits for the exact caps per plan.