Page 1 of 1

Google translate API

Posted: Fri Aug 07, 2020 10:29 am
by vagblad
Hello,

Does anyone have any previous experience with the google translation api?

https://cloud.google.com/translate/docs ... text-drest
some examples there in c# and other languages.

Thanks a lot.

Re: Google translate API

Posted: Sun Aug 09, 2020 3:26 am
by Rathinagiri
I think you can use CURL.

Re: Google translate API

Posted: Wed Sep 09, 2020 11:59 am
by vagblad
Thanks Rathi
Yes you can use CURL for sure. I ended up using a simple HTTP request:

Code: Select all

https://www.googleapis.com/language/translate/v2?key=ΧΧΧΧΧΧΧΧΧΧΧΧΧ&source=el&target=en&q=καλημερα
you just need to replace the XXXXXXXXXXXX with you api key you get from google.
google sends back a response in json format which you can either decode it or just manipulate it as a string.

The only difference from the "simple" google translate is that using the API version you get unlimited translations while the normal version has a limit. I tried doing for example 100 translations in a row and my ip was getting banned from google, thats why we had to resolve to the api cloud version.

Anyway it works just fine i am just putting it here in case anyone might need to try it.
PS: the api cloud translation from google is a paid service.