How can I get a translated string, e.g. English to Spanish, from Google Translate with some command line tools like curl? I looked at the page source but Google Translate doesn't seem to include the translation result in its html source even though the result is rendered on the screen. So

 curl "https://translate.google.com/#auto/es/stay%20calm"

didn't work--just gave me the html source that doesn't have either original string or translated one. And I heard that their API was not free so I don't want to use it. I hear that there's also Microsoft's translation service, but I'd like to stick to Google's if possible.

  • I suspect that they make it difficult to use their service outside of a browser with Javascript (you're supposed to use the API if you want to do that). You may need to use something more sophisticated than curl. If so the answers here should help. – Gilles Jun 27 '16 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.