Is there a way to search on a specific Google site using the search API?

I have a script that reads Google results using the Google Custom Search API, I went through the docs, and I managed to set the language and country to filter the results, but the results are still different from the results that I get from the site.

https://www.googleapis.com/customsearch/v1?key=KEY&cx=017576662512468239146:omuauf_lfve&q=gelato

http://www.google.it/#hl=en&output=search&q=gelato

Is there a way to get the same results from the API as if I were using a website?

+2
source share
1 answer

The user search API says that the parameters are "cr" for country restrictions (s).

Parameter

'hl' is used to display the text of the results in a specific language (user interface language).

'gl' should be used if you want the results to match geolocation relevance.

Parameter

'lr' should be used in conjunction with or instead of the 'cr' parameter to limit the results to specification.

https://developers.google.com/custom-search/v1/cse/list

+1
source

Source: https://habr.com/ru/post/1336551/


All Articles