Language Translation API

Language Translation API

Translate any given text from and between 47 languages (IBM Watson).
Free Plan $0.00 Monthly Subscribe
20 Requests / Monthly
Free for Lifetime
No Credit Card Required
MOST POPULAR
Starter Plan $24.99 Monthly Subscribe
1,000 Requests / Monthly
Standard Support
Fast and reliable
47 languages supported
Pro Plan $119.99 Monthly Subscribe
5,000 Requests / Monthly
Standard Support
Fast and reliable
47 languages supported
Custom Plan Volume Monthly Contact Us
Any requests volume you need
Fast and reliable
47 languages supported

The IBM Watson Language Translator service converts text input in one language into a destination language for the end user using background from domain-specific models. Translation is available among Arabic, Catalan, Chinese (Simplified and Traditional), Czech, Danish, Dutch, English, Finnish, French, German, Hindi, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian, Spanish, Swedish and Turkish (some languages may not be available for all domains).

Neural Machine Translation

By default all language pairs leverage neural machine translation. This new technology uses deep learning to improve translation speed and accuracy.

Supported Languages

Arabic, Bengali, Bulgarian, Catalan, Chinese (Simplified & Traditional), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Gujarati, Hebrew, Hindi, Hungarian, Irish, Italian, Indonesian, Japanese, Korean, Latvian, Lithuanian, Malay, Maltese, Malayalam, Nepali, Norwegian, Polish, Portuguese (Brazil), Romanian, Russian, Sinhala, Slovak, Slovenian, Spanish, Swedish, Tamil, Telugu, Thai, Turkish, Urdu, and Vietnamese

Protect your privacy

We protect your privacy so you can own your data. With Watson Language Translator, opt-out of any data collection.

Sample Code

Below is a sample cURL command translating a famous speech by President Kennedy into Simplified Chinese

curl --location --request POST 'https://api.apilayer.com/language_translation/translate?target=zh' \
--header 'apikey: YOUR API KEY' \
--data-raw 'We choose to go to the Moon in this decade and do the other things, not because they are easy, but because they are hard, because that goal will serve to organize and measure the best of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to postpone, and one which we intend to win, and the others, too.'

You don't need to specify the source language as it will be automatically detected. If you need to be spesific, you can do so by using source parameter in the query string

The response will be as follows:

{
    "translations": [
        {
            "translation": "我们选择在这十年去月球,做其他事情,不是因为它们容易,而是因为它们很困难,因为这一目标将有助于组织和衡量我们的能量和技能,因为这一挑战是我们愿意接受的,一个我们不愿推迟的挑战,一个我们想要赢得的挑战,另一个是我们想要赢得的,其他人也一样。"
        }
    ],
    "word_count": 78,
    "character_count": 359,
    "detected_language": "en",
    "detected_language_confidence": 0.9999999999990641
}

Language Translation API Reference

This API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Just Getting Started?

Check out our development quickstart guide.

Authentication

Language Translation API uses API keys to authenticate requests. You can view and manage your API keys in the Accounts page.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

All requests made to the API must hold a custom HTTP header named "apikey". Implementation differs with each programming language. Below are some samples.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Endpoints

Lists all supported languages

Parameters
No parameters.
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Detects the language from given text

Parameters

body (required)

Text to identify language

Location: Body, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Translates a text between languages

Parameters

body (required)

Text to translate (max: 1000 characters)

Location: Body, Data Type: string

target (required)

Target language to translate (2 chars ISO format)

Location: Query, Data Type: string

source (optional)

Source language (2 chars ISO format)

Location: Query, Data Type: string

** A word enclosed with curly brackets "{ }" in the code means that it is a parameter and it should be replaced with your own values when executing. (also overwriting the curly brackets).
Returns

Below is a sample response from the endpoint


If you wish to play around interactively with real values and run code, see...

Rate Limiting

Each subscription has its own rate limit. When you become a member, you start by choosing a rate limit that suits your usage needs. Do not worry; You can upgrade or downgrade your plan at any time. For this reason, instead of starting with a larger plan that you do not need, we can offer you to upgrade your plan after you start with "free" or "gold plan" options and start using the API.

When you reach a rate limit (both daily and monthly), the service will stop responding and returning the HTTP 429 response status code (Too many requests) for each request with the following JSON string body text.

{
"message":"You have exceeded your daily\/monthly API rate limit. Please review and upgrade your subscription plan at https:\/\/apilayer.com\/subscriptions to continue."
}

A reminder email will be sent to you when your API usage reaches both 80% and 90%, so that you can take immediate actions such as upgrading your plan in order to prevent your application using the API from being interrupted.

You can also programmatically check your rate limit yourself. As a result of each request made to the APILayer, the following 4 fields provide you with all the necessary information within the HTTP Headers.

x-ratelimit-limit-month: Request limit per month
x-ratelimit-remaining-month: Request limit remaining this month
x-ratelimit-limit-day: Request limit per day
x-ratelimit-remaining-day: Request limit remaining today

You can contact our support unit if you need any assistance with your application regarding to handle the returned result by looking at the header information.

Error Codes

APILayer uses standard HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate a clientside error, which means that failed given the information provided (e.g., a missing parameter, unauthorized access etc.). Codes in the 5xx range indicate an error with APILayer's servers (normally this should'nt happen at all).

If the response code is not 200, it means the operation failed somehow and you may need to take an action accordingly. You can check the response (which will be in JSON format) for a field called 'message' that briefly explains the error reported.

Status Code Explanation
400 - Bad Request The request was unacceptable, often due to missing a required parameter.
401 - Unauthorized No valid API key provided.
404 - Not Found The requested resource doesn't exist.
429 - Too many requests API request limit exceeded. See section Rate Limiting for more info.
5xx - Server Error We have failed to process your request. (You can contact us anytime)

You can always contact for support and ask for more assistance. We'll be glad to assist you with building your product.