views:

961

answers:

3

When you search google, it estimates the number of search results e.g.

Results 1 - 10 of about 103,000,000 for hello world

How do I get the number 103,000,000 programmically?

I'm not interested in the results, just that number, and I need to do about 100 of these searches at a time so webpage scrapping is not an option since google tends to block this kind of thing.

I've seen solutions where you can use the google soap API to do this but that's no longer an option since it's deprecated and they're no longer giving away API keys, and the AJAX API doesn't seem to offer this field :/

A: 

Maybe not an option, maybe not allowed and maybe not even working, but what about just doing these 100 searches and just use different Google servers and constantly change your identification (browser, cookies etc) and leave enough time between your searches? For example, if we take a nslookup on google.com, google.net, google.co.uk or google.jp we get a couple of different servers (74.125.95.104, 74.125.91.104, 72.14.203.104 for google.jp). Do the same for the others and you will easily come up with 30-40 of these servers or even more. It would probably be best, if you only do 1 or 2 searches on a server for each of your rounds. Good luck!

Update

Just looked at the "Flash and other Non-Javascript Environments" for the AjaxSearch and there seems to be a field called "estimatedResultCount" that you are maybe interested in (incl. code example for php, flash). One quick note: Sorry guys, I try to be agnostic towards my answers and not censor myself by not giving out possible options.

merkuro
This is a very poor spirited suggestion.
Ben S
not quite the kind of solution I was looking for. something that won't get me banned from google :P
Charles Ma
@Ben S, I don't get your point. I already stated that there might be problems involved and that the "terms of use" should be consulted. Beyond that it all depends on the project he is planing to do (public, private), but lets get back on topic. From a technical standpoint, have you tested it and is this approach not working for you? One personal note: I see no "evil" in firing one request per minute to a server.
merkuro
+1  A: 

When the search object is returned, it will have a property of 'results' as an array that contains the results objects, and a 'Cursor' property that contains the cursor object that has an estimatedResultsCount property. That's the fella your after.

Stuart Laverick
A: 

estimatedResultCount spits out garbage. Dont bother.

underdown