New Parameter for Server Side API Calls

18 views
Skip to first unread message

Adam Feldman

unread,
Jan 19, 2010, 4:24:19 PM1/19/10
to Google AJAX APIs
Over the last several years, you've helped make Google's AJAX APIs
incredibly successful. Not surprisingly, however, there are some
people who try to take advantage of these free APIs by using them in
ways that they were not designed for, abuse which is prohibited by the
Terms of Use (http://code.google.com/apis/ajaxsearch/terms.html).
Specifically, some servers are making countless requests - requests
not made on the behalf of an end-user - in an attempt to scrape data
from the API.

To help us discourage this behavior without impacting legitimate
developers, we're adding a new parameter to the RESTful interface,
userip. With this parameter, developers have the option of supplying
the IP address of the end-user on whose behalf they are making the API
request. Doing so will help us distinguish this legitimate server-
side traffic from the more abusive scraping in which there are no end-
users.

Use of this new parameter is *not* required. However, if it is not
included with server-side requests, those requests are more likely to
be interpreted and automatically blocked as abuse, especially in
situations where a server is sending a high volume of traffic to the
API. Additional safeguards you can take include setting setting a
valid HTTP referer (as required by our Terms of Use) and using an API
key (http://code.google.com/apis/ajaxsearch/signup.html). These
additional measures will help us contact you in case there are
problems with your website or application (sometimes a programming
error results in massive traffic, forcing us to block your access if
we are unable to contact you). In choosing to utilize this parameter,
please be sure that you're in compliance with any local laws,
including any laws relating to disclosure of personal information
being sent.

Check the documentation for usage of the new parameter:
http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje

And don't hesitate to send us your feedback in this group.

Thanks,
Adam Feldman
Product Manager
Google Developer Team

Vision Jinx

unread,
Jan 20, 2010, 1:00:26 AM1/20/10
to Google AJAX APIs
Hey Adam,

Would it be possible to update these samples to include this?

http://code.google.com/apis/ajaxsearch/documentation/#fonje_snippets

Even if it's commented out (if you feel that is necessary) but showing
it's preferred but not required as you stated in your post.

Cheers!
Vision Jinx

> Check the documentation for usage of the new parameter:http://code.google.com/apis/ajaxsearch/documentation/reference.html#_...

Jeff S (Google)

unread,
Jan 26, 2010, 1:26:17 PM1/26/10
to Google AJAX APIs
Great suggestion. We've added examples of how to set the userip
parameter in requests.

Happy coding,

Jeff

Fitzchev

unread,
Feb 16, 2010, 11:12:07 AM2/16/10
to Google AJAX APIs
I knew that something happened when users start to complain few days
ago :-)

Just to be sure, I'm using the languageDetection API to detect (and
validate) the language of Word documents: to do so I'm extracting the
text and send several requests (using Flex/Flash) to the API and
compute the result. Using Firebug, I can see that now my requests are
blocked for a certain amount of time (from few ms to several seconds!)
before being "released". So I added an API key today to get around
this problem. Is it the correct way or am I missing something?

Thanks in advance,
Cyril

> Check the documentation for usage of the new parameter:http://code.google.com/apis/ajaxsearch/documentation/reference.html#_...

Jeremy Geerdes

unread,
Feb 16, 2010, 11:27:15 AM2/16/10
to google-ajax...@googlegroups.com
You'll probably also want to include the userip parameter.

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.
>

Fitzchev

unread,
Feb 18, 2010, 5:09:43 AM2/18/10
to Google AJAX APIs
As I'm using Flex to do the API call, using user_ip won't help as it
would be a different one depending on the user. And if I'm correct
it's not easy to pass http_referer in Flash...

Cyril

On Feb 16, 5:27 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> You'll probably also want to include the userip parameter.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.com

> jrgeer...@gmail.com

Jeremy Geerdes

unread,
Feb 18, 2010, 7:43:22 AM2/18/10
to google-ajax...@googlegroups.com
Yeah, I didn't think about that when I posted that comment. Sorry!

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!

vscoder

