0

I have written a sample nodejs code to consume google translate API. For last 2-3 days I am getting undefined error intermittently. If I run this sample code multiple times, randomly few times I am getting the error. not sure if I am doing something wrong here or the service is experiencing some issues.

Please help, thanks in advance.

var googleTranslate = require('google-translate') 
('XXXXXXXXXXXXXXXX');

googleTranslate.translate(['Hello', 'Thank you'], 'en', 'de', 
function(err, translations) {
console.log(translations);
});
Nanu Kanu
  • 1
  • 3
  • Hi, could you share the exact error you are receiving? How are you executing this? I assume there were no changes on your side before it started failing, right? – Federico Panunzio Jul 12 '18 at 10:41

1 Answers1

1

Check your API_KEY , I faced with this problem before and my api key was wrong

Sina Mirshafiei
  • 312
  • 1
  • 4
  • 15