Google Translate

FREEMIUM
Por Google Cloud | Actualizada 2 months ago | Text Analysis
Popularidad

9.9 / 10

Latencia

666ms

Nivel de servicio

99%

Health Check

N/A

Volver a todas las conversaciones

Method translate returns error 502 bad gatewey

Rapid account: Orazyo
orazyo
il y a 3 ans

Hello,

the method for translating the text always returns error 502 bad gatewey in the React app, while if I try it from Postman it returns the translated text correctly.
Can anyone help me?

Thank you
Maico

Rapid account: Technicalduniya 623
technicalduniya623 Commented il y a un an

messages:"The API is unreachable, please contact the API provider"
info:“Your Client (working) —> Gateway (working) —> API (not working)”

same problem anyone solution

Rapid account: Kumarkapil 291
kumarkapil291 Commented il y a 3 ans

Try so many methods but always get the below error.

{
“messages”: “The API is unreachable, please contact the API provider”,
“info”: “Your Client (working) —> Gateway (working) —> API (not working)”
}

Rapid account: Keyboard TC
keyboardTC Commented il y a 3 ans

Hello can someone please help. I tried using the api call with javascript fetch but i get the 502 (Bad Gateway).
Do i need to change something when using the api code in my javascript ?

Rapid account: Sudarshan 6493
sudarshan6493 Commented il y a 3 ans

Go to Sudarshan Dalavi Blog for more detailed information.

Rapid account: Joialmeida 18
joialmeida18 Commented il y a 3 ans

I’m facing the same issue but using fetch() in react. please help

Rapid account: Chippagirisumanth
chippagirisumanth Commented il y a 3 ans

Sir I too got the same response,
{
“messages”:“The API is unreachable, please contact the API provider”,
“info”:“Your Client (working) —> Gateway (working) —> API (not working)”
}
Sir, I use javascript (fetch method), Can someone helping me sir. I badly need this API working for me sir.
Thanks in advance.

Rapid account: Orazyo
orazyo Commented il y a 3 ans

David works, thanks

Rapid account: David Brady
david.brady Commented il y a 3 ans

I ran into the same issue today using node.js. I was able to resolve the issue testing with the google translate API. Below is some sample code that runs from a node.js client and which should be easily adaptable to React. The trick is to use qs which is a querystring parsing and stringifying library with some added security. The example below translates “Hello World!” from English into Italian. Good luck!

let qs = require(‘qs’)
let axios = require(‘axios’)

const options = {
method: ‘POST’,
url: ‘https://google-translate1.p.rapidapi.com/language/translate/v2’,
data: qs.stringify({
q : ‘Hello World!’,
source : ‘en’,
target : ‘it’
}),
headers: {
‘content-type’: ‘application/x-www-form-urlencoded’,
‘accept-encoding’: ‘application/gzip’,
‘x-rapidapi-key’: ‘{{YOUR_API_KEY}}’,
‘x-rapidapi-host’: ‘google-translate1.p.rapidapi.com
}
};

axios.request(options).then(function (response) {
console.log(response.data.data[‘translations’][0][‘translatedText’]);
}).catch(function (error) {
console.error(error);
});

Rapid account: Orazyo
orazyo Commented il y a 3 ans

This is response

{
“messages”:“The API is unreachable, please contact the API provider”,
“info”:“Your Client (working) —> Gateway (working) —> API (not working)”
}

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios