Looking through the code, tranny does NOT include the HTTP_REFERER header. That 
needs to be changed, as the header is required by the TOS. Also, it does not 
support using the POST method, which would allow you to submit strings of up to 
5,000 characters in length. This would dramatically reduce the number of 
requests that you would have to make. I've filed issues with the tranny project 
for both of these matters. You can star them to receive updates at the links 
below:

HTTP_REFERER header not included in requests: 
http://code.google.com/p/tranny/issues/detail?id=2
Include support for POST method requests: 
http://code.google.com/p/tranny/issues/detail?id=3

That said, if you're still making a large volume of requests, neither of those 
suggestions will fully solve the issue that you're experiencing. There are two 
TOS issues of which you should be mindful: (1) The Translate API's TOS prohibit 
the use of "any robot, spider, site search/retrieval application, or any other 
device to retrieve... any portion of Google services." Essentially, this clause 
prohibits the use of any application that will make automated queries to the 
API. So you can't just start an app and let it run through a massive list of 
documents on its own. And (2) the TOS prohibit the storing of translation 
results for more than 15 days at a time. So you can't just run your documents 
through the translation service and then have the translation forever. You will 
need to refresh the translation every 15 days. This is really not ideal for a 
lot of applications.

Another thing you may want to consider, depending on exactly what you're doing, 
is that I've written a Perl module that provides an interface to the Translate 
API v2. There are some advantages and disadvantages to the v2 API. Probably the 
biggest advantages are the ability to send more than one string to translate 
per request and support for the POST method. And the biggest disadvantage is 
the 100,000 character/day limit imposed by Google. You can get more information 
here:

http://code.google.com/p/gtranslate-v2-pm/

Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:
jrgeer...@gmail.com

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

On May 13, 2011, at 6:41 AM, Sameer Rao wrote:

> Hello Jeremy,
>  
> Thank You for that quick reply...
> 
> 
> On Thu, May 12, 2011 at 7:06 PM, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> Unfortunately, it is extremely difficult to figure out what exactly is going 
> on without a few more details about how you're using and calling the API. 
> That said, you have provided enough information for me to guess that you're 
> using the Translate API v1. In general, with v1, the error that you're seeing 
> generally comes when you've sent too many requests and triggered the 
> throttling mechanisms. I believe, however, that it may also appear if you do 
> not include the HTTP_REFERER header from a non-browser client. You will 
> definitely want to check that out.
> 
> Yeah, my details as follow:
>       I am not using any browser related applications. Instead, I am trying 
> to translate using the command line operations. With this, I found out 
> "Tranny" as one of the translators which helps to translate using command 
> line. 
> This is where I found the documentation and the downloadable version of 
> translator.
> http://code.google.com/p/tranny/
> 
> Well, to be more specific, I have a many documents which are written in 
> different languages and I want to translate into English Language. For this 
> when I try to use "Tranny", I found this error...
> 
> As you said, it might be because I am trying to send too many requests in the 
> form of small strings of my document. But I have got no choice but to send 
> many requests so that the document gets translated. Well, it would be of 
> great help if you can suggest me with some solution to this issue.
>  
>  
> That said, if the issue is one of too many requests, you can mitigate the 
> situation to an extent by including the key, as you have proposed. In that 
> case, where you put the API key depends on how you're utilizing the API. If 
> you're using it via the Javascript API, you include the key as a parameter of 
> the jsapi loader, as below:
> 
> <script type="text/javascript" 
> src="http://www.google.com/jsapi?key=<YOUR_KEY_HERE>"></script>
> 
> If, however, you're using the API RESTful endpoints (i.e., from anything 
> other than the Javascript API), you need to include it as a parameter in the 
> url of any request you send to the endpoint, as below:
> 
> url = 
> "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&key=<YOUR_KEY_HERE>&q=hello,
>  world..."
> 
> As I said, if none of the above solves the problem, then please don't 
> hesitate to post back. Just remember that we'll need more details. I would 
> suggest one of two things. If you're using the Javascript API, post a link to 
> your page, regardless of whether it's working or not. That way we can see 
> what's going on in context. If you're not using the Javascript API or posting 
> a link is absolutely impossible, then copy the relevant code to a pasting 
> service and post the link to that.
> 
> Internally, when I tried to debug "tranny", I found it was used JSON module 
> in Perl. But nowhere I could find any information where I could put the key 
> information. 
> 
>  
> 
> Jeremy R. Geerdes
> Generally Cool Guy
> Des Moines, IA
> 
> For more information or a project quote:
> jrgeer...@gmail.com
> 
> If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan 
> Church!
> 
> 
> 
> -- 
> Regards,
> Sameer Rao.
> 
> -- 
> 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-search-api@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-ajax-search-api+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-ajax-search-api?hl=en.

-- 
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-search-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-ajax-search-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.

Reply via email to