mirror of
https://github.com/searxng/searxng.git
synced 2026-08-16 20:21:35 +00:00
Compare commits
3 Commits
c5d8d05f03
...
67973783de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67973783de | ||
|
|
0f9e30e3f9 | ||
|
|
640f88c9bd |
@@ -4,31 +4,32 @@
|
|||||||
Search API
|
Search API
|
||||||
==========
|
==========
|
||||||
|
|
||||||
SearXNG supports querying via a simple HTTP API.
|
SearXNG supports querying via a simple HTTP API. Two endpoints, ``/`` and
|
||||||
Two endpoints, ``/`` and ``/search``, are supported for both GET and POST methods.
|
``/search``, are supported for both GET and POST methods. The ``GET`` method
|
||||||
The GET method expects parameters as URL query parameters, while the POST method expects parameters as form data.
|
expects parameters as URL query parameters, while the POST method expects
|
||||||
|
parameters as form data (``application/x-www-form-urlencoded``).
|
||||||
|
|
||||||
If you want to consume the results as JSON, CSV, or RSS, you need to set the
|
If you want to consume the results as JSON, CSV, or RSS, you need to set the
|
||||||
``format`` parameter accordingly. Supported formats are defined in ``settings.yml``, under the ``search`` section.
|
``format`` parameter accordingly. Supported formats are defined in
|
||||||
Requesting an unset format will return a 403 Forbidden error. Be aware that many public instances have these formats disabled.
|
``settings.yml``, under the :ref:`settings search` section. Requesting an
|
||||||
|
unset format will return a 403 Forbidden error. Be aware that many public
|
||||||
|
instances have these formats disabled.
|
||||||
|
|
||||||
Endpoints:
|
Endpoints:
|
||||||
|
|
||||||
``GET /``
|
.. code::
|
||||||
``GET /search``
|
|
||||||
|
|
||||||
``POST /``
|
GET /
|
||||||
``POST /search``
|
GET /search
|
||||||
|
POST /
|
||||||
|
POST /search
|
||||||
|
|
||||||
example cURL calls:
|
example cURL calls:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code:: bash
|
||||||
|
|
||||||
curl 'https://searx.example.org/search?q=searxng&format=json'
|
curl 'https://searx.example.org/search?q=searxng&format=json'
|
||||||
|
|
||||||
curl -X POST 'https://searx.example.org/search' -d 'q=searxng&format=csv'
|
curl -X POST 'https://searx.example.org/search' -d 'q=searxng&format=csv'
|
||||||
|
|
||||||
curl -L -X POST -d 'q=searxng&format=json' 'https://searx.example.org/'
|
curl -L -X POST -d 'q=searxng&format=json' 'https://searx.example.org/'
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
@@ -53,90 +54,27 @@ Parameters
|
|||||||
Comma separated list, specifies the active search categories (see
|
Comma separated list, specifies the active search categories (see
|
||||||
:ref:`configured engines`)
|
:ref:`configured engines`)
|
||||||
|
|
||||||
``engines`` : optional
|
|
||||||
Comma separated list, specifies the active search engines (see
|
|
||||||
:ref:`configured engines`).
|
|
||||||
|
|
||||||
``language`` : default from :ref:`settings search`
|
``language`` : default from :ref:`settings search`
|
||||||
Code of the language.
|
Code of the language.
|
||||||
|
|
||||||
``pageno`` : default ``1``
|
``pageno`` : default ``1``
|
||||||
Search page number.
|
Search page number.
|
||||||
|
|
||||||
``time_range`` : optional
|
``time_range`` : optional : [ ``day``, ``month``, ``year`` ]
|
||||||
[ ``day``, ``month``, ``year`` ]
|
|
||||||
|
|
||||||
Time range of search for engines which support it. See if an engine supports
|
Time range of search for engines which support it. See if an engine supports
|
||||||
time range search in the preferences page of an instance.
|
time range search in the preferences page of an instance.
|
||||||
|
|
||||||
``format`` : optional
|
``format`` : optional : [ ``json``, ``csv``, ``rss`` ]
|
||||||
[ ``json``, ``csv``, ``rss`` ]
|
|
||||||
|
|
||||||
Output format of results. Format needs to be activated in :ref:`settings
|
Output format of results. Format needs to be activated in :ref:`settings
|
||||||
search`.
|
search`.
|
||||||
|
|
||||||
``results_on_new_tab`` : default ``0``
|
``safesearch`` : default from :ref:`settings search` : [ ``0``, ``1``, ``2`` ]
|
||||||
[ ``0``, ``1`` ]
|
|
||||||
|
|
||||||
Open search results on new tab.
|
|
||||||
|
|
||||||
``image_proxy`` : default from :ref:`settings server`
|
|
||||||
[ ``True``, ``False`` ]
|
|
||||||
|
|
||||||
Proxy image results through SearXNG.
|
|
||||||
|
|
||||||
``autocomplete`` : default from :ref:`settings search`
|
|
||||||
[ ``google``, ``dbpedia``, ``duckduckgo``, ``mwmbl``, ``startpage``,
|
|
||||||
``privacywall``, ``wikipedia``, ``swisscows``, ``qwant`` ]
|
|
||||||
|
|
||||||
Service which completes words as you type.
|
|
||||||
|
|
||||||
``safesearch`` : default from :ref:`settings search`
|
|
||||||
[ ``0``, ``1``, ``2`` ]
|
|
||||||
|
|
||||||
Filter search results of engines which support safe search. See if an engine
|
Filter search results of engines which support safe search. See if an engine
|
||||||
supports safe search in the preferences page of an instance.
|
supports safe search in the preferences page of an instance.
|
||||||
|
|
||||||
``theme`` : default ``simple``
|
``theme`` : default ``simple`` : [ ``simple`` ]
|
||||||
[ ``simple`` ]
|
|
||||||
|
|
||||||
Theme of instance.
|
Theme of instance.
|
||||||
|
|
||||||
Please note, available themes depend on an instance. It is possible that an
|
Please note, available themes depend on an instance. It is possible that an
|
||||||
instance administrator deleted, created or renamed themes on their instance.
|
instance administrator deleted, created or renamed themes on their instance.
|
||||||
See the available options in the preferences page of the instance.
|
See the available options in the preferences page of the instance.
|
||||||
|
|
||||||
``enabled_plugins`` : optional
|
|
||||||
List of enabled plugins.
|
|
||||||
|
|
||||||
:default:
|
|
||||||
``Hash_plugin``, ``Self_Information``,
|
|
||||||
``Tracker_URL_remover``, ``Ahmia_blacklist``
|
|
||||||
|
|
||||||
:values:
|
|
||||||
.. enabled by default
|
|
||||||
|
|
||||||
``Hash_plugin``, ``Self_Information``,
|
|
||||||
``Tracker_URL_remover``, ``Ahmia_blacklist``,
|
|
||||||
|
|
||||||
.. disabled by default
|
|
||||||
|
|
||||||
``Hostnames_plugin``, ``Open_Access_DOI_rewrite``,
|
|
||||||
``Vim-like_hotkeys``, ``Tor_check_plugin``
|
|
||||||
|
|
||||||
``disabled_plugins``: optional
|
|
||||||
List of disabled plugins.
|
|
||||||
|
|
||||||
:default:
|
|
||||||
``Hostnames_plugin``, ``Open_Access_DOI_rewrite``,
|
|
||||||
``Vim-like_hotkeys``, ``Tor_check_plugin``
|
|
||||||
|
|
||||||
:values:
|
|
||||||
see values from ``enabled_plugins``
|
|
||||||
|
|
||||||
``enabled_engines`` : optional : *all* :origin:`engines <searx/engines>`
|
|
||||||
List of enabled engines.
|
|
||||||
|
|
||||||
``disabled_engines`` : optional : *all* :origin:`engines <searx/engines>`
|
|
||||||
List of disabled engines.
|
|
||||||
|
|
||||||
|
|||||||
@@ -776,8 +776,11 @@ docs.live() {
|
|||||||
pyenv.install
|
pyenv.install
|
||||||
docs.prebuild
|
docs.prebuild
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
PATH="${PY_ENV_BIN}:${PATH}" pyenv.cmd sphinx-autobuild \
|
SPHINX_AUTOBUILD_DEBUG=1 PATH="${PY_ENV_BIN}:${PATH}" pyenv.cmd sphinx-autobuild \
|
||||||
${SPHINX_VERBOSE} ${SPHINXOPTS} --open-browser --host 0.0.0.0 \
|
${SPHINX_VERBOSE} ${SPHINXOPTS} \
|
||||||
|
--watch ./searx \
|
||||||
|
--re-ignore '(^|/)\.#|^(?!.*\.(rst|py|yml)$).*' \
|
||||||
|
--open-browser --host 0.0.0.0 \
|
||||||
-b html -c ./docs -d "${DOCS_BUILD}/.doctrees" ./docs "${DOCS_DIST}"
|
-b html -c ./docs -d "${DOCS_BUILD}/.doctrees" ./docs "${DOCS_DIST}"
|
||||||
dump_return $?
|
dump_return $?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user