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 mkt parameter 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 mkt parameter takes a full <language>-<country> code.

This function is shared with searx.engines.bing_images, searx.engines.bing_news, and searx.engines.bing_videos.

searx.engines.bing.override_accept_language(params: OnlineParams, engine_region: str | None) None[source]

Override the Accept-Language header.

The default header built by OnlineProcessor appends en;q=0.3 as 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-Language value header.

This function is shared with searx.engines.bing_images, searx.engines.bing_news, and searx.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

searx.engines.bing_images.request(query, params)[source]

Assemble a Bing-Image request.

searx.engines.bing_images.response(resp)[source]

Get response from Bing-Image

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

searx.engines.bing_videos.request(query, params)[source]

Assemble a Bing-Video request.

searx.engines.bing_videos.response(resp)[source]

Get response from Bing-Video

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 day here since the difference of last day and last week in the result list is just marginally. Bing does not have news range year / we use month instead.

searx.engines.bing_news.base_url = 'https://www.bing.com/news/infinitescrollajax'

Bing (News) search URL

searx.engines.bing_news.request(query, params)[source]

Assemble a Bing-News request.

searx.engines.bing_news.response(resp)[source]

Parse the Bing-News response.

searx.engines.bing_news.fetch_traits(engine_traits: EngineTraits)[source]

Fetch languages and regions from Bing-News.