Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
574 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...