← 返回
效率工具 中文

searxng-web-search

Search the web using a self-hosted SearXNG metasearch engine. Use when the user asks to search the web, find information online, look up recent news, researc...
使用自托管的SearXNG元搜索引擎搜索网络。当用户要求搜索网络、在线查找信息、查看最新新闻或进行研究时使用。
gangtao
效率工具 clawhub v1.0.0 1 版本 99866 Key: 无需
★ 0
Stars
📥 745
下载
💾 11
安装
1
版本
#latest

概述

SearXNG Web Search

Privacy-respecting web search skill powered by SearXNG, a free metasearch engine

that aggregates results from 243+ search services without tracking users.

Rewritten from PulseBot's built-in web search skill to use SearXNG as the backend,

packaged as a standalone agentskills.io skill.

Prerequisites

  1. A running SearXNG instance (self-hosted or accessible endpoint)
  2. JSON format must be enabled in your SearXNG settings.yml:
search:
  formats:
    - html
    - json
  1. Python requests library installed

Configuration

The skill uses environment variables for configuration:

VariableDefaultDescription
---------
SEARXNG_BASE_URLhttp://localhost:8080SearXNG instance URL
SEARXNG_MAX_RESULTS10Maximum results to return
SEARXNG_LANGUAGEallDefault search language (e.g. en, zh, all)
SEARXNG_SAFESEARCH0Safe search level: 0=off, 1=moderate, 2=strict
SEARXNG_TIMEOUT15Request timeout in seconds
SEARXNG_CATEGORIESgeneralDefault categories (comma-separated)

Usage

Run the search script:

python scripts/searxng_search.py "your search query"

With options:

python scripts/searxng_search.py "latest AI news" \
  --categories news \
  --language en \
  --time-range day \
  --max-results 5

Output Format

The script outputs JSON to stdout with the following structure:

{
  "query": "search query",
  "results": [
    {
      "title": "Result Title",
      "url": "https://example.com",
      "snippet": "Text snippet from the page...",
      "engines": ["google", "bing"],
      "score": 9.0,
      "category": "general",
      "published_date": "2025-01-01T00:00:00"
    }
  ],
  "suggestions": ["related query 1", "related query 2"],
  "answers": ["direct answer if available"],
  "total_results": 10,
  "error": null
}

If an error occurs, results will be empty and error will contain the message.

As a Python Module

You can also import and use the search function directly:

from scripts.searxng_search import SearXNGSearchTool

tool = SearXNGSearchTool(base_url="http://localhost:8080")
results = tool.search("quantum computing", categories="science,it", max_results=5)

for r in results["results"]:
    print(f"[{r['title']}]({r['url']})")
    print(f"  {r['snippet']}")

Integration with PulseBot

To register this skill in PulseBot, place it under skills/ and PulseBot

will discover it via SKILL.md frontmatter. The Python script can also be

called as a tool function by wrapping it:

from skills.searxng_web_search.scripts.searxng_search import SearXNGSearchTool

tool = SearXNGSearchTool()

def web_search(query: str, categories: str = "general", max_results: int = 10) -> str:
    """Search the web using SearXNG. Returns JSON results."""
    result = tool.search(query, categories=categories, max_results=max_results)
    return json.dumps(result, indent=2)

Edge Cases

  • If SearXNG is unreachable, the script returns a structured error with error field set
  • If no results are found, results is an empty list (not an error)
  • Some engines may be unresponsive; check unresponsive_engines in verbose mode
  • Rate-limited public instances may return 429; prefer self-hosted instances
  • Queries with special characters are URL-encoded automatically

SearXNG Setup (Quick Start)

For details on deploying SearXNG, see references/REFERENCE.md.

docker run -d --name searxng -p 8080:8080 \
  -v "$(pwd)/searxng:/etc/searxng" \
  searxng/searxng:latest

Then edit /etc/searxng/settings.yml to add json to search.formats.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 10:02 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 445 📥 226,150
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,756
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,296