Translate API & Scraper
The Translate API returns machine translation as clean JSON.
🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.
The primary translate endpoint returns translated text with the detected source language and confidence, and you can translate to multiple targets, detect a language, look up a dictionary, list languages and get speech. It is built for localization, chat apps and content pipelines that need translation from one endpoint. One ReefAPI key, one shared credit pool, the standard envelope.
The language codes that are not the ones you would guess
Most codes here are the ISO 639-1 code you expect. A handful are not, because this vocabulary keeps several legacy codes, and an unrecognized code is rejected outright rather than silently ignored. Every row below was measured: the working code returned a translation, the plausible-looking one returned INVALID_PARAM.
| Use this | Language | This is rejected |
|---|---|---|
| iw | Hebrew — measured: 'good morning' → בוקר טוב | he |
| zh-CN | Chinese (Simplified) | zh |
| zh-TW | Chinese (Traditional) | zh-Hant |
| tl | Filipino | fil |
| jw | Javanese | jv |
| ckb | Kurdish (Sorani) — ku on its own is Kurmanji | — |
| mni-Mtei | Meiteilon (Manipuri) | mni |
| nso | Sepedi | — |
| gom | Konkani | kok |
Our own parameter documentation says friendly aliases such as 'zh' and 'he' are accepted. Measured, they are not — both returned INVALID_PARAM. We are correcting the doc; in the meantime, treat this table as the truth and call the languages action to get the full authoritative list rather than trusting an ISO cheat sheet.
Real request and response JSON
Captured from the indexed primary action, translate, on .
{
"method": "POST",
"url": "https://api.reefapi.com/translate/v1/translate",
"headers": {
"x-api-key": "$REEF_KEY",
"content-type": "application/json"
},
"body": {
"text": "Hello, how are you?",
"target": "es"
}
}{
"ok": true,
"meta": {
"api": "translate",
"endpoint": "translate",
"mode": "live",
"latency_ms": 687,
"record_count": 1,
"bytes": 135,
"cache_hit": false,
"source": "google_translate",
"truncated": false,
"charged_credits": 1,
"version": "1.0.0"
},
"data": {
"text": "¿Hola, cómo estás?",
"source_text": "Hello, how are you?",
"source": "en",
"target": "es",
"detected_source": "en",
"detection_confidence": 0.9896,
"source_language_name": "English",
"target_language_name": "Spanish"
}
}What the Translate API does
| Action | Description | Concrete use case | Key params |
|---|---|---|---|
| translate | Translate text into a single target language. Auto-detects the source by default and returns the detected language + confidence. Supports every script. | Ops teams call translate to get translate text into a single target language. | text, target, source |
| translate_multi | Translate the SAME text into MANY target languages in a single call — the multi-target differentiator. Pass up to 60 target codes; returns a translation for each, fanned out concurrently (≈15× faster than calling translate per language). | Developer tools call translate_multi to get translate the SAME text into MANY target languages in a single call. | text, targets, source |
| translate_batch | Translate MANY strings into ONE target language in a single call — built for catalogue work (product titles, spec values, category names). Send up to 500 strings as an array and get an array back in the SAME order, index for index. Costs ONE upstream call regardless of how many strings you send, so a 500-title page is one request instead of 500. Items the upstream could not translate are listed in `failed[]` with a reason and come back as text:null — never as an empty string and never silently dropped. | Validation workflows call translate_batch to get translate MANY strings into ONE target language in a single call. | texts, target, source |
| detect | Detect the language of a piece of text. Returns the detected language code, its name and a confidence score (0-1). Works on any script. | Data-quality teams call detect to detect the language of a piece of text. | text |
| dictionary | Word-level dictionary lookup: translate a word/short phrase and get its meanings grouped by part of speech, synonyms, back-translations and transliteration (romanization). Best for single words or short phrases. | Ops teams call dictionary to get word-level dictionary lookup. | text, target, source |
| languages | List all supported languages (code → English name). Useful to populate a language picker or validate a code before translating. | Developer tools call languages to list all supported languages (code → English name). | none |
| speak | Text-to-speech: turn text into spoken audio (MP3). Pronounces the text in the chosen language's voice/accent — works with every script (Chinese, Japanese, Arabic, Cyrillic, Turkish…). Long text is split and joined into a single MP3. Returns the audio base64-encoded inline (audio/mpeg), so no second download is needed. Pair it with 'translate' to get spoken translations. | Validation workflows call speak to get text-to-speech. | text, lang, slow |
Call translate from your stack
curl -X POST https://api.reefapi.com/translate/v1/translate \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"text":"Hello, how are you?","target":"es"}'import requests
r = requests.post(
"https://api.reefapi.com/translate/v1/translate",
headers={"x-api-key": REEF_KEY},
json={
"text": "Hello, how are you?",
"target": "es"
},
)
print(r.json()["data"])const res = await fetch("https://api.reefapi.com/translate/v1/translate", {
method: "POST",
headers: {
"x-api-key": process.env.REEF_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
"text": "Hello, how are you?",
"target": "es"
}),
});
const { ok, data, meta, error } = await res.json();Ask your MCP-connected assistant: call reefapi.translate.translate with {"text":"Hello, how are you?","target":"es"}.Who uses this API and why
- Chat apps call translate to render messages in a user's language in real time.
- Localization pipelines use translate_multi to produce many locales at once.
- Apps use detect and dictionary for language handling and definitions.
Questions developers ask before integrating
Do I have to tell it the source language?
No — source defaults to auto and detection is returned alongside the result, so you never have to guess in advance. A measured translation of Turkish input into Japanese came back with detected_source 'tr', detection_confidence 1.0 and source_language_name 'Turkish' next to the translated text. If you already know the source, passing it explicitly skips detection and removes the small chance of a wrong guess on very short strings.
How do I translate one string into many languages efficiently?
translate_multi takes up to 60 target codes in one call and fans them out concurrently rather than making you loop. Note the response shape: translations is an object keyed by language code, not an array — a measured call returned translations.de, translations.ja, translations.ar and translations['zh-CN'], each with its own text and language_name, plus count 4 and errors null. Detection runs once for the shared source. If one target fails the others still return and the failure surfaces in errors.
Why does the dictionary's top-scored word differ from the translation?
Because they answer different questions and you will misread the response if you assume they agree. A measured dictionary lookup of 'run' into Spanish returned text 'correr' as the translation, while the highest-scoring verb entry was 'ejecutar' at 0.177 with 'correr' second at 0.074. The translation is the best fit for the string in isolation; the dictionary scores are corpus frequencies across all senses, and 'ejecutar' wins because software and legal usage dominate written text. Read text for a translation and the dictionary array for a thesaurus.
What exactly is the transliteration field?
The pronunciation of the input word, not of the translation. A measured lookup of English 'run' into Spanish returned transliteration 'rən' — the English pronunciation, not how to say 'correr'. It is most useful in the other direction: pass a word in a non-Latin script and the field gives you a readable romanization of what you sent.
Is detect different from the detection inside translate?
It returns one extra thing you should be using. detect gives detected_source, language_name, confidence and is_reliable — that last boolean is a separate judgment from the score, so you do not have to invent a confidence threshold. A measured call on Czech returned cs with confidence 1.0 and is_reliable true. Short strings, product codes and mixed-language input are where confidence stays high while is_reliable goes false.
Is there a length limit?
5,000 characters per call. Longer input is truncated rather than rejected, and meta.truncated flags that it happened — check it, because a silently shortened translation looks perfectly fine until a customer reads the end of it. For long documents, split on sentence or paragraph boundaries and reassemble; splitting mid-sentence degrades quality noticeably in languages with different word order.
Can I get audio instead of text?
Yes. speak is text-to-speech and returns MP3 audio for text in any supported language, so a single key covers both translation and voice — the usual pairing being translate the string, then speak the result in the target language. Every script is handled the same way; the engine does not require Latin input at any point.
What is the Translate API?
Translate API is a ReefAPI endpoint group for translate It returns live JSON through POST requests under /translate/v1.
Is the Translate API free to try?
Yes. ReefAPI starts with 1,000 free credits, no card required. Translate calls use the same shared credit balance as every other ReefAPI engine.
Do I need a Translate login or account?
No login to Translate is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.
How fresh is the Translate data?
The page example is captured from a live translate call, and production requests fetch live data through ReefAPI rather than a static sample.
How many credits does the Translate API use?
Translate actions currently cost 1 credit per successful call. Failed or blocked calls are free. All APIs draw from one credit pool.
Can I call Translate from an AI assistant or MCP client?
Yes. Connect ReefAPI once through MCP and your assistant can call translate actions with the same key, credit pool and JSON envelope used by normal REST requests.
Is the Translate API a Translate scraper?
It is the managed alternative to a DIY Translate scraper. Instead of building and maintaining your own scraper — proxies, headless browsers, captcha and constant breakage — you call one ReefAPI endpoint and get the same translate back as clean JSON.