Reputation: 1
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);
});
Upvotes: 0
Views: 1006
Reputation: 312
Check your API_KEY , I faced with this problem before and my api key was wrong
Upvotes: 1