This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<spanid="bing-web"></span><spanid="bing-web-engine"></span><h2><aclass="toc-backref"href="#id2"role="doc-backlink">Bing WEB</a><aclass="headerlink"href="#module-searx.engines.bing"title="Link to this heading">¶</a></h2>
<p>This is the implementation of the Bing-WEB engine. Some of this
<p>On the <aclass="reference external"href="https://www.bing.com/account/general">preference page</a> Bing offers a lot of languages an regions (see section
LANGUAGE and COUNTRY/REGION). The Language is the language of the UI, we need
in SearXNG to get the translations of data such as <em>“published last week”</em>.</p>
<p>There is a description of the official <aclass="reference external"href="https://learn.microsoft.com/en-us/bing/search-apis/">search-APIs</a>, unfortunately this is not
the API we can use or that bing itself would use. You can look up some things
in the API to get a better picture of bing, but the value specifications like
the market codes are usually outdated or at least no longer used by bing itself.</p>
<p>The market codes have been harmonized and are identical for web, video and
images. The news area has also been harmonized with the other categories. Only
political adjustments still seem to be made – for example, there is no news
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing.</span></span><spanclass="sig-name descname"><spanclass="pre">max_page</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">200</span></em><aclass="headerlink"href="#searx.engines.bing.max_page"title="Link to this definition">¶</a></dt>
<dd><p>200 pages maximum (<codeclass="docutils literal notranslate"><spanclass="pre">&first=1991</span></code>)</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing.</span></span><spanclass="sig-name descname"><spanclass="pre">safesearch</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#searx.engines.bing.safesearch"title="Link to this definition">¶</a></dt>
<dd><p>Bing results are always SFW. To get NSFW links from bing some age
verification by a cookie is needed / thats not possible in SearXNG.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing.</span></span><spanclass="sig-name descname"><spanclass="pre">base_url</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'https://www.bing.com/search'</span></em><aclass="headerlink"href="#searx.engines.bing.base_url"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing.</span></span><spanclass="sig-name descname"><spanclass="pre">request</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">query</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">params</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing.html#request"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing.request"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing.</span></span><spanclass="sig-name descname"><spanclass="pre">fetch_traits</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">engine_traits</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../enginelib.html#searx.enginelib.traits.EngineTraits"title="searx.enginelib.traits.EngineTraits"><spanclass="pre">EngineTraits</span></a></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing.html#fetch_traits"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing.fetch_traits"title="Link to this definition">¶</a></dt>
<dd><p>Fetch languages and regions from Bing-Web.</p>
</dd></dl>
</section>
<sectionid="module-searx.engines.bing_images">
<spanid="bing-images"></span><spanid="bing-images-engine"></span><h2><aclass="toc-backref"href="#id3"role="doc-backlink">Bing Images</a><aclass="headerlink"href="#module-searx.engines.bing_images"title="Link to this heading">¶</a></h2>
<p>Bing-Images: description see <aclass="reference internal"href="#module-searx.engines.bing"title="searx.engines.bing"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">searx.engines.bing</span></code></a>.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_images.</span></span><spanclass="sig-name descname"><spanclass="pre">base_url</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'https://www.bing.com/images/async'</span></em><aclass="headerlink"href="#searx.engines.bing_images.base_url"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_images.</span></span><spanclass="sig-name descname"><spanclass="pre">request</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">query</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">params</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_images.html#request"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_images.request"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_images.</span></span><spanclass="sig-name descname"><spanclass="pre">response</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">resp</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_images.html#response"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_images.response"title="Link to this definition">¶</a></dt>
<dd><p>Get response from Bing-Images</p>
</dd></dl>
</section>
<sectionid="module-searx.engines.bing_videos">
<spanid="bing-videos"></span><spanid="bing-videos-engine"></span><h2><aclass="toc-backref"href="#id4"role="doc-backlink">Bing Videos</a><aclass="headerlink"href="#module-searx.engines.bing_videos"title="Link to this heading">¶</a></h2>
<p>Bing-Videos: description see <aclass="reference internal"href="#module-searx.engines.bing"title="searx.engines.bing"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">searx.engines.bing</span></code></a>.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_videos.</span></span><spanclass="sig-name descname"><spanclass="pre">base_url</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'https://www.bing.com/videos/asyncv2'</span></em><aclass="headerlink"href="#searx.engines.bing_videos.base_url"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_videos.</span></span><spanclass="sig-name descname"><spanclass="pre">request</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">query</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">params</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_videos.html#request"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_videos.request"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_videos.</span></span><spanclass="sig-name descname"><spanclass="pre">response</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">resp</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_videos.html#response"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_videos.response"title="Link to this definition">¶</a></dt>
<dd><p>Get response from Bing-Video</p>
</dd></dl>
</section>
<sectionid="module-searx.engines.bing_news">
<spanid="bing-news"></span><spanid="bing-news-engine"></span><h2><aclass="toc-backref"href="#id5"role="doc-backlink">Bing News</a><aclass="headerlink"href="#module-searx.engines.bing_news"title="Link to this heading">¶</a></h2>
<p>Bing-News: description see <aclass="reference internal"href="#module-searx.engines.bing"title="searx.engines.bing"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">searx.engines.bing</span></code></a>.</p>
<divclass="admonition hint">
<pclass="admonition-title">Hint</p>
<p>Bing News is <em>different</em> in some ways!</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_news.</span></span><spanclass="sig-name descname"><spanclass="pre">paging</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">True</span></em><aclass="headerlink"href="#searx.engines.bing_news.paging"title="Link to this definition">¶</a></dt>
<dd><p>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.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_news.</span></span><spanclass="sig-name descname"><spanclass="pre">time_map</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">{'day':</span><spanclass="pre">'interval="4"',</span><spanclass="pre">'month':</span><spanclass="pre">'interval="9"',</span><spanclass="pre">'week':</span><spanclass="pre">'interval="7"'}</span></em><aclass="headerlink"href="#searx.engines.bing_news.time_map"title="Link to this definition">¶</a></dt>
<dd><p>A string ‘4’ means <em>last hour</em>. We use <em>last hour</em> for <codeclass="docutils literal notranslate"><spanclass="pre">day</span></code> here since the
difference of <em>last day</em> and <em>last week</em> in the result list is just marginally.
Bing does not have news range <codeclass="docutils literal notranslate"><spanclass="pre">year</span></code> / we use <codeclass="docutils literal notranslate"><spanclass="pre">month</span></code> instead.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_news.</span></span><spanclass="sig-name descname"><spanclass="pre">base_url</span></span><emclass="property"><spanclass="w"></span><spanclass="p"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="pre">'https://www.bing.com/news/infinitescrollajax'</span></em><aclass="headerlink"href="#searx.engines.bing_news.base_url"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_news.</span></span><spanclass="sig-name descname"><spanclass="pre">request</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">query</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">params</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_news.html#request"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_news.request"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_news.</span></span><spanclass="sig-name descname"><spanclass="pre">response</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">resp</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_news.html#response"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_news.response"title="Link to this definition">¶</a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">searx.engines.bing_news.</span></span><spanclass="sig-name descname"><spanclass="pre">fetch_traits</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">engine_traits</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><aclass="reference internal"href="../enginelib.html#searx.enginelib.traits.EngineTraits"title="searx.enginelib.traits.EngineTraits"><spanclass="pre">EngineTraits</span></a></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../../../_modules/searx/engines/bing_news.html#fetch_traits"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#searx.engines.bing_news.fetch_traits"title="Link to this definition">¶</a></dt>
<dd><p>Fetch languages and regions from Bing-News.</p>