tags:

views:

750

answers:

1

According to : http://code.google.com/apis/ajaxsearch/documentation/#fonje

I get back a cursor result, but stupidly, the moreResultsUrl returns a URL NOT to the JSON service but to the main site - how do instead fetch the next page of results into JSON?

+1  A: 

Well, that's because moreResultsUrl is pointing to http://www.google.com/search instead of http://ajax.googleapis.com/ajax/services/search/web.

What you need are just the parameters of the moreResultUrl which you can pass to http://ajax.googleapis.com/ajax/services/search/web for the JSON result.

For example:

http://www.google.com/search?v=1.0&q=Luca

is translated in JSON with

http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Luca

Google is just showing you their RESTful api, it's up to you to use the pages JSON value with whatever interface you want.

Luca Matteis
Thanks, yeah I worked out I could just slap start at the end of the URL. Just seemed odd, and I think it is still wrong to have a link to what is kind of irrelevant in the context of an API.
Michael Neale
Yes that's true. The only use I could think of "moreResultsUrl" is for external linkage to google's website, although the naming is totally inappropriate, in my opinion.
Luca Matteis