Bing Engines¶
Bing WEB¶
This is the implementation of the Bing-Web engine. Some of this implementations are shared by other engines:
Note
Some functionality (paging and time-range results) are not supported since they depend on JavaScript.
- searx.engines.bing.base_url = 'https://www.bing.com/search'¶
Bing-Web search URL
- searx.engines.bing.get_locale_params(engine_region: str | None) dict[str, str] | None[source]¶
API documentation states the
mktparameter is the recommended primary signal for locale:If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response.
The
mktparameter takes a full<language>-<country>code.This function is shared with
searx.engines.bing_images,searx.engines.bing_news, andsearx.engines.bing_videos.
- searx.engines.bing.override_accept_language(params: OnlineParams, engine_region: str | None) None[source]¶
Override the
Accept-Languageheader.The default header built by
OnlineProcessorappendsen;q=0.3as a fallback language:Accept-Language: de,de-DE;q=0.7,en;q=0.3
Bing seems to better select the results locale based on the
Accept-Languagevalue header.This function is shared with
searx.engines.bing_images,searx.engines.bing_news, andsearx.engines.bing_videos.
- searx.engines.bing.request(query: str, params: OnlineParams) OnlineParams[source]¶
Assemble a Bing-Web request.
- searx.engines.bing.response(resp: SXNG_Response) list[dict[str, Any]][source]¶
Get response from Bing-Web
- searx.engines.bing.fetch_traits(engine_traits: EngineTraits) None[source]¶
Fetch regions from Bing-Web.
Bing Images¶
Bing-Images: description see searx.engines.bing.
- searx.engines.bing_images.base_url = 'https://www.bing.com/images/async'¶
Bing-Image search URL
Bing Videos¶
Bing-Videos: description see searx.engines.bing.
- searx.engines.bing_videos.base_url = 'https://www.bing.com/videos/asyncv2'¶
Bing-Video search URL
Bing News¶
Bing-News: description see searx.engines.bing.
Hint
Bing News is different in some ways!
- searx.engines.bing_news.paging = True¶
If go through the pages and there are actually no new results for another page, then bing returns the results from the last page again.
- searx.engines.bing_news.time_map = {'day': 'interval="4"', 'month': 'interval="9"', 'week': 'interval="7"'}¶
A string ‘4’ means last hour. We use last hour for
dayhere since the difference of last day and last week in the result list is just marginally. Bing does not have news rangeyear/ we usemonthinstead.
- searx.engines.bing_news.base_url = 'https://www.bing.com/news/infinitescrollajax'¶
Bing (News) search URL
- searx.engines.bing_news.fetch_traits(engine_traits: EngineTraits)[source]¶
Fetch languages and regions from Bing-News.