# NLP Translation API > 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. Translate text, HTML and JSON into 100+ languages with one API call. - Get a free API key on RapidAPI: https://rapidapi.com/gofitech/api/nlp-translation - Pricing: https://nlptranslation.com/pricing - Quickstart: https://nlptranslation.com/docs On RapidAPI: 1,300+ subscribers, 100% service level, popularity 9.9. ## Example ```bash 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"}' ``` ```json { "status": 200, "from": "en", "to": "fr", "original_text": "Nice to meet you", "translated_text": { "fr": "Ravi de vous rencontrer" }, "translated_characters": 16 } ``` ## Features - **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](https://nlptranslation.com/languages). - **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 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. ## Use cases - **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 110 language codes are supported. Full list: https://nlptranslation.com/languages ## Pricing Plans from $0 (Basic, 300 requests per month) to $180 (Mega, 500,000,000 characters per month). Prices and quotas are set on RapidAPI, which is the source of truth. Details: https://nlptranslation.com/pricing ## FAQ ### 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](https://rapidapi.com/gofitech/api/nlp-translation); 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](https://nlptranslation.com/languages) 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](https://rapidapi.com/gofitech/api/nlp-translation/playground) sends real requests with your key and shows ready-made code for many languages. --- # NLP Translation API pricing > The NLP Translation API has four monthly plans on RapidAPI: Basic ($0), Pro ($10), Ultra ($70, recommended) and Mega ($180). Prices and quotas are set on RapidAPI, which is the source of truth. Last updated: 2026-11-30. Payments and API keys are handled by RapidAPI. Subscribe or change plans: https://rapidapi.com/gofitech/api/nlp-translation/pricing ## Plans | | Basic | Pro | Ultra (recommended) | Mega | | --- | --- | --- | --- | --- | | Price per month | $0 | $10 | $70 | $180 | | Requests | 300 / month | Unlimited | Unlimited | Unlimited | | Characters per month | – | 15,000,000 | 150,000,000 | 500,000,000 | | Overage | $0.001 per request | $0.00001 per character | $0.00001 per character | $0.00001 per character | | Concurrent requests | 1 | 2 | 4 | 8 | | Target languages per request | 1 | 2 | 3 | 4 | | Max characters per request | 1,000 | 5,000 | 5,000 | 5,000 | ## Plan limits explained - **Characters per month**: The characters included in a paid plan each month. Each request counts the characters of the text you send once per target language, as reported in `translated_characters`. - **Requests**: Basic includes 300 requests per month. Paid plans have no request limit; they are measured in characters. - **Overage**: Usage above the monthly quota is billed by RapidAPI at the overage rate: $0.001 per request on Basic, $0.00001 per character on Pro, Ultra and Mega. - **Concurrent requests**: How many requests your key can have in progress at the same time. A request above the limit is answered with body `status` 429; retry it when an earlier request has finished. - **Target languages per request**: How many codes `to` may list (separated by `;`). Extra codes are dropped and the response includes a `message` that names the limit. - **Max characters per request**: The longest `text` (or `json`) one request may send: 1,000 characters on Basic, 5,000 on paid plans. Longer input is answered with body `status` 412. ## Billing FAQ ### How are characters counted? The characters of the `text` (or `json`) you send are counted once per target language. Translating 16 characters into French and Portuguese counts 32. The response reports the number in `translated_characters`. ### What happens when I use more than my monthly quota? Requests keep working and RapidAPI bills the overage: $0.001 per request on Basic, $0.00001 per character on Pro, Ultra and Mega. ### What does the free Basic plan include? 300 requests per month at $0, one request at a time, one target language per request and up to 1,000 characters per request. ### How do I upgrade, downgrade or cancel? On RapidAPI: open the [pricing page](https://rapidapi.com/gofitech/api/nlp-translation/pricing) of the listing and pick another plan, or cancel from your RapidAPI subscriptions. Your key stays the same. ### What does "concurrent requests" mean? The number of requests your key can have in progress at the same time: 1 on Basic, 2 on Pro, 4 on Ultra, 8 on Mega. A request above the limit gets body `status` 429 and can be retried. ### Which currency are the prices in? US dollars (USD), per month. Prices and quotas are set on RapidAPI, which is the source of truth. ### Where do I get invoices? From RapidAPI, which handles payment, API keys, quotas and invoices for this API. --- # NLP Translation API quickstart and reference > 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. Base URL: `https://nlp-translation.p.rapidapi.com`. Authenticate with your RapidAPI key. Last updated: 2026-11-30. Try every endpoint in the RapidAPI playground: https://rapidapi.com/gofitech/api/nlp-translation/playground ## Authentication Every request sends two headers. Your key comes from RapidAPI after you subscribe to a plan (Basic is free). Call the API from your own backend so the key stays private. | Header | Where | Required | Value | | --- | --- | --- | --- | | `x-rapidapi-key` | header | Yes | Your RapidAPI application key, shown on the RapidAPI listing once you subscribe. | | `x-rapidapi-host` | header | Yes | Always `nlp-translation.p.rapidapi.com`. | ## Translate text or HTML: `/v1/translate` `GET /v1/translate` takes the parameters in the query string. `POST /v1/translate` takes them in the body as JSON, form-urlencoded or multipart. | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `text` | string | Yes | Plain text or HTML to translate. Up to 1,000 characters per request on Basic, 5,000 on paid plans. | | `to` | string | Yes | Target language code, or several separated by `;` (for example `fr;pt`). Codes are case-sensitive. | | `from` | string | No | Source language code. Omit it for automatic source language detection. | | `protected_words` | string | No | Words to leave untranslated, separated by `;` (for example `Acme;CloudSync`). Case-sensitive. | ### Request **cURL** ```bash 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** ```js 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** ```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 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 ```json { "status": 200, "from": "en", "to": "fr", "original_text": "Nice to meet you", "translated_text": { "fr": "Ravi de vous rencontrer" }, "translated_characters": 16 } ``` | Field | Type | Present | Description | | --- | --- | --- | --- | | `status` | number | Always | `200` on success, otherwise the error code. Always check this field. | | `from` | string | On success | Source language code (detected when you omitted `from`). | | `to` | string | On success | Target codes that were translated, separated by `;`. | | `original_text` | string | On success | The text you sent. | | `translated_text` | object | On success | One entry per target code: `{ "fr": "…" }`. | | `translated_characters` | number | On success | Characters counted for this request: text length × number of target languages. | | `message` | string | Sometimes | Notes a plan limit, for example when extra target languages were dropped. | | `Error` | string | On error | What went wrong, in plain English. | ### GET request ```bash curl --request GET \ --url 'https://nlp-translation.p.rapidapi.com/v1/translate?text=Nice%20to%20meet%20you&to=fr' \ --header 'x-rapidapi-host: nlp-translation.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' ``` ## Several target languages Separate target codes with `;` to get every translation in one response. Your plan sets how many codes one request may list (Basic 1, Pro 2, Ultra 3, Mega 4); extra codes are dropped and `message` says so. ```bash 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;pt","from":"en"}' ``` ```json { "status": 200, "from": "en", "to": "fr;pt", "original_text": "Nice to meet you", "translated_text": { "fr": "Ravi de vous rencontrer", "pt": "Prazer em conhecê-lo" }, "translated_characters": 32 } ``` When `to` lists more codes than your plan allows: ```json { "status": 200, "from": "en", "to": "fr;pt", "original_text": "Nice to meet you", "translated_text": { "fr": "Ravi de vous rencontrer", "pt": "Prazer em conhecê-lo" }, "translated_characters": 32, "message": "Translated. Maximum Multiple target languages simultaneously in your current plan is 2" } ``` ## HTML Send HTML in `text`: tags and attributes are preserved and only the text is translated. Markup counts toward the characters of the request. ```bash 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":"

