Google Engines¶
google API¶
For detailed description of the REST-full API see: Query Parameter Definitions. Not all parameters can be appied and some engines are special (e.g. Google News).
Google WEB¶
This is the implementation of the google WEB engine. Some of this implementations are shared by other engines:
The google WEB engine itself has a special setup option:
- name: google
...
use_mobile_ui: false
use_mobile_ui
: (default:false
)Enables to use mobile endpoint to bypass the google blocking (see #159). On the mobile UI of Google Search, the button More results is not affected by Google rate limiting and we can still do requests while actively blocked by the original Google search. By activate
use_mobile_ui
this behavior is simulated by adding the parameterasync=use_ac:true,_fmt:pc
to therequest()
.
- searx.engines.google.get_lang_info(params, lang_list, custom_aliases, supported_any_language)[source]¶
Composing various language properties for the google engines.
This function is called by the various google engines (Google WEB, Google Images, Google News and Google Videos).
- Parameters:
param (dict) – request parameters of the engine
lang_list (dict) – list of supported languages of the engine
ENGINES_LANGUAGES[engine-name]
lang_list – custom aliases for non standard language codes (used when calling
searx.utils.match_language()
)supported_any_language (bool) – When a language is not specified, the language interpretation is left up to Google to decide how the search results should be delivered. This argument is
True
for the google engine andFalse
for the other engines (google-images, -news, -scholar, -videos).
- Return type:
- Returns:
Py-Dictionary with the key/value pairs:
- language:
Return value from
searx.utils.match_language()
- country:
The country code (e.g. US, AT, CA, FR, DE ..)
- subdomain:
Google subdomain
google_domains
that fits to the country code.- params:
Py-Dictionary with additional request arguments (can be passed to
urllib.parse.urlencode()
).- headers:
Py-Dictionary with additional HTTP headers (can be passed to request’s headers)
Google Images¶
This is the implementation of the google images engine.
Content-Security-Policy (CSP)
This engine needs to allow images from the data URLs (prefixed with the
data:
scheme):
Header set Content-Security-Policy "img-src 'self' data: ;"
Google Videos¶
This is the implementation of the google videos engine.
Content-Security-Policy (CSP)
This engine needs to allow images from the data URLs (prefixed with the
data:
scheme):
Header set Content-Security-Policy "img-src 'self' data: ;"
Google News¶
This is the implementation of the google news engine. The google news API ignores some parameters from the common google API: