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.
<p>SearXNG is a <aclass="reference external"href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch-engine</a>, so it uses different search engines to provide
better results.</p>
<p>Because there is no general search API which could be used for every search
engine, an adapter has to be built between SearXNG and the external search
engines. Adapters are stored under the folder <aclass="extlink-origin reference external"href="https://github.com/searxng/searxng/blob/master/searx/engines">git://searx/engines</a>.</p>
<sectionid="general-engine-configuration">
<spanid="id1"></span><h2><aclass="toc-backref"href="#id10"role="doc-backlink">General Engine Configuration</a><aclass="headerlink"href="#general-engine-configuration"title="Link to this heading">¶</a></h2>
<p>It is required to tell SearXNG the type of results the engine provides. The
arguments can be set in the engine file or in the settings file (normally
<codeclass="docutils literal notranslate"><spanclass="pre">settings.yml</span></code>). The arguments in the settings file override the ones in the
engine file.</p>
<p>It does not matter if an option is stored in the engine file or in the settings.
However, the standard way is the following:</p>
<sectionid="engine-file">
<spanid="id2"></span><h3><aclass="toc-backref"href="#id11"role="doc-backlink">Engine File</a><aclass="headerlink"href="#engine-file"title="Link to this heading">¶</a></h3>
<caption><spanclass="caption-number">Table 2 </span><spanclass="caption-text">Common options in the engine module</span><aclass="headerlink"href="#id3"title="Link to this table">¶</a></caption>
<spanid="engine-settings"></span><h3><aclass="toc-backref"href="#id12"role="doc-backlink">Engine <codeclass="docutils literal notranslate"><spanclass="pre">settings.yml</span></code></a><aclass="headerlink"href="#engine-settings-yml"title="Link to this heading">¶</a></h3>
<p>For a more detailed description, see <aclass="reference internal"href="../../admin/settings/settings_engine.html#settings-engine"><spanclass="std std-ref">engine:</span></a> in the <aclass="reference internal"href="../../admin/settings/settings.html#settings-yml"><spanclass="std std-ref">settings.yml</span></a>.</p>
<caption><spanclass="caption-number">Table 3 </span><spanclass="caption-text">Common options in the engine setup (<codeclass="docutils literal notranslate"><spanclass="pre">settings.yml</span></code>)</span><aclass="headerlink"href="#id4"title="Link to this table">¶</a></caption>
<spanid="engine-overrides"></span><h3><aclass="toc-backref"href="#id13"role="doc-backlink">Overrides</a><aclass="headerlink"href="#overrides"title="Link to this heading">¶</a></h3>
<p>A few of the options have default values in the namespace of the engine’s python
module, but are often overwritten by the settings. If <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> is assigned to an
option in the engine file, it has to be redefined in the settings, otherwise
SearXNG will not start with that engine (global names with a leading underline can
be <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>).</p>
<p>Here is an very simple example of the global names in the namespace of engine’s
<caption><spanclass="caption-number">Table 4 </span><spanclass="caption-text">The naming of overrides is arbitrary / recommended overrides are:</span><aclass="headerlink"href="#id5"title="Link to this table">¶</a></caption>
<td><p>maximum number of results per request</p></td>
</tr>
<trclass="row-even"><td><p>language</p></td>
<td><p>string</p></td>
<td><p>ISO code of language and country like en_US</p></td>
</tr>
<trclass="row-odd"><td><p>api_key</p></td>
<td><p>string</p></td>
<td><p>api-key if required by engine</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<sectionid="making-a-request">
<spanid="engine-request"></span><h2><aclass="toc-backref"href="#id14"role="doc-backlink">Making a Request</a><aclass="headerlink"href="#making-a-request"title="Link to this heading">¶</a></h2>
<p>To perform a search an URL have to be specified. In addition to specifying an
URL, arguments can be passed to the query.</p>
<sectionid="passed-arguments-request">
<spanid="engine-request-arguments"></span><h3><aclass="toc-backref"href="#id15"role="doc-backlink">Passed Arguments (request)</a><aclass="headerlink"href="#passed-arguments-request"title="Link to this heading">¶</a></h3>
<p>These arguments can be used to construct the search query. Furthermore,
parameters with default value can be redefined for special purposes.</p>
<caption><spanclass="caption-number">Table 5 </span><spanclass="caption-text">If the <codeclass="docutils literal notranslate"><spanclass="pre">engine_type</span></code> is <aclass="reference internal"href="../../src/searx.search.processors.html#searx.search.processors.online.OnlineProcessor.get_params"title="searx.search.processors.online.OnlineProcessor.get_params"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">online</span></code></a></span><aclass="headerlink"href="#id6"title="Link to this table">¶</a></caption>
<caption><spanclass="caption-number">Table 6 </span><spanclass="caption-text">If the <codeclass="docutils literal notranslate"><spanclass="pre">engine_type</span></code> is <aclass="reference internal"href="../../src/searx.search.processors.html#searx.search.processors.online_dictionary.OnlineDictionaryProcessor.get_params"title="searx.search.processors.online_dictionary.OnlineDictionaryProcessor.get_params"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">online_dictionary</span></code></a>,
in addition to the <aclass="reference internal"href="#engine-request-online"><spanclass="std std-ref">online</span></a> arguments:</span><aclass="headerlink"href="#id7"title="Link to this table">¶</a></caption>
<caption><spanclass="caption-number">Table 7 </span><spanclass="caption-text">If the <codeclass="docutils literal notranslate"><spanclass="pre">engine_type</span></code> is <aclass="reference internal"href="../../src/searx.search.processors.html#searx.search.processors.online_currency.OnlineCurrencyProcessor.get_params"title="searx.search.processors.online_currency.OnlineCurrencyProcessor.get_params"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">online_currency</span></code></a>,
in addition to the <aclass="reference internal"href="#engine-request-online"><spanclass="std std-ref">online</span></a> arguments:</span><aclass="headerlink"href="#id8"title="Link to this table">¶</a></caption>
<caption><spanclass="caption-number">Table 8 </span><spanclass="caption-text">If the <codeclass="docutils literal notranslate"><spanclass="pre">engine_type</span></code> is <aclass="reference internal"href="../../src/searx.search.processors.html#searx.search.processors.online_url_search.OnlineUrlSearchProcessor.get_params"title="searx.search.processors.online_url_search.OnlineUrlSearchProcessor.get_params"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">online_url_search</span></code></a>,
in addition to the <aclass="reference internal"href="#engine-request-online"><spanclass="std std-ref">online</span></a> arguments:</span><aclass="headerlink"href="#id9"title="Link to this table">¶</a></caption>
<h3><aclass="toc-backref"href="#id16"role="doc-backlink">Specify Request</a><aclass="headerlink"href="#specify-request"title="Link to this heading">¶</a></h3>
<p>The function <aclass="reference internal"href="demo/demo_online.html#searx.engines.demo_online.request"title="searx.engines.demo_online.request"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">def</span><spanclass="pre">request(query,</span><spanclass="pre">params):</span></code></a> always returns the <codeclass="docutils literal notranslate"><spanclass="pre">params</span></code> variable, the
following parameters can be used to specify a search request:</p>
<td><p>True by default: raise an exception if the HTTP code of response is >= 300</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<sectionid="making-a-response">
<h2><aclass="toc-backref"href="#id17"role="doc-backlink">Making a Response</a><aclass="headerlink"href="#making-a-response"title="Link to this heading">¶</a></h2>
<p>In the <codeclass="docutils literal notranslate"><spanclass="pre">response</span></code> function of the engine, the HTTP response (<codeclass="docutils literal notranslate"><spanclass="pre">resp</span></code>) is
parsed and a list of results is returned.</p>
<p>A engine can append result-items of different media-types and different
result-types to the result list. The list of the result items is render to HTML