RenatoSousa89 / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 0 forks source link

Google axis api for web search. Related to Issue #4: The number of items in cursor.pages[] is sometimes incorrect. #591

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Issue following query for "barack obama":
https://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&hl=en&q=bar
ack+obama&start=0

2. Surely you should received _lots_ of results. You do. The cursor from the 
results shows 8 pages (each with 8 results) are available:

{"responseData":{"cursor":{"moreResultsUrl":"http:\/\/www.google.com\/search?oe=
utf8&ie=utf8&source=uds&start=0&hl=en&q=barack+obama","currentPageIndex":0,"page
s":[{"start":"0","label":1},{"start":"8","label":2},{"start":"16","label":3},{"s
tart":"24","label":4},{"start":"32","label":5},{"start":"40","label":6},{"start"
:"48","label":7},{"start":"56","label":8}]

3. But the systems returns only the first 3 or so pages, ~27 total results. 
When the following pages are queries. No more results are available:
https://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&hl=en&q=bar
ack%2525252Bobama&start=32
{"responseData":{"cursor":{"moreResultsUrl":"http:\/\/www.google.com\/search?oe=
utf8&ie=utf8&source=uds&start=32&hl=en&q=barack%2525252Bobama"},"results":[]},"r
esponseDetails":null,"responseStatus":200}.

If however, I take the above query and paste it into a web browser, the results 
are available.

Also, I instead of starting at the first page, i.e., start=0, and working up, I 
start with the last page and work down, i.e., start=7, I get the last three 
results pages. So clearly the results are there.

Is Google limiting these results in some undocumented way?  Please advise so I 
can use this interface in a deterministic way. At a minimum the documentation 
for using the API should be updated.

Thanks,
Jay Urbain

What version of the product are you using? On what operating system?
google-axis-apis1.0.63

Please provide any additional information below.

Querying for barack obama:

https://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&hl=en&q=bar
ack+obama&start=0

{"responseData":{"cursor":{"moreResultsUrl":"http:\/\/www.google.com\/search?oe=
utf8&ie=utf8&source=uds&start=0&hl=en&q=barack+obama","currentPageIndex":0,"page
s":[{"start":"0","label":1},{"start":"8","label":2},{"start":"16","label":3},{"s
tart":"24","label":4},{"start":"32","label":5},{"start":"40","label":6},{"start"
:"48","label":7},{"start":"56","label":8}],"estimatedResultCount":"11800000"},

Original issue reported on code.google.com by jay.urbain@gmail.com on 6 Jun 2011 at 1:36