Bing Engines

Bing WEB

This is the implementation of the Bing-WEB engine. Some of this implementations are shared by other engines:

On the preference page Bing offers a lot of languages an regions (see section ‘Search results languages’ and ‘Country/region’). However, the abundant choice does not correspond to reality, where Bing has a full-text indexer only for a limited number of languages. By example: you can select a language like Māori but you never get a result in this language.

What comes a bit closer to the truth are the search-APIs but they don`t seem to be completely correct either (if you take a closer look you will find some inaccuracies there too):

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

Fetch languages and regions from Bing-Web.

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

Assemble a Bing-Web request.

searx.engines.bing.base_url = 'https://www.bing.com/search'

Bing (Web) search URL

searx.engines.bing.bing_traits_url = 'https://learn.microsoft.com/en-us/bing/search-apis/bing-web-search/reference/market-codes'

Bing (Web) search API description

searx.engines.bing.send_accept_language_header = True

Bing tries to guess user’s language and territory from the HTTP Accept-Language. Optional the user can select a search-language (can be different to the UI language) and a region (market code).

Bing Images

Bing-Images: description see searx.engines.bing.

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

Fetch languages and regions from Bing-News.

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

Assemble a Bing-Image request.

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

Get response from Bing-Images

searx.engines.bing_images.base_url = 'https://www.bing.com/images/async'

Bing (Images) search URL

searx.engines.bing_images.bing_traits_url = 'https://learn.microsoft.com/en-us/bing/search-apis/bing-image-search/reference/market-codes'

Bing (Images) search API description

Bing Videos

Bing-Videos: description see searx.engines.bing.

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

Fetch languages and regions from Bing-Videos.

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

searx.engines.bing_videos.base_url = 'https://www.bing.com/videos/asyncv2'

Bing (Videos) async search URL.

searx.engines.bing_videos.bing_traits_url = 'https://learn.microsoft.com/en-us/bing/search-apis/bing-video-search/reference/market-codes'

Bing (Video) search API description

Bing News

Bing-News: description see searx.engines.bing.

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

Fetch languages and regions from Bing-News.

The description of the first table says “query parameter when calling the Video Search API.” .. thats why I use the 4. table “News Category API markets” for the xpath_market_codes.

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

Assemble a Bing-News request.

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

Get response from Bing-Video

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

Bing (News) search URL

searx.engines.bing_news.bing_traits_url = 'https://learn.microsoft.com/en-us/bing/search-apis/bing-news-search/reference/market-codes'

Bing (News) search API description

searx.engines.bing_news.mkt_alias = {'zh': 'en-WW', 'zh-CN': 'en-WW'}

Bing News has an official market code ‘zh-CN’ but we won’t get a result with this market code. For ‘zh’ and ‘zh-CN’ we better use the Worldwide aggregate market code (en-WW).

searx.engines.bing_news.time_map = {'day': '4', 'month': '9', 'week': '8'}

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.