Search code examples
htmlscreen-scrapingtext-extractiongoogle-search-api

How to get the number of results found for a keyword in google


I need to supply a keyword like "blue metal kettle" (with/without quotes) and get only the number of results found for this search. If I search without quotes right now, I get:

 Results 1 - 10 of about 1,040,000 for blue metal kettle. (0.19 seconds)

Here '1,040,000' is the number I want. Is there any API function to do this, or I must extract this number through the HTML? What's the best way to do this?


Solution

  • From the Google Ajax API, there's a estimatedResultsCount property in JSON, but you can read about unresolved complaints filed on the issue tracker:

    Result count varies
    http://code.google.com/p/google-ajax-apis/issues/detail?id=32

    (I see the Question is tagged PHP, but client-side javascript in conjunction may be of interest.)