views:

248

answers:

2

When I google for something, I get the count.

Results 1 - 10 of about 800

Is there any API or something like that to capture the number "800"? I have a database of a few thousand words and I want the google count against it.

A: 

There well could be an API, but until it's found, why not just sent the query and scrape the resulting page?

wget --output-document=- http://www.google.com/search?q=the+word | grep "Results 1 - 10 of about" | awk  etc...
wallyk
HTTP request sent, awaiting response... 403 Forbidden
shantanuo
lynx -source http://google.com/search?q=india | grep "of about <b>" # The number that I am looking for is immediately after the "of about <b>" part. How do awk it? # </b> of about <b>479,000,000</b>
shantanuo
+1  A: 

Google have a AJAX Search API with this example: Number of Search Results

Rubens Farias
The property name is "cursor" with a member called "estimatedResultCount" and it's documented here: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_class_GSearch and http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje
Dennis Williamson