Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google AJAX API - How do I get more than 4 Results?

Tags:

Im using the google APIs ajax below to get images for particular search terms. This is being done in a WinForms app.

The below link seems to work, but it only returns 4 results (via JSON)

Anyone know how to coax more out of it?

http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=Apple+Cake

Obviously there has to be another parameter to request more or page through the results, but I can't seem to figure it out? Anyone know?

like image 445
Jason Avatar asked Feb 01 '11 22:02

Jason


2 Answers

I believe the only way to do that is to make multiple calls to the webservice specifying the 'start' parameter.

http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=Apple+Cake&start=4 

The start parameter is the 0-based index into the search results. So in this example, it would return images 4..7.

You can also add the parameter rsz=[1-8]. The default value is 4. That's why you're getting 4 results per request. Here's a link:
http://code.google.com/apis/imagesearch/v1/jsondevguide.html#basic_query

like image 168
rforte Avatar answered Oct 20 '22 15:10

rforte


You can use "&rsz=8", refer below...

http://ajax.googleapis.com/ajax/services/search/video?q=SpongeBob%20Full&v=1.0&start=8&rsz=8

like image 41
user2862302 Avatar answered Oct 20 '22 14:10

user2862302