API Reference Translations

🌐 Translations API

Power your applications with instant, context-aware translations across 100+ languages. Built for developers who need accuracy, speed, and scalability.

v2.4.1 • Updated Dec 2024

Authentication

All API requests require authentication via Bearer token. Include your API key in the Authorization header:

Header
Authorization: Bearer sk_dict_live_8f3a92...
⚠️
Never expose your secret API keys in client-side code. Use environment variables or a backend proxy.

Base URL

Environment
Production: https://api.dictionary.com/v1
Sandbox: https://api-sandbox.dictionary.com/v1

Translate Text

POST /translations

Translates a single text string from a source language to a target language using neural machine translation models.

Request Body

Parameter Type Required Description
text string Yes The text to translate (max 5000 characters)
source_lang string No ISO 639-1 code. Defaults to auto-detection.
target_lang string Yes ISO 639-1 code for destination language
format string No Content type: text or html (default: text)

Request Example

curl -X POST https://api.dictionary.com/v1/translations \\
  -H "Authorization: Bearer sk_dict_live_8f3a92..." \\
  -H "Content-Type: application/json" \\
  -d '{
    "text": "The dictionary revolutionizes language learning.",
    "source_lang": "en",
    "target_lang": "es"
  }'
const response = await fetch('https://api.dictionary.com/v1/translations', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    text: 'The dictionary revolutionizes language learning.',
    source_lang: 'en',
    target_lang: 'es'
  })
});

const data = await response.json();
import requests

response = requests.post(
    "https://api.dictionary.com/v1/translations",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "text": "The dictionary revolutionizes language learning.",
        "source_lang": "en",
        "target_lang": "es"
    }
)

data = response.json()

Response

JSON 200 OK
{
  "id": "trans_8f3a92b4c1",
  "translated_text": "El diccionario revoluciona el aprendizaje de idiomas.",
  "source_language": "en",
  "target_language": "es",
  "confidence": 0.98,
  "alternatives": [
    "El diccionario transforma la adquisición de lenguas.",
    "El diccionario cambia el estudio de idiomas."
  ],
  "metadata": {
    "model": "dictionary-nmt-v2.4",
    "latency_ms": 142
  }
}

Rate Limits & Status Codes

Status Code Meaning Description
200 OK Request successful
400 Bad Request Invalid parameters or malformed JSON
401 Unauthorized Missing or invalid API key
429 Too Many Requests Rate limit exceeded (1000 req/min for Pro)
500 Server Error Internal processing failure
💡
Rate limits reset on a sliding 60-second window. Monitor the X-RateLimit-Remaining header in responses.

Supported Languages

Get the full list of supported language pairs by calling:

GET https://api.dictionary.com/v1/languages

Returns 127 languages with regional variants (e.g., es-ES, pt-BR, zh-CN, ar-SA).