Google Translate API with wget (only one client and connection): Suspected Terms of Service Abuse


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Google Translate API with wget (only one client and connection): Suspected Terms of Service Abuse
# 1  
Old 11-18-2011
Google Translate API with wget (only one client and connection): Suspected Terms of Service Abuse

Hi

Script

Code:
> grep translate .bashrc 
translate(){ wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }

error

Code:
> translate "Ich will schwimmen" de en
{"responseData": null, "responseDetails": "Suspected Terms of Service Abuse. Please see http://code.google.com/apis/errors", "responseStatus": 403}

Quote from https://code.google.com/apis/errors/

Quote:
  • We received automated requests, such as scraping and prefetching. Automated requests are prohibited; all requests must be made as a result of an end-user action.
  • Your website charges users. All websites or apps which use Google APIs must be free of charge.
  • Your website caches or stores results. Caching or storing results is allowed in some APIs. Please review the Terms of Use for the API(s) you are using for specific caching policies.
  • Your website does not supply a proper attribution. The Terms of Use require all users to supply the proper attribution with all search results.
  • Your website uses the RESTful interface, but does not include a valid HTTP referer. The API requires a valid referer.
can you repdroduce? Howto fix?
# 2  
Old 11-18-2011
You must include the HTTP referrer header in your call to the API and you also must have a valid Google API key.
# 3  
Old 11-18-2011
Code:
wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}"

Code:
Automated requests are prohibited; all requests must be made as a result of an end-user action.

Running translate by hand in a terminal would be okay by that description, but if you wanted to use that function to automate anything, that would definitely be a violation.
# 4  
Old 11-18-2011
You can run the Google Translate AJAX API via an automated program; but you must follow the Google TOS. The TOS has specific requirements such as (1) the HTTP referrer field must be present in all API calls and (2) the client must have an API key (from Google) and (3) the client site must have attribute the translation to Google, etc etc.

We used to run this same API on this site and have a lot of coding experience with it.
This User Gave Thanks to Neo For This Post:
# 5  
Old 11-18-2011
did I understood right?

- I can't fake a referer?
- I need to sign up with Google as dev?
# 6  
Old 11-18-2011
See wget's manual page.

If all you do is fake a referer, google would be within their rights to block you or worse. I'm not sure it'd even work, anyway. There's ways other than referrers to check if you're a person instead of a script.
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

SSL_ERROR_SYSCALL in connection to qa-api.ncl.com:443

I am getting SSL_ERROR_SYSCALL in connection to qa-api.ncl.com:443. Please help me on this. But I am able to get response in Soap UI. Please use CODE tags when displaying sample input, output, and code segments. (13 Replies)
Discussion started by: Ayeesha
13 Replies

2. UNIX and Linux Applications

Problems with wget and https connection

Hi, I have wget for linux but I'm having trouble using it. I am trying to use it with a HTTPS connection to save cookies but it doesn't works. I do: wget --save-cookies=cookies.txt --post-data... (2 Replies)
Discussion started by: mierdatuti
2 Replies

3. Linux

Better FTP service needed. (suspected inteferance)

Hello there, I have of recent been having overbearing problems with my Linux computer when accessing servers via FTP. The server behaves rather erractically and refuses to complete uploads, merely stalling the transfer for an unpredictable amount of time, which can stem from being either 5... (2 Replies)
Discussion started by: Noran Rad
2 Replies
Login or Register to Ask a Question