unread,
Feb 23, 2010, 8:39:15 AM2/23/10
to Google AJAX APIs
hello everyone
since the introduction of the mentioned new arguments (which i have
already implemented in my website) I get frequent temp bans from
Google. I think this might be due the high volume of traffic on my
website (something between 20 K to 50K a day)
On every page of my website (which by the way is a classifieds
website) is a list of related materials that is retrieved from both my
website and Google with the use of APIs. I have implemented the Userip
argument and am sending the end-user's (visitors) IP to the API, but
still get temp bans. the referrer is also being sent correctly.
what could be the cause of the bans?
any help is greatly appreciated.

Adam Feldman

unread,
Feb 23, 2010, 1:28:40 PM2/23/10
to Google AJAX APIs
Hello,

Can you tell me the referer that you're using with your API requests
and/or the IP address the requests are coming from? Feel free to
respond to me directly, and I'll investigate for you.

Thanks,
Adam

Fitzchev

unread,
Feb 24, 2010, 9:39:55 AM2/24/10
to Google AJAX APIs
No problem Jeremy :-) Maybe Adam can confirm that an API key is enough
because the response time is really slow - or at least slower than
before.

Thx

On Feb 18, 1:43 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> Yeah, I didn't think about that when I posted that comment. Sorry!
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.com

Adam Feldman

unread,
Feb 24, 2010, 12:42:07 PM2/24/10
to Google AJAX APIs
Hello Fitzchev,

If you're using Flash, I believe your requests should be originating
with the end user - therefore, we would see their IP address, not
yours, which means you don't need to use the userip parameter and you
shouldn't run into any problems over this.

I can assure you that when requests are blocked due to suspected
abuse, they're blocked outright, with an error message returned,
rather than simply a reduction in the quality of service - so if
you're getting results, you're not blocked and any slowdown wouldn't
be related.

I hope this helps,

Adam

MrCoder

unread,
Mar 5, 2010, 4:16:48 AM3/5/10
to Google AJAX APIs
Hi Adam,

We have added a nice "Google Translate" button to our client which
will issue translation of all sentences in a document through ajax
calls from java (could be thousands of calls). I have recently run
into getting the translations banned due to possible abuse of the
service, which makes this feature a no-no for us. Is this really
violating anything? If so, do you have any plans of releasing some
costly company version where it's possible to translate more than
"Hello world" once each minute?

Thanks!
/R

Adam Feldman

unread,
Mar 5, 2010, 7:48:18 PM3/5/10
to Google AJAX APIs
Hello,

Are you using the userip parameter in your server-side requests? If
so, please let me know the IP address of your server and/or the http
referer that you're including with your requests (feel free to respond
here or off thread if you prefer).

If you're making the requests client side, please post a URL to your
website.

Either way, I'm glad to investigate and help you resolve the problem.

Cheers,
Adam

Hugo

unread,
Mar 23, 2010, 5:33:50 PM3/23/10
to Google AJAX APIs
I meant for the following to be shared with everybody accidentally hit
"Reply to author" instead of "Reply". Transcript below!

------------------------------------------------------------------------------------------------------

The intent of the http referer requirement, as described in the
documentation, is to accurately identify your site/app. Inclusion of
a referer that points to more information (e.g. a download page) is
sufficient.

Also, you're correct that the userip parameter is designed for server-
side, not client-side, requests.

In the future, please ask your questions in the group so that everyone
can benefit from the answers :)

Cheers,
Adam

On Tue, Mar 23, 2010 at 1:37 PM, Hugo <hha...@gmail.com> wrote:
Adam, what is Google's position regarding API calls from native apps?

Specifically I am working on an iPhone/Android app that would make API
calls. Of course the call isn't originating from a web page so there
is no way that a technically accurate http referer header can be
provided (however a useful referer header could be added to the
request and pointing to a page describing API usage context & contact
for more info...). Is there a possible exception to the "accurate http
referer" rule in that context? or at least a looser interpretation?

As a side note, in that case the IP seen by google would be the IP of
the client, I assume that would make the use of the userip parameter
irrelevant?

Thanks!

Reply all
Reply to author
Forward
0 new messages