# 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.