Free shipping on all orders

","to":"es","from":"en"}' ``` ```json { "status": 200, "from": "en", "to": "es", "original_text": "

Free shipping on all orders

", "translated_text": { "es": "

Envío gratis en todos los pedidos

" }, "translated_characters": 51 } ``` ## Protected words `protected_words` lists words to keep exactly as written (brand names, product terms), separated by `;`. Matching is case-sensitive. ```bash 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":"Acme Cloud keeps your files safe","to":"de","from":"en","protected_words":"Acme Cloud"}' ``` ## Translate JSON: `POST /v1/jsontranslate` `/v1/jsontranslate` translates the string values of a JSON object and keeps keys, numbers and structure. Send the document as a string in `json`; `from` is required on this endpoint. | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `json` | string | Yes | The JSON document to translate, as a string. It must be an object (`{…}`). A JSON object instead of a string also works. | | `to` | string | Yes | Target language code, or several separated by `;`. Codes are case-sensitive. | | `from` | string | Yes | Source language code. Required on this endpoint (no automatic detection). | | `protected_keys` | string | No | Keys whose values are left as they are, separated by `;`. Use dot paths for nested keys, for example `id;meta.sku`. | | `protected_words` | string | No | Words to leave untranslated inside the values, separated by `;`. Case-sensitive. | **cURL** ```bash curl --request POST \ --url https://nlp-translation.p.rapidapi.com/v1/jsontranslate \ --header 'Content-Type: application/json' \ --header 'x-rapidapi-host: nlp-translation.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \ --data '{"from":"en","to":"de","json":"{\"title\":\"Welcome home\"}"}' ``` **JavaScript** ```js const response = await fetch("https://nlp-translation.p.rapidapi.com/v1/jsontranslate", { 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({ from: "en", to: "de", json: "{\"title\":\"Welcome home\"}", }), }); const data = await response.json(); if (data.status !== 200) throw new Error(data.Error); console.log(data.translated_json["de"]); ``` **Python** ```python import os import requests response = requests.post( "https://nlp-translation.p.rapidapi.com/v1/jsontranslate", headers={ "x-rapidapi-host": "nlp-translation.p.rapidapi.com", "x-rapidapi-key": os.environ["RAPIDAPI_KEY"], }, json={ "from": "en", "to": "de", "json": "{\"title\":\"Welcome home\"}", }, timeout=30, ) data = response.json() print(data["translated_json"]["de"]) ``` **PHP** ```php 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([ 'from' => 'en', 'to' => 'de', 'json' => '{"title":"Welcome home"}', ]), ]); $data = json_decode(curl_exec($ch), true); echo $data["translated_json"]['de']; ``` ```json { "status": 200, "from": "en", "to": "de", "original_json": "{\"title\":\"Welcome home\"}", "protected_keys": "", "protected_words": "", "translated_json": { "de": "{\"title\":\"Willkommen zu Hause\"}" }, "translated_characters": 24 } ``` | Field | Type | Present | Description | | --- | --- | --- | --- | | `status` | number | Always | `200` on success, otherwise the error code. | | `from` | string | On success | Source language code. | | `to` | string | On success | Target codes that were translated. | | `original_json` | string | On success | The JSON document you sent. | | `translated_json` | object | On success | One translated JSON string per target code. | | `translated_characters` | number | On success | Characters counted: JSON length × number of target languages. | | `Error` | string | On error | What went wrong. | ### Protected keys `protected_keys` lists keys whose values are returned unchanged, separated by `;`, with dot paths for nested keys (`meta.sku`). ```bash curl --request POST \ --url https://nlp-translation.p.rapidapi.com/v1/jsontranslate \ --header 'Content-Type: application/json' \ --header 'x-rapidapi-host: nlp-translation.p.rapidapi.com' \ --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \ --data '{"from":"en","to":"fr","json":"{\"sku\":\"TSHIRT-01\",\"name\":\"Blue T-shirt\"}","protected_keys":"sku"}' ``` ## Errors Errors use the format `{"status": , "Error": ""}`. The HTTP status is often 200 even when the request failed, so always check the `status` field of the body. ```json { "status": 412, "Error": "Invalid Target Language Code: fra" } ``` | When | HTTP | Body | | --- | --- | --- | | `to` is missing or empty | 200 | `{"status":412,"Error":"Target Language Code Needed"}` | | A target code is not in the language list (codes are case-sensitive) | 200 | `{"status":412,"Error":"Invalid Target Language Code: fra"}` | | `text` is longer than your plan allows (1,000 on Basic, 5,000 on paid plans) | 200 | `{"status":412,"Error":"Text with More than 1000 characters or less than one Character is not allowed"}` | | More requests in progress than your plan's concurrent limit | 200 | `{"status":429,"Error":"Your are currently have 1 translating job, Your Max thread: 1"}` | | `/v1/jsontranslate` without `from` | 412 | `{"status":412,"Error":"From Language Code Needed in JSON Data Translation"}` | | `/v1/jsontranslate` without `to` | 200 | `{"status":412,"Error":"Target Language Code Needed in JSON Data Translation"}` | | `json` is not a JSON object | 200 | `{"status":412,"Error":"JSON must be start with { && end with }"}` | | A temporary problem on our side | 500 | `{"status":500,"Error":"Server Error"}` | Errors about your key, subscription or monthly quota come from RapidAPI in RapidAPI's own format, for example `{"message": "You are not subscribed to this API."}`. ## Language codes Codes are case-sensitive: use `zh-CN`, not `zh-cn`. Some codes differ from ISO 639-1: Hebrew is `iw`, Javanese is `jw`. All 110 codes: https://nlptranslation.com/languages --- # Supported languages > The NLP Translation API supports 110 target language codes. Use them in `to` (and `from`); codes are case-sensitive. | Code | Language | | --- | --- | | `af` | Afrikaans | | `sq` | Albanian | | `am` | Amharic | | `ar` | Arabic | | `hy` | Armenian | | `az` | Azerbaijani | | `ba` | Bashkir | | `eu` | Basque | | `be` | Belarusian | | `bn` | Bengali | | `bs` | Bosnian | | `bg` | Bulgarian | | `my` | Burmese | | `ca` | Catalan | | `ceb` | Cebuano | | `ny` | Chichewa | | `zh-CN` | Chinese (Simplified) | | `zh-TW` | Chinese (Traditional) | | `co` | Corsican | | `hr` | Croatian | | `cs` | Czech | | `da` | Danish | | `nl` | Dutch | | `en` | English | | `eo` | Esperanto | | `et` | Estonian | | `fi` | Finnish | | `fr` | French | | `fy` | Frisian | | `gl` | Galician | | `ka` | Georgian | | `de` | German | | `el` | Greek | | `gu` | Gujarati | | `ht` | Haitian Creole | | `ha` | Hausa | | `haw` | Hawaiian | | `iw` | Hebrew | | `mrj` | Hill Mari | | `hi` | Hindi | | `hmn` | Hmong | | `hu` | Hungarian | | `is` | Icelandic | | `ig` | Igbo | | `id` | Indonesian | | `ga` | Irish | | `it` | Italian | | `ja` | Japanese | | `jw` | Javanese | | `kn` | Kannada | | `kk` | Kazakh | | `km` | Khmer | | `ko` | Korean | | `ku` | Kurdish | | `ky` | Kyrgyz | | `lo` | Lao | | `la` | Latin | | `lv` | Latvian | | `lt` | Lithuanian | | `lb` | Luxembourgish | | `mk` | Macedonian | | `mg` | Malagasy | | `ms` | Malay | | `ml` | Malayalam | | `mt` | Maltese | | `mi` | Maori | | `mr` | Marathi | | `mhr` | Mari | | `mn` | Mongolian | | `ne` | Nepali | | `no` | Norwegian | | `pap` | Papiamento | | `ps` | Pashto | | `fa` | Persian | | `pl` | Polish | | `pt` | Portuguese | | `pa` | Punjabi | | `ro` | Romanian | | `ru` | Russian | | `sm` | Samoan | | `gd` | Scots Gaelic | | `sr` | Serbian | | `st` | Sesotho | | `sn` | Shona | | `sd` | Sindhi | | `si` | Sinhala | | `sk` | Slovak | | `sl` | Slovenian | | `so` | Somali | | `es` | Spanish | | `su` | Sundanese | | `sw` | Swahili | | `sv` | Swedish | | `tl` | Tagalog (Filipino) | | `tg` | Tajik | | `ta` | Tamil | | `tt` | Tatar | | `te` | Telugu | | `th` | Thai | | `tr` | Turkish | | `udm` | Udmurt | | `uk` | Ukrainian | | `ur` | Urdu | | `uz` | Uzbek | | `vi` | Vietnamese | | `cy` | Welsh | | `xh` | Xhosa | | `yi` | Yiddish | | `yo` | Yoruba | | `zu` | Zulu |