Google translate API

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Google translate API

Post 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.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Google translate API

Post by Rathinagiri »

I think you can use CURL.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Re: Google translate API

Post 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.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Post Reply