Context-aware translation
Neural machine translation reads whole sentences, so word order, idioms and tone come out natural instead of word-by-word.
NLP Translation is a REST API for neural machine translation: send plain text, HTML or a JSON document and get the translation back as simple JSON, in more than 100 languages. Subscribe, get your key and manage billing on RapidAPI.
cURL
curl --request POST \
--url https://nlp-translation.p.rapidapi.com/v1/translate \
--header 'Content-Type: application/json' \
--header 'x-rapidapi-host: nlp-translation.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
--data '{"text":"Nice to meet you","to":"fr","from":"en"}' JavaScript
const response = await fetch("https://nlp-translation.p.rapidapi.com/v1/translate", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-rapidapi-host": "nlp-translation.p.rapidapi.com",
"x-rapidapi-key": process.env.RAPIDAPI_KEY,
},
body: JSON.stringify({
text: "Nice to meet you",
to: "fr",
from: "en",
}),
});
const data = await response.json();
if (data.status !== 200) throw new Error(data.Error);
console.log(data.translated_text["fr"]); Python
import os
import requests
response = requests.post(
"https://nlp-translation.p.rapidapi.com/v1/translate",
headers={
"x-rapidapi-host": "nlp-translation.p.rapidapi.com",
"x-rapidapi-key": os.environ["RAPIDAPI_KEY"],
},
json={
"text": "Nice to meet you",
"to": "fr",
"from": "en",
},
timeout=30,
)
data = response.json()
print(data["translated_text"]["fr"]) PHP
<?php
$ch = curl_init("https://nlp-translation.p.rapidapi.com/v1/translate");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-rapidapi-host: nlp-translation.p.rapidapi.com",
"x-rapidapi-key: " . getenv("RAPIDAPI_KEY"),
],
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Nice to meet you',
'to' => 'fr',
'from' => 'en',
]),
]);
$data = json_decode(curl_exec($ch), true);
echo $data["translated_text"]['fr']; Response
{
"status": 200,
"from": "en",
"to": "fr",
"original_text": "Nice to meet you",
"translated_text": {
"fr": "Ravi de vous rencontrer"
},
"translated_characters": 16
} It translates plain text, HTML and JSON documents into 110 languages in one request, keeps your markup and protected terms intact, and returns simple JSON.
Neural machine translation reads whole sentences, so word order, idioms and tone come out natural instead of word-by-word.
From Afrikaans to Zulu, including Chinese (Simplified) and (Traditional), Hebrew, Javanese and Tagalog. See the full list.
Send HTML in text: tags and attributes are preserved and only the visible text is translated.
/v1/jsontranslate translates the string values of a JSON document and keeps keys, numbers and structure. protected_keys leaves chosen values as they are.
List brand names and product terms in protected_words and they stay exactly as written.
Set to to fr;pt;de and get every translation in one response (up to 4 targets, depending on your plan).
Leave out from on /v1/translate and the source language is detected for you.
One flat JSON object: the original, one translation per target code and the characters counted.
Paid plans are measured in characters translated, with a free Basic plan to start. Billing runs on RapidAPI.
Three steps: subscribe on RapidAPI, copy your key, and call /v1/translate.
Open the NLP Translation listing on RapidAPI and pick a plan. Basic is free.
RapidAPI shows your key on the listing. Send it as x-rapidapi-key with x-rapidapi-host: nlp-translation.p.rapidapi.com.
POST text and to. The translation comes back in translated_text, keyed by language code.
Full walkthrough with every parameter: quickstart and API reference.
Teams use it to translate app content, product catalogs, support conversations, CMS pages and JSON locale files.
Translate user-generated content, notifications and in-app messages on the fly, in the user's language.
Translate product titles and HTML descriptions in bulk while brand names stay protected.
Read tickets and chats in any language and reply in the customer's own language.
Translate articles and pages as HTML, keeping the markup your templates expect.
Translate locale files such as en.json into new languages in one call; keys and placeholders you protect stay untouched.
110 language codes, from Afrikaans to Zulu.
Use any of them as a target in to, several at once separated by ;.
es Spanish fr French de German pt Portuguese it Italian ja Japanese ko Korean zh-CN Chinese (Simplified) ar Arabic hi Hindi id Indonesian ru Russian tr Turkish vi Vietnamese Plans start at $0 with the Basic plan; paid plans from $10 per month are billed by characters translated. Prices and quotas are set on RapidAPI, which is the source of truth.
$0 / month
Try the API and build a prototype.
$10 / month
Small apps and steady background jobs.
$70 / month
Production apps, catalogs and support tools.
$180 / month
High volume and many languages at once.
NLP Translation is a REST API that translates plain text, HTML and JSON documents into 110 languages with neural machine translation. You subscribe, get your key and pay through RapidAPI.
Subscribe to a plan on the RapidAPI listing; the Basic plan is free. RapidAPI then shows your key, which you send in the x-rapidapi-key header.
Yes. The Basic plan costs $0 and includes 300 requests per month, up to 1,000 characters per request and one target language per request.
110 language codes, from Afrikaans (af) to Zulu (zu), including Chinese (Simplified) zh-CN and Chinese (Traditional) zh-TW. The language list has every code.
Yes. Send the HTML in text. Tags and attributes are kept as they are and only the text between them is translated.
Yes. POST /v1/jsontranslate translates the string values of a JSON object and keeps its keys, numbers and structure. List keys in protected_keys to leave their values untranslated.
Put them in protected_words, separated by ;, for example Acme;CloudSync. Matching is case-sensitive.
Yes. Separate the codes with ;, for example to=fr;pt. Basic allows 1 target language per request, Pro 2, Ultra 3 and Mega 4; extra codes are dropped and the response message says so.
Not on /v1/translate: leave out from and the source language is detected automatically. /v1/jsontranslate needs from.
Each request counts the characters of the text you send, once per target language. The response reports the number in translated_characters.
RapidAPI. Payments and API keys are handled by RapidAPI. Upgrades, cancellations and invoices are managed in your RapidAPI account.
Yes. The RapidAPI playground sends real requests with your key and shows ready-made code for many languages.
Subscribe to the free Basic plan on RapidAPI, copy your key and send your first request.