Translate API error: "Too many text segments"

2,102 views
Skip to first unread message

Thibaud

unread,
Mar 10, 2011, 10:57:17 PM3/10/11
to Google AJAX APIs
Hi,

What's the limit for the number of text segments that can be sent to
the Google Translate API v2?

I get an error when sending 145 q parameters. With HTTP GET the URL's
query string is 1953 bytes, and with HTTP POST the request is Content-
Length: 1955, so they're both under 2k. My code works correctly in
both GET and POST with shorter queries, so my code is not at fault.
And I'm not hitting the maximum number of characters per day as I can
keep successfully sending shorter queries. The problem is that I'm
sending too many q parameters and I can't find documentation about
what that limit is.

Here below is the URL that I'm using. I replaced my API key with Xs.


Thank you,

Thibaud Lopez Schneider


--

https://www.googleapis.com/language/translate/v2?&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&source=en&target=de&q=Service+cat%3a&q=Num+sys+service%3a&q=Model%2fsite%3a&q=Maintenance+pgm%3a&q=&q=&q=&q=&q=Apply&q=Product++++++++&q=Stp&q=Service+++++++++++++&q=Description&q=&q=001&q=ALARM&q=Investigate+Alarm+(default+for+MOS085)&q=&q=001&q=AUDIT&q=Ad+Hoc+Audit&q=&q=001&q=BREAKDOWN&q=Investigate+breakdown+(Auto-Release)&q=&q=001&q=CLIP-01+MOD&q=Out+of+Scope+Service&q=&q=001&q=CORRECTIVE+A01&q=Investigate+and+repair&q=&q=001&q=CORRECTIVE+P01&q=Corrective+work+request&q=&q=001&q=DEMO&q=Equipment+demo&q=&q=001&q=DYN+INSP+-+CHG+FILTR&q=Change+oil+filter&q=&q=001&q=DYN+INSP+-+FIX+LEAKS&q=Fix+leaks+found+during+inspection&q=&q=001&q=DYN+INSP+-+OIL+TOPUP&q=Top+up+oil+as+necessary&q=&q=001&q=IMPROVEMENTS&q=Investigate+Improvement+Requirements&q=&q=001&q=IN+SCOPE&q=In+Scope+Service&q=&q=001&q=INSPECT+EQUIPMENT&q=Investigate+equipment+condition+(MOS125)&q=&q=001&q=INSTALLATION+WORK&q=Installation+work&q=&q=001&q=NEW+REQUEST&q=Work+request&q=&q=001&q=OUT+SCOPE&q=Out+of+Scope+Service&q=&q=001&q=OUT+SCOPE+2&q=Out+of+Scope+Service&q=&q=001&q=PM1&q=PM+Calibration&q=&q=001&q=REQUEST&q=Carry+out+request+(No+Operations)&q=&q=001&q=REVIEW+COMPLAINT&q=Work+request&q=&q=001&q=RGA+REPAIR&q=RGA+Repair&q=&q=001&q=SHUTDOWN&q=All+day+shutdown&q=&q=001&q=WARRANTY+SERVICE&q=Warranty+Service+(MOS390)&q=10-001&q=001&q=WEEKLY+INSPECTION&q=Carry+out+weekly+inspection&q=1ETA10&q=001&q=CLEANING&q=Cleaning+Service&q=606550&q=001&q=INSPECTION+(IAC)&q=Inspect+Motor+(IAC+items+service)&q=606550&q=001&q=MODIFICATION&q=Manufacturers+Modification+(EO+MOS200)&q=606600&q=001&q=ABSOLUTE+METER+SERV&q=Absolute+Meter+Service&q=606600&q=001&q=COMPETING+METERS&q=Competing+Meter+Service&q=606600&q=001&q=DYNAMIC+INSPECTION&q=Carry+out+dynamic+inspection&q=606600&q=001&q=EMERGENCY&q=Emergency+Work&q=606600&q=001&q=FIXED+DATE+SERVICE&q=Fixed+Date+Service+(Tuesday)&q=606600&q=001&q=IMPELLER+CHECK&q=Check+impleller+condition

Jeremy Geerdes

unread,
Mar 10, 2011, 11:19:26 PM3/10/11
to google-ajax...@googlegroups.com
I get an error at 129, but 128 seems to work fine. I would note, though, that if this would probably change depending on the length of the strings, too. For instance, if you submit 20 strings at 5000 characters each, you will have exhausted your 100K characters/day quota.

Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:
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.
>

Thibaud

unread,
Mar 11, 2011, 2:21:05 AM3/11/11
to Google AJAX APIs
Yes, I get the limit at 128 as well. I'll have to split the N text
segments into several HTTP Requests of 128 texts each. Thanks for
checking!
Reply all
Reply to author
Forward
0 new messages