Result Size Large? Any Larger than 8?

255 views
Skip to first unread message

vrgoogler

unread,
Nov 23, 2009, 3:30:53 AM11/23/09
to Google AJAX APIs
I am using PHP with the AJAX API...

$google_ajax_url = "http://ajax.googleapis.com/ajax/services/search/
web?v=1.0&rsz=large&safe=moderate&filter=1&hl=en&gl=us&q=$keyword";

The parameter rsz=large returns only 8 results. How do I get it to
return 10? I tried entering 10 but it is invalid. Small only returns 4
results. Any ideas?

Jeremy Geerdes

unread,
Nov 23, 2009, 6:42:31 AM11/23/09
to google-ajax...@googlegroups.com
You can only retrieve either 4 or 8 results from the Search API. To
obtain 10, you'll have to get the second page of results and splice
the two together. Of course, if you want to get the second set of 10
results, then you would have to get pages two and three of the
results. And so on a so forth.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
jgee...@mchsi.com

Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!
> --
>
> You received this message because you are subscribed to the Google
> Groups "Google AJAX APIs" group.
> To post to this group, send email to google-ajax...@googlegroups.com
> .
> To unsubscribe from this group, send email to google-ajax-searc...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=
> .
>
>

vrgoogler

unread,
Nov 23, 2009, 6:45:40 AM11/23/09
to Google AJAX APIs
Now I am thinking of doing something like this:

$google_ajax_url1 = "http://ajax.googleapis.com/ajax/services/search/
web?v=1.0&rsz=large&safe=moderate&filter=1&hl=en&gl=us&q=
$keyword&start=0";
$google_ajax_url2 = "http://ajax.googleapis.com/ajax/services/search/
web?v=1.0&rsz=small&safe=moderate&filter=1&hl=en&gl=us&q=
$keyword&start=8";

So I get the first 12 results so that I can remove the last results to
get the first 10 results. Really troublesome to do this but I can't
see any other way.
Reply all
Reply to author
Forward
0 new messages