How to use Translation API for Text with Python in 5 minutes?
Tags: api, ai, python, tutorial
Published: 2022-11-23 11:19:17


_In this tutorial, you will learn how to use Automatic Translation API in 5 minutes using Python and Eden AI Automatic Translation API. Eden AI provides an easy and developer-friendly API that allows you to translate your texts.
‍_

## What is Automatic Translation?
‍Automatic Translation also called Machine Translation (MT) is the process of translating text from one language to another without human involvement.

Nowadays, translation is crucial for many companies that have products or applications used by large numbers of people around the world. In addition, companies subsequently use these translated texts on other Natural Language Processing (NLP) tools such as Sentiment Analysis, Keyword Extraction or Text Summarization. As a result, developers are regularly challenged to develop websites that support text translation between multiple languages.

Eden AI Automatic Translation API allows to instantly translate a text into another language, by provinding a simple interface for dynamically translating any supported language. It can also be used to detect a language in cases where the source language is unknown.


[Try these APIs on Eden AI](https://app.edenai.run/user/register?referral=how-to-translate-python)
‍

## Getting Started with Automatic Translation API
The first step to using Automatic Translation API with Python is to install Python's requests package, that will allow you to call Eden AI API.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ws4cjzv03s4ie5d4p573.png)

Next, you'll need to install Python's JSON package in order to read and print the results of the API request.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lc09i9stn4zb2qayyuw3.png)



## How to use Automatic Translation API with Python
You are now ready to process text into Eden AI Automatic Translation API in many languages with different providers. To access the list of languages supported, have a look at Eden AI documentation.


### 1. Get your Automatic Translation API Key on Eden AI
To perform Automatic Translation, make sure to create an account on Eden AI for free. Then, you will be able to get your API key direclty from the homepage with free credits offered by Eden AI.

![Eden AI platform - Get your API key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30n21fnfpgqjydnqfq7w.png)

[Get your API key for FREE](https://app.edenai.run/user/register?referral=how-to-translate-python)

### 2. Start translating with Eden AI API Key
Now that you have imported packages on Python and gotten your API key, it's time to translate your text. With Eden AI, you can choose from a range of different engines you want for Automatic Translation. To help you choose the best provider according to your needs and type of project, you can access our list of Automatic Translation providers.
‍

Here is the Python script you need to write on your notebook:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yggas3vihya4t0b2de62.png)

For instance, here we have called two different Automatic Translation engines. Eden AI API then returns in its JSON response of those two providers.

Once the request is done, you will be able to get the result with this print:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkuwl71xuatvlswnf597.png)

Here is an example of a Automatic Translation response:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1uj0i2lmiyajdyf3iu13.png)


## Benefits of using Automatic Translation API with Eden AI
As you can see, using Automatic Translation with Eden AI API is quick and easy.

![Best Automatic Translation AIs in one API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p67ufcospr726y8w3zgu.gif)

### Save time and cost
We offer a unified API for all providers: simple and standard to use, with a quick switch between providers and an access to the specificic features of each provider


### Easy to integrate
The JSON output format is the same for all suppliers thanks to Eden AI's standardisation work. The response elements are also standardised thanks to Eden AI's powerful matching algorithms.


### Extensive language coverage
Eden AI aggregates the best Machine Translation APIs of the market: engines dedicated for different languages like English (US, GB, ETC.), Chinese (trad, off, etc), European languages, Afrikaans languages, Asian languages, and other rare languages.
‍

### Customization
With Eden AI you have the possibility to integrate a third party platform: we can quickly develop connectors. To go further and customize your Automatic Translation request with specific parameters, check out our documentation.
‍

[Create your Account on Eden AI](https://app.edenai.run/user/register?referral=how-to-translate-python)