Usage

Ask the agent, or query the API directly.

OpenClaw uses natural language; SearXNG exposes a conventional JSON endpoint. Both hit the same local service, so you can debug the backend without involving the model.

  • AgentOpenClaw
  • ChatTelegram if connected
  • API127.0.0.1:8080
01

Web UI

Open http://127.0.0.1:8080 on the host. Useful for checking engines and seeing the raw result page.

02

OpenClaw

Ask the agent to search. The plugin/provider decides when to call SearXNG and how many results to pass to the model.

03

HTTP JSON

Call /search?q=...&format=json from curl, a script, or another tool. No API key.

Through OpenClaw

Natural language, not a command grammar.

These are example requests, not a special syntax. OpenClaw decides whether to call the search tool and may rewrite the query. If the agent ignores the tool, check openclaw doctor and the tool policy for your setup.

Basic

Search for Rust async programming using SearXNG

Recency

Search for EU AI Act news with time_range: month

Categories

Search for Python packaging with categories: it,science

Volume

Search for database indexing articles with 100 results

Telegram is a channel, not a separate integration.

If your OpenClaw gateway is already connected to Telegram, send the same natural-language request to the bot. This repository does not configure Telegram, bot tokens, or channel access.

Direct API

Reproduce exactly what the agent sees.

ParameterExampleNotes
qrust asyncRequired query string
formatjsonMust be enabled in search.formats
pageno2Further result pages; engine support varies
categoriesit,scienceComma-separated SearXNG categories
languageenResult language where supported
time_rangemonthRecency filter where the engine supports it
enginesgoogleRestrict to specific enabled engines
safesearch00 off, 1 moderate, 2 strict (engine-dependent)
# Basic JSON search
curl -s "http://127.0.0.1:8080/search?q=python&format=json" | jq '.results[] | {title, url}'

# Second page
curl -s "http://127.0.0.1:8080/search?q=python&format=json&pageno=2" | jq '.results | length'

# IT and science categories
curl -s "http://127.0.0.1:8080/search?q=rust&categories=it,science&format=json" | jq '.results | length'

# Recent results
curl -s "http://127.0.0.1:8080/search?q=climate&time_range=month&format=json" | jq '.results | length'

# One engine only
curl -s "http://127.0.0.1:8080/search?q=linux&engines=wikipedia&format=json" | jq '.results[] | .title'

# Which engines failed
curl -s "http://127.0.0.1:8080/search?q=test&format=json" | jq '.unresponsive_engines'

Response shape

What comes back.

SearXNG returns a JSON object with metadata, a result array, and the list of engines that did not answer. This is a trimmed illustrative shape, not a captured response:

{
  "query": "rust async",
  "number_of_results": 0,
  "results": [
    {
      "url": "https://example.com/article",
      "title": "Result title",
      "content": "Snippet returned by the engine.",
      "engine": "google",
      "category": "general"
    }
  ],
  "answers": [],
  "unresponsive_engines": []
}

number_of_results is not a reliable total; some engines do not report one. Count the results array for what you actually received.

Field guide

Fields worth using

results[].urlResult target
results[].titleDisplay title
results[].contentSnippet text
results[].engineOriginating engine
results[].categorySearXNG category
unresponsive_enginesEngines that failed or timed out
answersInstant answers, when available

Multi-page results

Pagination is real, but engine-dependent.

SearXNG accepts pageno=2, pageno=3, and so on. Not every upstream engine returns a full second page for every query, so expect the count to fall as page numbers rise.

for page in 1 2 3; do
  printf "page %s: " "$page"
  curl -s "http://127.0.0.1:8080/search?q=python&format=json&pageno=$page" \
    | jq '.results | length'
done

SearXNG pages are independent requests. Deduplicate results client-side if you combine pages.

Plugin limits

Know which layer caps you.

  • The searxng-search template requests defaultCount: 100 and sets enableMultiPage: true. Your installed plugin must support those keys.
  • OpenClaw's built-in provider caps a single call's count at 10 results and has no multi-page option.
  • SearXNG itself returns whatever each engine gives it for a page. There is no guarantee of 100 or 300 results.

Health checks

When a search looks wrong, isolate the layer.

# Is the service up?
sudo systemctl is-active searxng
redis-cli ping

# Does the API answer without the agent?
curl -s "http://127.0.0.1:8080/search?q=test&format=json" | jq '{results: (.results | length), unresponsive: .unresponsive_engines}'

# Does the agent see the plugin?
openclaw doctor 2>&1 | grep -i searxng

# Full suite
bash scripts/test-setup.sh