The Google Translation Unlimited API provides seamless translation capabilities, language detection, and supported language listing.
/translate
source
(optional, default “auto”): Source language of the text to translate.target
: Target language to translate the text into.text
: Text to translate./detect
text
: Text you want to detect the language of./support
Here’s an example of using the translation API in Python:
import requests
url = "https://google-translation-unlimited.p.rapidapi.com/translate"
payload = {
"texte": "Hello darling, what are you doing now? I'm happy to speak with you my love",
"to_lang": "fr"
}
headers = {
"content-type": "application/x-www-form-urlencoded",
"X-RapidAPI-Key": "your RapidApi keys", # Add your RapidAPI key here
"X-RapidAPI-Host": "google-translation-unlimited.p.rapidapi.com"
}
response = requests.post(url, data=payload, headers=headers)
if response.status_code == 200:
translated_text = response.json()["translated_text"]
print("Translated Text:", translated_text)
else:
print("Error:", response.text)
If you have any problem, contact:
Apache License
Copyright © 2019 蓝色的秋风