mirror of
https://github.com/searxng/searxng.git
synced 2024-11-19 02:40:11 +01:00
better API docs && more features in list
This commit is contained in:
parent
9f7cb4359c
commit
2ad8715b32
78
docs/admin/api.rst
Normal file
78
docs/admin/api.rst
Normal file
@ -0,0 +1,78 @@
|
||||
.. _adminapi:
|
||||
|
||||
Administration API
|
||||
------------------
|
||||
|
||||
Get configuration data
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code:: sh
|
||||
|
||||
GET /config
|
||||
|
||||
Sample response
|
||||
```````````````
|
||||
|
||||
.. code:: sh
|
||||
|
||||
{
|
||||
"autocomplete": "",
|
||||
"categories": [
|
||||
"map",
|
||||
"it",
|
||||
"images",
|
||||
],
|
||||
"default_locale": "",
|
||||
"default_theme": "oscar",
|
||||
"engines": [
|
||||
{
|
||||
"categories": [
|
||||
"map"
|
||||
],
|
||||
"enabled": true,
|
||||
"name": "openstreetmap",
|
||||
"shortcut": "osm"
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
"it"
|
||||
],
|
||||
"enabled": true,
|
||||
"name": "arch linux wiki",
|
||||
"shortcut": "al"
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
"images"
|
||||
],
|
||||
"enabled": true,
|
||||
"name": "google images",
|
||||
"shortcut": "goi"
|
||||
},
|
||||
{
|
||||
"categories": [
|
||||
"it"
|
||||
],
|
||||
"enabled": false,
|
||||
"name": "bitbucket",
|
||||
"shortcut": "bb"
|
||||
},
|
||||
],
|
||||
"instance_name": "searx",
|
||||
"locales": {
|
||||
"de": "Deutsch (German)",
|
||||
"en": "English",
|
||||
"eo": "Esperanto (Esperanto)",
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"enabled": true,
|
||||
"name": "HTTPS rewrite"
|
||||
},
|
||||
{
|
||||
"enabled": false,
|
||||
"name": "Vim-like hotkeys"
|
||||
}
|
||||
],
|
||||
"safe_search": 0
|
||||
}
|
@ -1,11 +1,11 @@
|
||||
Plugins
|
||||
-------
|
||||
|
||||
Plugins can extend/replace functionality of various components inside
|
||||
Plugins can extend or replace functionality of various components of
|
||||
searx.
|
||||
|
||||
example\_plugin.py
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
Example plugin
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
.. code:: python
|
||||
|
||||
@ -24,22 +24,22 @@ example\_plugin.py
|
||||
ctx['search'].suggestions.add('example')
|
||||
return True
|
||||
|
||||
Currently implemented plugin entry points (a.k.a hooks)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Plugin entry points
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Pre search hook (``pre_search``)
|
||||
- Post search hook (``post_search``)
|
||||
- Result hook (``on_result``) (is called if a new result is added (see
|
||||
https\_rewrite plugin))
|
||||
Entry points (hooks) define when a plugin runs. Right now only three hooks are implemented. So feel free to implement a hook if it fits the behaviour of your plugin.
|
||||
|
||||
Feel free to add more hooks to the code if it is required by a plugin.
|
||||
Pre search hook
|
||||
```````````````
|
||||
|
||||
TODO
|
||||
~~~~
|
||||
Runs BEFORE the search request. Function to implement: ``pre_search``
|
||||
|
||||
- Better documentation
|
||||
- More hooks
|
||||
- search hook (is called while searx is requesting results (for
|
||||
example: things like math-solver), the different hooks are running
|
||||
parallel)
|
||||
Post search hook
|
||||
````````````````
|
||||
|
||||
Runs AFTER the search request. Function to implement: ``post_search``
|
||||
|
||||
Result hook
|
||||
```````````
|
||||
|
||||
Runs when a new result is added to the result list. Function to implement: ``on_result``
|
||||
|
@ -1,13 +1,20 @@
|
||||
Search API
|
||||
==========
|
||||
|
||||
Search API endpoints: ``/``, ``/search``
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
The search supports both ``GET`` and ``POST``. However, using ``GET`` the parameters of the request remain hidden. So it is advised to use ``GET`` for querying.
|
||||
|
||||
Endpoints have equivalent functionality.
|
||||
Furthermore, two enpoints ``/`` and ``/search`` are available for querying.
|
||||
|
||||
.. code:: sh
|
||||
|
||||
GET /
|
||||
|
||||
.. code:: sh
|
||||
|
||||
GET /search
|
||||
|
||||
Parameters
|
||||
^^^^^^^^^^
|
||||
``````````
|
||||
|
||||
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
|
||||
| Name | Description | |
|
||||
@ -18,7 +25,7 @@ Parameters
|
||||
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
|
||||
| ``engines`` | Comma separated list, specifies the active search engines | optional |
|
||||
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
|
||||
| ``lang`` | Code of the language | optional (default: ``all``) |
|
||||
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
|
||||
| ``pageno`` | Search page number | optional (default: ``1``) |
|
||||
+------------------+----------------------------------------------------------------------------------------------------+-----------------------------+
|
||||
|
||||
Both ``GET`` and ``POST`` methods are supported.
|
||||
|
@ -1,7 +1,7 @@
|
||||
Privacy-respecting free metasearch engine
|
||||
=========================================
|
||||
Welcome to searx
|
||||
================
|
||||
|
||||
Searx is a free software internet metasearch engine which aggregates results from other search engines, while not storing information about its users. Searx does not track or profile its users, nor does it share its users' data with third parties. Additionally, searx can be used over Tor for online anonymity.
|
||||
Searx is a free software internet metasearch engine which aggregates results from more than 70 engines, while not storing information about its users. Searx does not track or profile its users, nor does it share its users' data with third parties. Additionally, searx can be used over Tor for online anonymity.
|
||||
|
||||
|
||||
Features
|
||||
@ -15,16 +15,26 @@ Features
|
||||
- Does not collect its users data
|
||||
- Offers secure, encrypted connections (HTTPS/SSL)
|
||||
- Hosted by organisations, such as La Quadrature du Net, which promote digital rights
|
||||
- About 70 supported search engines
|
||||
- Easy intergration with any search engine
|
||||
|
||||
|
||||
Further reading
|
||||
---------------
|
||||
User documentation
|
||||
------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
user/search_syntax
|
||||
|
||||
Administrator documentation
|
||||
---------------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
dev/install/installation
|
||||
admin/api
|
||||
|
||||
Developer documentation
|
||||
-----------------------
|
||||
@ -34,7 +44,6 @@ Developer documentation
|
||||
|
||||
dev/quickstart
|
||||
dev/contribution_guide
|
||||
dev/install/installation
|
||||
dev/engine_overview
|
||||
dev/search_api
|
||||
dev/plugins
|
||||
|
Loading…
Reference in New Issue
Block a user