跳到正文
Skillpedia
网页抓取260k · #561

searxng-search

它能做什么

这项技能让你的 AI 通过 SearXNG 搜索网络。SearXNG 是一个汇集多个引擎结果的搜索工具。适合希望免费、注重隐私地搜索、且不想使用付费密钥的人。

适用场景

  • ✓你想让 AI 搜索网络,并且已经设置了 SearXNG 地址的时候。
  • ✓主要的网络搜索未设置,而你想要一个免费替代方案的时候。
  • ✓你想用一条查询同时搜索多个引擎的时候。

技能链接

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/searxng-search/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/searxng-search/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请搜索关于热泵安装费用的最新文章,并列出最好的五篇。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能用 curl 把搜索请求发送到你的 SearXNG 地址,并以 JSON 格式读取结果。如果地址缺失或没有响应,AI 会改用其他搜索工具。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

SearXNG Search

Free meta-search using SearXNG — a privacy-respecting, self-hosted search aggregator that queries 70+ search engines simultaneously.

No API key required when using a public instance. Can also be self-hosted for full control. Automatically appears as a fallback when the main web search toolset (FIRECRAWL_API_KEY) is not configured.

Configuration

SearXNG requires a SEARXNG_URL environment variable pointing to your SearXNG instance:

# Public instances (no setup required)
SEARXNG_URL=https://searxng.example.com

# Self-hosted SearXNG
SEARXNG_URL=http://localhost:8888

If no instance is configured, this skill is unavailable and the agent falls back to other search options.

Detection Flow

Check what is actually available before choosing an approach:

# Check if SEARXNG_URL is set and the instance is reachable
curl -s --max-time 5 "${SEARXNG_URL}/search?q=test&format=json" | head -c 200

Decision tree:

  1. If SEARXNG_URL is set and the instance responds, use SearXNG
  2. If SEARXNG_URL is unset or unreachable, fall back to other available search tools
  3. If the user wants SearXNG specifically, help them set up an instance or find a public one

Method 1: CLI via curl (Preferred)

Use curl via terminal to call the SearXNG JSON API. This avoids assuming any particular Python package is installed.

# Text search (JSON output)
curl -s --max-time 10 \
  "${SEARXNG_URL}/search?q=python+async+programming&format=json&engines=google,bing&limit=10"

# With Safesearch off
curl -s --max-time 10 \
  "${SEARXNG_URL}/search?q=example&format=json&safesearch=0"

# Specific categories (general, news, science, etc.)
curl -s --max-time 10 \
  "${SEARXNG_URL}/search?q=AI+news&format=json&categories=news"

Common CLI Flags

Flag Description Example
q Query string (URL-encoded) q=python+async
format Output format: json, csv, rss format=json
engines Comma-separated engine names engines=google,bing,ddg
limit Max results per engine (default 10) limit=5
categories Filter by category categories=news,science
safesearch 0=none, 1=moderate, 2=strict safesearch=0
time_range Filter: day, week, month, year time_range=week

Parsing JSON Results

# Extract titles and URLs from JSON
curl -s --max-time 10 "${SEARXNG_URL}/search?q=fastapi&format=json&limit=5" \
  | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', []):
    print(r.get('title',''))
    print(r.get('url',''))
    print(r.get('content','')[:200])
    print()
"

Returns per result: title, url, content (snippet), engine, parsed_url, img_src, thumbnail, author, published_date

Method 2: Python API via requests

Use the SearXNG REST API directly from Python with the requests library:

import os, requests, urllib.parse

base_url = os.environ.get("SEARXNG_URL", "")
if not base_url:
    raise RuntimeError("SEARXNG_URL is not set")

query = "fastapi deployment guide"
params = {
    "q": query,
    "format": "json",
    "limit": 5,
    "engines": "google,bing",
}

resp = requests.get(f"{base_url}/search", params=params, timeout=10)
resp.raise_for_status()
data = resp.json()

for r in data.get("results", []):
    print(r["title"])
    print(r["url"])
    print(r.get("content", "")[:200])
    print()

Self-Hosting SearXNG

To run your own SearXNG instance:

# Using Docker
docker run -d -p 8888:8080 \
  -v $(pwd)/searxng:/etc/searxng \
  searxng/searxng:latest

# Then set
SEARXNG_URL=http://localhost:8888

Or install via pip:

pip install searxng
# Edit /etc/searxng/settings.yml
searxng-run

Public SearXNG instances are available at:

  • https://searxng.example.com (replace with any public instance)

Workflow: Search then Extract

SearXNG returns titles, URLs, and snippets — not full page content. To get full page content, search first and then extract the most relevant URL with web_extract, browser tools, or curl.

# Search for relevant pages
curl -s "${SEARXNG_URL}/search?q=fastapi+deployment&format=json&limit=3"
# Output: list of results with titles and URLs

# Then extract the best URL with web_extract

Limitations

  • Instance availability: If the SearXNG instance is down or unreachable, search fails. Always check `SEARXN
常见问题

需要 API 密钥吗?

不需要。技能说明公共的 SearXNG 实例无需密钥,但你必须设置地址。

如果 SearXNG 无法访问怎么办?

技能说明,当实例没有响应时,AI 应改用其他搜索工具。

我可以运行自己的 SearXNG 服务器吗?

可以。技能说明 SearXNG 可以自行托管,以获得完全的控制权。

详情

作者的原始描述

Free keyless meta-search aggregating 70+ engines.

repo: NousResearch/hermes-agent

热度

GitHub 星标
260k
排名
#561
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能