Neural machine translation API

Translate text, HTML and JSON into 100+ languages with one API call.

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.

  • 1,300+ subscribers on RapidAPI
  • 100% service level on RapidAPI
  • 9.9 popularity on RapidAPI
  • Nice to meet you
  • Ravi de vous rencontrer
  • はじめまして
  • Encantado de conocerte
  • سعيد بلقائك
  • आपसे मिलकर खुशी हुई
  • Prazer em conhecê-lo
  • 만나서 반갑습니다
  • Приятно познакомиться
  • 很高兴认识你
POST /v1/translate

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
}
Features

What can the NLP Translation API do?

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.

Context-aware translation

Neural machine translation reads whole sentences, so word order, idioms and tone come out natural instead of word-by-word.

110 language codes

From Afrikaans to Zulu, including Chinese (Simplified) and (Traditional), Hebrew, Javanese and Tagalog. See the full list.

HTML-safe

Send HTML in text: tags and attributes are preserved and only the visible text is translated.

JSON translation

/v1/jsontranslate translates the string values of a JSON document and keeps keys, numbers and structure. protected_keys leaves chosen values as they are.

Protected words

List brand names and product terms in protected_words and they stay exactly as written.

Several languages per request

Set to to fr;pt;de and get every translation in one response (up to 4 targets, depending on your plan).

Automatic language detection

Leave out from on /v1/translate and the source language is detected for you.

Simple JSON responses

One flat JSON object: the original, one translation per target code and the characters counted.

Pay per character

Paid plans are measured in characters translated, with a free Basic plan to start. Billing runs on RapidAPI.

How it works for you

How do I start using the API?

Three steps: subscribe on RapidAPI, copy your key, and call /v1/translate.

  1. Subscribe on RapidAPI

    Open the NLP Translation listing on RapidAPI and pick a plan. Basic is free.

  2. Copy your API key

    RapidAPI shows your key on the listing. Send it as x-rapidapi-key with x-rapidapi-host: nlp-translation.p.rapidapi.com.

  3. Call /v1/translate

    POST text and to. The translation comes back in translated_text, keyed by language code.

Full walkthrough with every parameter: quickstart and API reference.

Use cases

What do developers use it for?

Teams use it to translate app content, product catalogs, support conversations, CMS pages and JSON locale files.

Apps and SaaS

Translate user-generated content, notifications and in-app messages on the fly, in the user's language.

E-commerce catalogs

Translate product titles and HTML descriptions in bulk while brand names stay protected.

Customer support

Read tickets and chats in any language and reply in the customer's own language.

CMS and i18n pipelines

Translate articles and pages as HTML, keeping the markup your templates expect.

JSON resource files

Translate locale files such as en.json into new languages in one call; keys and placeholders you protect stay untouched.

Languages

Which languages are supported?

110 language codes, from Afrikaans to Zulu.

Use any of them as a target in to, several at once separated by ;.

See all 110 languages
Pricing

How much does it cost?

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.

Basic

$0 / month

Try the API and build a prototype.

  • 300 / month requests
  • 1 target language per request
  • Up to 1,000 characters per request
  • 1 concurrent request
Start free : Basic plan on RapidAPI

Pro

$10 / month

Small apps and steady background jobs.

  • 15,000,000 characters / month
  • 2 target languages per request
  • Up to 5,000 characters per request
  • 2 concurrent requests
Choose Pro : Pro plan on RapidAPI

Mega

$180 / month

High volume and many languages at once.

  • 500,000,000 characters / month
  • 4 target languages per request
  • Up to 5,000 characters per request
  • 8 concurrent requests
Choose Mega : Mega plan on RapidAPI

Compare plan limits in detail.

FAQ

Frequently asked questions

What is NLP Translation?

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.

How do I get an API key?

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.

Is there a free plan?

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.

How many languages are supported?

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.

Can I translate HTML without breaking the markup?

Yes. Send the HTML in text. Tags and attributes are kept as they are and only the text between them is translated.

Can I translate JSON files?

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.

How do I keep brand names from being translated?

Put them in protected_words, separated by ;, for example Acme;CloudSync. Matching is case-sensitive.

Can I translate into several languages in one request?

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.

Do I have to specify the source language?

Not on /v1/translate: leave out from and the source language is detected automatically. /v1/jsontranslate needs from.

How are characters counted?

Each request counts the characters of the text you send, once per target language. The response reports the number in translated_characters.

Who handles payments and invoices?

RapidAPI. Payments and API keys are handled by RapidAPI. Upgrades, cancellations and invoices are managed in your RapidAPI account.

Can I try the API before writing code?

Yes. The RapidAPI playground sends real requests with your key and shows ready-made code for many languages.

Start translating in five minutes

Subscribe to the free Basic plan on RapidAPI, copy your key and send your first request.