summaryrefslogtreecommitdiff
path: root/docs/dev/search_api.rst
diff options
context:
space:
mode:
authorTommaso Colella <tommasocolella95@gmail.com>2025-12-29 15:04:33 +0100
committerGitHub <noreply@github.com>2025-12-29 15:04:33 +0100
commitabae17e6fc49e2b77fb1c090db984e4867cea723 (patch)
treea6418248ed4b94b0d9565d21bf98862ce4c17c08 /docs/dev/search_api.rst
parent3baf5c38fce92ad9dcb357ce1bd8074a3bf62c1b (diff)
[mod] docs: better explanation for search api usage and format support (#5574)
Diffstat (limited to 'docs/dev/search_api.rst')
-rw-r--r--docs/dev/search_api.rst24
1 files changed, 21 insertions, 3 deletions
diff --git a/docs/dev/search_api.rst b/docs/dev/search_api.rst
index aa5f847ea..016bd2e29 100644
--- a/docs/dev/search_api.rst
+++ b/docs/dev/search_api.rst
@@ -4,15 +4,33 @@
Search API
==========
-The search supports both ``GET`` and ``POST``.
+SearXNG supports querying via a simple HTTP API.
+Two endpoints, ``/`` and ``/search``, are supported for both GET and POST methods.
+The GET method expects parameters as URL query parameters, while the POST method expects parameters as form data.
-Furthermore, two endpoints ``/`` and ``/search`` are available for querying.
+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.
+Requesting an unset format will return a 403 Forbidden error. Be aware that many public instances have these formats disabled.
-``GET /``
+Endpoints:
+``GET /``
``GET /search``
+``POST /``
+``POST /search``
+
+example cURL calls:
+
+.. code-block:: bash
+
+ curl 'https://searx.example.org/search?q=searxng&format=json'
+
+ 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/'
+
Parameters
==========