Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Translate text between 100+ languages with a single API call. Bunny’s Translation API accepts source and target language codes and returns the translated text along with a confidence score.Use cases
- Build multilingual UIs without a dedicated i18n backend
- Translate user-generated content in real time
- Power customer support tools with automatic message translation
- Add language detection to content pipelines
Details
Uses ISO 639-1 language codes (e.g.en, pt, es, fr, de). The confidence field (0–1) reflects translation quality. Long texts are supported but response time scales with length.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to translate (max 5,000 characters) |
to | string | Yes | Target language code (ISO 639-1, e.g. pt) |
from | string | No | Source language code (ISO 639-1, e.g. en). Defaults to autodetect |
Example
Response
200 OK
| Field | Type | Description |
|---|---|---|
original | string | The original text that was submitted |
translated | string | Translated text |
from | string | Source language code used (may be autodetect if not specified) |
to | string | Target language code |
confidence | number|null | Translation confidence score (0–1) |

