For about two years, I’ve maintained a Ruby library called EasyTranslate for working with the Google Translate API. Google Translate has been (like other Google APIs) free to use withing a certain range.
Recently, they’ve deprecated (read: completely turned off) access to v1, due to “substantial economic burden caused by extensive abuse”. That’s really a shame. The larger shame is that there is no free usage tier for v2 of the API. Even to santiy check my API client (that I don’t even use anymore), I need to pay.
This reminds me of an article I read yesterday on HackerNews (and linked by Kenny Katzgrau) about how one developer is fed up with freemium as a model due to lack of conversion from free to paying customers. I don’t really agree with that article for a few reasons:
But the article does frame a discussion for deeper problems with freemium APIs like Google’s. Automated abuse can quickly ruin a great service, but I have to think there must be a middle ground between non-keyed API access (as before), and no free-usage tier. What do you think?
NOTE: Last night I largely reorganized and re-spec’ed easy_translate to work solely off of the examples in the API docs. Its released now as v0.3.0.
EasyTranslate is a Ruby binding for the Google translate/detect APIs (Documentation). Its different than other libraries that do the same for a few reasons:
# woah, really?
EasyTranslate.translate('Hello, world', :to => :spanish)
=> "Hola, mundo"
# what about batch translation?
EasyTranslate.translate(['Hello', 'Goodbye'], :to => :spanish)
=> ["¡Hola", "Despedida"]
# what if you're even crazier?
EasyTranslate.translate(['Hello', 'Goodbye'], :to => [:es, :it])
=> [['¡Hola', 'Despedida'], ['Ciao', 'Addio']]
# translate something into every language in Google Translate
# WITH A SINGLE CALL TO THE API
EasyTranslate.translate('hello', :to => EasyTranslate.LANGUAGES.keys)
The whole thing is licensed under the MIT License, so get out there, make something cool, and let me know how it turns out!
$ gem install easy_translate