Question on MAX Character Request for Translate API

51 views
Skip to first unread message

casbboy

unread,
Jun 10, 2010, 5:06:00 AM6/10/10
to Google AJAX APIs
I'm currently using the Translate AJAX Api through Google and I'm
confused on the character limit.

Is it 500 or 250 characters? Then I saw there was a way you can get
max of up to 5000 characters.

Is this the case? To get max characters up to 5000 for the
translation, should I assume that the only way to do that is not with
Javascript (like the function Google kindly provides), it to do so
through a PHP script?

Anybody got a tutorial on this if that's the case?

And, anyway to get permission to expand the character limit for the
AJAX?

Cheers!
Ryan

Jeremy Geerdes

unread,
Jun 10, 2010, 12:39:43 PM6/10/10
to google-ajax...@googlegroups.com
This is a perpetual question with the Language API. The technical limit for the API is a 5,000 character string. However, that is AFTER the string is uriencoded. Also, it is only available using a POST request for two reasons: (1) Google has implemented a ~2,000-character limit on all URLs that their servers will process (i.e., if you submit a url longer than that, they will simply ignore it); and (2) even if Google hadn't implemented that limit, MSIE has a similar url length restriction in the browser.

The practical ramifications of this limitation is that, while you can easily translate short strings via the Google-provided jsapi, you will have to develop your own solution for longer ones. This solution can use PHP, Perl, or any other server-side language you want, but because it will have to use the POST method to submit the request to Google, a strictly client-side solution will be impractical for some time.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jrge...@gmail.com

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

> --
> You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
> To post to this group, send email to google-ajax...@googlegroups.com.
> To unsubscribe from this group, send email to google-ajax-searc...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
>

Reply all
Reply to author
Forward
0 new messages