How can I get the number of hits of a query in a search engine in Java/JavaScript?

900 Views Asked by At

I need to find the number of hits that query gets in a web search engine (such as Google) in a specific domain. For instance, if the user searches '"dry martini recipe" site:.uk', Google shows "About 15,800 results". I need to get that number (15,800).

The Google API used to be able to do this, but now is deprecated. I have considered web scraping, but since it is not allowed, I would rather not go this way. Using Google is in no way a must, I have considered engines like Duck Duck Go, but the web results do not seem to include the total count of this of a query.

0

There are 0 best solutions below