api.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Administration API &#8212; Searx Documentation (Searx-1.1.0.tex)</title>
  8. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  9. <link rel="stylesheet" type="text/css" href="../_static/searx.css" />
  10. <link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
  11. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  12. <script src="../_static/jquery.js"></script>
  13. <script src="../_static/underscore.js"></script>
  14. <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
  15. <script src="../_static/doctools.js"></script>
  16. <script src="../_static/sphinx_highlight.js"></script>
  17. <link rel="index" title="Index" href="../genindex.html" />
  18. <link rel="search" title="Search" href="../search.html" />
  19. <link rel="next" title="Architecture" href="architecture.html" />
  20. <link rel="prev" title="settings.yml" href="settings.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="../genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="../py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="architecture.html" title="Architecture"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="settings.html" title="settings.yml"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.1.0.tex)</a> &#187;</li>
  38. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
  39. <li class="nav-item nav-item-this"><a href="">Administration API</a></li>
  40. </ul>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body" role="main">
  46. <section id="administration-api">
  47. <span id="adminapi"></span><h1>Administration API<a class="headerlink" href="#administration-api" title="Permalink to this heading">¶</a></h1>
  48. <section id="get-configuration-data">
  49. <h2>Get configuration data<a class="headerlink" href="#get-configuration-data" title="Permalink to this heading">¶</a></h2>
  50. <div class="highlight-http notranslate"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/config</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
  51. </pre></div>
  52. </div>
  53. <section id="sample-response">
  54. <h3>Sample response<a class="headerlink" href="#sample-response" title="Permalink to this heading">¶</a></h3>
  55. <div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"></span>
  56. <span class="w"> </span><span class="nt">&quot;autocomplete&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&quot;</span><span class="p">,</span><span class="w"></span>
  57. <span class="w"> </span><span class="nt">&quot;categories&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  58. <span class="w"> </span><span class="s2">&quot;map&quot;</span><span class="p">,</span><span class="w"></span>
  59. <span class="w"> </span><span class="s2">&quot;it&quot;</span><span class="p">,</span><span class="w"></span>
  60. <span class="w"> </span><span class="s2">&quot;images&quot;</span><span class="p">,</span><span class="w"></span>
  61. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  62. <span class="w"> </span><span class="nt">&quot;default_locale&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&quot;</span><span class="p">,</span><span class="w"></span>
  63. <span class="w"> </span><span class="nt">&quot;default_theme&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;oscar&quot;</span><span class="p">,</span><span class="w"></span>
  64. <span class="w"> </span><span class="nt">&quot;engines&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  65. <span class="w"> </span><span class="p">{</span><span class="w"></span>
  66. <span class="w"> </span><span class="nt">&quot;categories&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  67. <span class="w"> </span><span class="s2">&quot;map&quot;</span><span class="w"></span>
  68. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  69. <span class="w"> </span><span class="nt">&quot;enabled&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
  70. <span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;openstreetmap&quot;</span><span class="p">,</span><span class="w"></span>
  71. <span class="w"> </span><span class="nt">&quot;shortcut&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;osm&quot;</span><span class="w"></span>
  72. <span class="w"> </span><span class="p">},</span><span class="w"></span>
  73. <span class="w"> </span><span class="p">{</span><span class="w"></span>
  74. <span class="w"> </span><span class="nt">&quot;categories&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  75. <span class="w"> </span><span class="s2">&quot;it&quot;</span><span class="w"></span>
  76. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  77. <span class="w"> </span><span class="nt">&quot;enabled&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
  78. <span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;arch linux wiki&quot;</span><span class="p">,</span><span class="w"></span>
  79. <span class="w"> </span><span class="nt">&quot;shortcut&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;al&quot;</span><span class="w"></span>
  80. <span class="w"> </span><span class="p">},</span><span class="w"></span>
  81. <span class="w"> </span><span class="p">{</span><span class="w"></span>
  82. <span class="w"> </span><span class="nt">&quot;categories&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  83. <span class="w"> </span><span class="s2">&quot;images&quot;</span><span class="w"></span>
  84. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  85. <span class="w"> </span><span class="nt">&quot;enabled&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
  86. <span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;google images&quot;</span><span class="p">,</span><span class="w"></span>
  87. <span class="w"> </span><span class="nt">&quot;shortcut&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;goi&quot;</span><span class="w"></span>
  88. <span class="w"> </span><span class="p">},</span><span class="w"></span>
  89. <span class="w"> </span><span class="p">{</span><span class="w"></span>
  90. <span class="w"> </span><span class="nt">&quot;categories&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  91. <span class="w"> </span><span class="s2">&quot;it&quot;</span><span class="w"></span>
  92. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  93. <span class="w"> </span><span class="nt">&quot;enabled&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
  94. <span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;bitbucket&quot;</span><span class="p">,</span><span class="w"></span>
  95. <span class="w"> </span><span class="nt">&quot;shortcut&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;bb&quot;</span><span class="w"></span>
  96. <span class="w"> </span><span class="p">},</span><span class="w"></span>
  97. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  98. <span class="w"> </span><span class="nt">&quot;instance_name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;searx&quot;</span><span class="p">,</span><span class="w"></span>
  99. <span class="w"> </span><span class="nt">&quot;locales&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
  100. <span class="w"> </span><span class="nt">&quot;de&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Deutsch (German)&quot;</span><span class="p">,</span><span class="w"></span>
  101. <span class="w"> </span><span class="nt">&quot;en&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;English&quot;</span><span class="p">,</span><span class="w"></span>
  102. <span class="w"> </span><span class="nt">&quot;eo&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Esperanto (Esperanto)&quot;</span><span class="p">,</span><span class="w"></span>
  103. <span class="w"> </span><span class="p">},</span><span class="w"></span>
  104. <span class="w"> </span><span class="nt">&quot;plugins&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"></span>
  105. <span class="w"> </span><span class="p">{</span><span class="w"></span>
  106. <span class="w"> </span><span class="nt">&quot;enabled&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
  107. <span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;HTTPS rewrite&quot;</span><span class="w"></span>
  108. <span class="w"> </span><span class="p">},</span><span class="w"></span>
  109. <span class="w"> </span><span class="p">{</span><span class="w"></span>
  110. <span class="w"> </span><span class="nt">&quot;enabled&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
  111. <span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Vim-like hotkeys&quot;</span><span class="w"></span>
  112. <span class="w"> </span><span class="p">}</span><span class="w"></span>
  113. <span class="w"> </span><span class="p">],</span><span class="w"></span>
  114. <span class="w"> </span><span class="nt">&quot;safe_search&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
  115. <span class="p">}</span><span class="w"></span>
  116. </pre></div>
  117. </div>
  118. </section>
  119. </section>
  120. <section id="embed-search-bar">
  121. <h2>Embed search bar<a class="headerlink" href="#embed-search-bar" title="Permalink to this heading">¶</a></h2>
  122. <p>The search bar can be embedded into websites. Just paste the example into the
  123. HTML of the site. URL of the searx instance and values are customizable.</p>
  124. <div class="highlight-html notranslate"><div class="highlight"><pre><span></span><span class="p">&lt;</span><span class="nt">form</span> <span class="na">method</span><span class="o">=</span><span class="s">&quot;post&quot;</span> <span class="na">action</span><span class="o">=</span><span class="s">&quot;https://searx.me/&quot;</span><span class="p">&gt;</span>
  125. <span class="cm">&lt;!-- search --&gt;</span> <span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text&quot;</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;q&quot;</span> <span class="p">/&gt;</span>
  126. <span class="cm">&lt;!-- categories --&gt;</span> <span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;hidden&quot;</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;categories&quot;</span> <span class="na">value</span><span class="o">=</span><span class="s">&quot;general,social media&quot;</span> <span class="p">/&gt;</span>
  127. <span class="cm">&lt;!-- language --&gt;</span> <span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;hidden&quot;</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;lang&quot;</span> <span class="na">value</span><span class="o">=</span><span class="s">&quot;all&quot;</span> <span class="p">/&gt;</span>
  128. <span class="cm">&lt;!-- locale --&gt;</span> <span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;hidden&quot;</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;locale&quot;</span> <span class="na">value</span><span class="o">=</span><span class="s">&quot;en&quot;</span> <span class="p">/&gt;</span>
  129. <span class="cm">&lt;!-- date filter --&gt;</span> <span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;hidden&quot;</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;time_range&quot;</span> <span class="na">value</span><span class="o">=</span><span class="s">&quot;month&quot;</span> <span class="p">/&gt;</span>
  130. <span class="p">&lt;/</span><span class="nt">form</span><span class="p">&gt;</span>
  131. </pre></div>
  132. </div>
  133. </section>
  134. </section>
  135. <div class="clearer"></div>
  136. </div>
  137. </div>
  138. </div>
  139. <span id="sidebar-top"></span>
  140. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  141. <div class="sphinxsidebarwrapper">
  142. <p class="logo"><a href="../index.html">
  143. <img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
  144. </a></p>
  145. <h3>Project Links</h3>
  146. <ul>
  147. <li><a href="https://searx.github.io/searx/blog/index.html">Blog</a>
  148. <li><a href="https://github.com/searx/searx">Source</a>
  149. <li><a href="https://github.com/searx/searx/wiki">Wiki</a>
  150. <li><a href="https://twitter.com/Searx_engine">Twitter</a>
  151. <li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
  152. </ul><h3>Navigation</h3>
  153. <ul>
  154. <li><a href="../index.html">Overview</a>
  155. <ul>
  156. <li><a href="index.html">Administrator documentation</a>
  157. <ul>
  158. <li>Previous: <a href="settings.html" title="previous chapter"><code class="docutils literal notranslate"><span class="pre">settings.yml</span></code></a>
  159. <li>Next: <a href="architecture.html" title="next chapter">Architecture</a></ul>
  160. </li>
  161. </ul>
  162. </li>
  163. </ul>
  164. <div id="searchbox" style="display: none" role="search">
  165. <h3 id="searchlabel">Quick search</h3>
  166. <div class="searchformwrapper">
  167. <form class="search" action="../search.html" method="get">
  168. <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
  169. <input type="submit" value="Go" />
  170. </form>
  171. </div>
  172. </div>
  173. <script>document.getElementById('searchbox').style.display = "block"</script>
  174. </div>
  175. </div>
  176. <div class="clearer"></div>
  177. </div>
  178. <div class="footer" role="contentinfo">
  179. &#169; Copyright 2015-2022, Adam Tauber, Noémi Ványi.
  180. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
  181. </div>
  182. <script src="../_static/version_warning_offset.js"></script>
  183. </body>
  184. </html>