Back to Private agent search

Private agent search / Guide 3 of 6

Enable the JSON API

Configure structured responses and a real server secret.

Configure and verify JSON output

Run openssl rand -hex 32, then paste its output into secret_key below. YAML does not execute shell commands.

SearXNG needs JSON output enabled for agent integration:

~/searxng/config/settings.yml

use_default_settings: true

search:
  formats:
    - html
    - json    # This is what agents need

server:
  secret_key: "PASTE_YOUR_GENERATED_SECRET_HERE"
  limiter: false  # Disable rate limiting for local use

Restart after config changes:

bash

docker compose restart searxng

Check the JSON response

curl -fsSG http://127.0.0.1:8080/search --data-urlencode "q=hello" --data "format=json" | jq '.results | length'

Reference: SearXNG search formats.

It’s working if

A request with format=json returns a JSON object with a results array. Zero results is different from an unsupported-format error.