Michael Neale
Michael Neale

Reputation: 19478

Google JSON/Ajax API - how do you get the next page of results?

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?

Upvotes: 1

Views: 4035

Answers (1)

Luca Matteis
Luca Matteis

Reputation: 29267

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.

Upvotes: 2

Related Questions