views:

292

answers:

3

Google states the following in the AJAX Feed API docs:"Applications MUST always include a valid and accurate http referer header in their requests."

I am building a native iPhone application and would like to use the Google AJAX Feed API's REST interface from my app's native objective-c code. Is the API only for use on websites, or can I use it from a native app? In the case that I can use it from the native app, what would my http referer header be?

A: 

While I don't know the specific http referer values that Google would accept, I can assure you that you can impersonate any and all browsers. I often use Safari (which is happy to impersonate a wide variety of other browsers) and browse to my own test site to see what the browser sends to the server. This example of why http_referer testing doesn't work is illustrative.

The problem is I'm developing a legitimate commercial application, and would like to have a more straightforward method than referer spoofing. I guess my question just boils down to: is the AJAX feed API intended only for web apps?
Andres Bonilla
A: 

Hi, i'm currently asking myself that very same question. Did you get any answer ? Is it possible to use ajax search API in a native iphone application ?

I've looked at that video http://www.youtube.com/watch?v=C2FL7XsAgeg and it seems to indicate that it is indeed possible.

Did you have any success doing so ?

Ben G
Never got a solid answer.
Andres Bonilla
A: 

If you look at the sign up page it refers repeatedly to "your web site" and says the key is only valid for the site you sign up with, so it's fairly clear cut from Google's point of view they only intend it to be used for websites.

I'm surprised there's no explicit discussion of this in the T&Cs though. My interpretation is you can use it within the letter of the terms, but not within the spirit.

grahamparks