SearXNG-lite
Lightweight multi-engine aggregated web search. No Docker, no server, no SearXNG instance required — just a single Python script that queries search engines directly.
26 engines across 9 categories, concurrent execution, JSON + compact text output.
What makes this different
Unlike other SearXNG skills that need a running SearXNG server, this skill:
- - Zero infrastructure — no Docker, no SearXNG instance, no HTTP server
- Single file — one Python script (~850 lines) does everything
- Direct queries — sends requests to search engines in-process via httpx
- Hot-reload config — edit
config.yml to toggle categories, changes apply instantly - Concurrent — queries multiple engines in parallel (up to 5 threads)
- Deduplication — merges results from multiple engines, scores by cross-engine overlap
Requirements
- - Python 3.10+
- INLINECODE1 — HTTP client (
pip3 install httpx) - INLINECODE3 — HTML parser (
pip3 install lxml, pre-installed on macOS) - (Optional)
socksio — for SOCKS proxy support (pip3 install socksio) - (Optional)
pyyaml — for config parsing (pip3 install pyyaml; falls back to built-in parser)
Quick start
CODEBLOCK0
How to search
CODEBLOCK1
All paths are relative to this skill's directory.
Arguments
| Arg | Short | Default | Description |
|---|
| INLINECODE9 | | required | Search query |
| INLINECODE10 |
-e | | Comma-separated engine names |
|
--categories |
-c | | Comma-separated categories |
|
--max-results |
-n | 10 | Max results |
|
--lang |
-l | en | Language code (e.g.
en,
zh-CN,
de) |
|
--page |
-p | 1 | Page number |
|
--proxy | | from config | Proxy URL (overrides config/env) |
|
--timeout | | 12 | Timeout in seconds |
|
--all | | | Use all enabled engines |
|
--compact | | | Human-readable text output |
|
--list | | | List engines and exit |
|
--debug | | | Enable debug logging |
Without -e or -c, searches general + knowledge categories.
Configuration
Edit config.yml in the skill directory to customize behavior:
CODEBLOCK2
Proxy setup
Some engines (marked with 🌐) require a proxy to access. Three ways to configure:
- 1. config.yml (recommended): set INLINECODE34
- Environment variable: set INLINECODE35
- CLI flag: pass
--proxy your-proxy-url per search
Priority: CLI flag > config.yml > environment variable.
If no proxy is configured, 🌐-marked engines will fail silently and results from other engines are still returned.
Config hot-reload
The config file is read on every search call. No restart needed — just edit and save.
If config.yml is missing, the script falls back to a default set of engines: bing, brave, duckduckgo, wikipedia.
Categories and engines
| Category | Engines | Use for |
|---|
| INLINECODE42 | bing, brave, duckduckgo, google🌐, startpage, yahoo | General web search |
| INLINECODE43 |
wikipedia, wikidata, wolframalpha🌐 | Facts, definitions, calculations |
|
dev | github, gitlab, stackoverflow, hackernews, reddit🌐, huggingface🌐, mdn | Code, repos, dev Q&A, AI models |
|
academic | arxiv, semantic
scholar, googlescholar🌐, crossref | Papers, citations |
|
news | bing_news, reuters | Current events |
|
video | youtube🌐 | Video search |
|
images | unsplash | Free stock photos |
|
social | lemmy🌐 | Community discussions |
|
translate | lingva🌐 | Translation |
🌐 = requires proxy. Without proxy, these engines are skipped.
Output format
Default JSON:
CODEBLOCK3
INLINECODE51 outputs human-readable text: numbered title, URL, snippet, engine tags.
INLINECODE52 = number of engines that returned this result. Higher = more relevant.
Typical agent workflows
- - General research: INLINECODE53
- Find a library: INLINECODE54
- Academic papers: INLINECODE55
- Tech discussions: INLINECODE56
- AI models: INLINECODE57
- Dev docs: INLINECODE58
- Chinese search: INLINECODE59
- News: INLINECODE60
SearXNG-lite
轻量级多引擎聚合网络搜索。无需Docker、无需服务器、无需SearXNG实例——仅需一个直接查询搜索引擎的Python脚本。
涵盖9个类别共26个引擎,支持并发执行,输出JSON及紧凑文本格式。
独特之处
与其他需要运行SearXNG服务器的技能不同,本技能:
- - 零基础设施 — 无需Docker、无需SearXNG实例、无需HTTP服务器
- 单文件 — 一个Python脚本(约850行)完成所有功能
- 直接查询 — 通过httpx在进程中直接向搜索引擎发送请求
- 热重载配置 — 编辑config.yml即可切换类别,修改即时生效
- 并发执行 — 并行查询多个引擎(最多5个线程)
- 去重机制 — 合并多引擎结果,根据跨引擎重叠度评分
环境要求
- - Python 3.10+
- httpx — HTTP客户端(pip3 install httpx)
- lxml — HTML解析器(pip3 install lxml,macOS预装)
- (可选)socksio — 支持SOCKS代理(pip3 install socksio)
- (可选)pyyaml — 配置解析(pip3 install pyyaml;否则使用内置解析器)
快速开始
bash
安装依赖
pip3 install httpx lxml
搜索
python3 scripts/search.py 你的查询
列出所有引擎
python3 scripts/search.py --list
搜索方法
bash
python3 scripts/search.py 查询词 # 默认(通用+知识引擎)
python3 scripts/search.py 查询词 -c dev # 按类别
python3 scripts/search.py 查询词 -c dev,academic # 多类别
python3 scripts/search.py 查询词 -e github,arxiv # 指定引擎
python3 scripts/search.py 查询词 --all # 所有已启用引擎
python3 scripts/search.py 查询词 -l zh-CN # 中文结果
python3 scripts/search.py 查询词 -n 5 # 限制结果数
python3 scripts/search.py 查询词 --compact # 标题+URL+摘要文本输出
python3 scripts/search.py --list # 显示所有引擎及类别
所有路径均相对于本技能目录。
参数
| 参数 | 缩写 | 默认值 | 说明 |
|---|
| query | | 必填 | 搜索查询 |
| --engines |
-e | | 逗号分隔的引擎名称 |
| --categories | -c | | 逗号分隔的类别 |
| --max-results | -n | 10 | 最大结果数 |
| --lang | -l | en | 语言代码(如en、zh-CN、de) |
| --page | -p | 1 | 页码 |
| --proxy | | 来自配置 | 代理URL(覆盖配置/环境变量) |
| --timeout | | 12 | 超时时间(秒) |
| --all | | | 使用所有已启用引擎 |
| --compact | | | 人类可读的文本输出 |
| --list | | | 列出引擎并退出 |
| --debug | | | 启用调试日志 |
未指定-e或-c时,搜索general(通用)+ knowledge(知识)类别。
配置
编辑技能目录中的config.yml以自定义行为:
yaml
需要代理的引擎(Google、YouTube、Reddit等)
支持:http、https、socks5、socks5h
留空禁用——需要代理的引擎将静默失败。
proxy: socks5h://127.0.0.1:1080
类别开关
categories:
general: true # bing、brave、duckduckgo、google🌐、startpage、yahoo
knowledge: true # wikipedia、wikidata、wolframalpha🌐
dev: true # github、gitlab、stackoverflow、hackernews、reddit🌐、huggingface🌐、mdn
academic: true # arxiv、semantic
scholar、googlescholar🌐、crossref
news: false # bing_news、reuters
video: false # youtube🌐
images: false # unsplash
social: false # lemmy🌐
translate: false # lingva🌐
代理设置
部分引擎(标记🌐)需要代理访问。三种配置方式:
- 1. config.yml(推荐):设置proxy: 你的代理URL
- 环境变量:设置HTTPS_PROXY=你的代理URL
- CLI标志:每次搜索时传入--proxy 你的代理URL
优先级:CLI标志 > config.yml > 环境变量。
若未配置代理,标记🌐的引擎将静默失败,其他引擎的结果仍会返回。
配置热重载
每次搜索调用时都会读取配置文件。无需重启——编辑保存即可生效。
若config.yml缺失,脚本将回退至默认引擎集:bing、brave、duckduckgo、wikipedia。
类别与引擎
| 类别 | 引擎 | 用途 |
|---|
| general | bing、brave、duckduckgo、google🌐、startpage、yahoo | 通用网络搜索 |
| knowledge |
wikipedia、wikidata、wolframalpha🌐 | 事实、定义、计算 |
| dev | github、gitlab、stackoverflow、hackernews、reddit🌐、huggingface🌐、mdn | 代码、仓库、开发者问答、AI模型 |
| academic | arxiv、semantic
scholar、googlescholar🌐、crossref | 论文、引用 |
| news | bing_news、reuters | 时事新闻 |
| video | youtube🌐 | 视频搜索 |
| images | unsplash | 免费图库照片 |
| social | lemmy🌐 | 社区讨论 |
| translate | lingva🌐 | 翻译 |
🌐 = 需要代理。无代理时,这些引擎将被跳过。
输出格式
默认JSON格式:
json
{
query: 搜索词,
results: [
{title: ..., url: ..., content: ..., engines: [bing,brave], score: 2}
],
result_count: 15,
elapsed: 2.1,
engines_used: [bing, brave, wikipedia],
errors: []
}
--compact输出人类可读文本:编号标题、URL、摘要、引擎标签。
score = 返回该结果的引擎数量。数值越高越相关。
典型智能体工作流程
- - 通用研究:python3 scripts/search.py 主题 -n 5
- 查找库:python3 scripts/search.py 图像处理 python -e github
- 学术论文:python3 scripts/search.py 注意力机制 -c academic -n 5
- 技术讨论:python3 scripts/search.py 主题 -e hackernews,reddit
- AI模型:python3 scripts/search.py 文本转语音 -e huggingface
- 开发者文档:python3 scripts/search.py fetch API -e mdn,stackoverflow
- 中文搜索:python3 scripts/search.py 大语言模型 -l zh-CN -n 5
- 新闻:python3 scripts/search.py AI监管 -c news