SearXNG Search
Search the web using your local SearXNG instance - a privacy-respecting metasearch engine. This version uses a zero-dependency Python backend.
Usage Guidelines (AI 必读)
- 1. 优先使用标准输出:除非用户明确要求“原始数据”或“JSON”,否则必须默认执行不带
--format json 的命令。 - 节省 Token:标准输出,能显著减少 Context 消耗,避免推理超时。
- 结果数量:默认请求 10 条结果即可,除非用户要求更多。
AI Constraints (AI 约束)
- - Max Results: 除非用户明确要求,默认使用
-n 10 以节省上下文空间。 - Output Format: 禁止在普通对话中默认使用
--format json,必须使用标准表格输出。
Commands
Web Search
CODEBLOCK0
Category Search
CODEBLOCK1
Advanced Options
CODEBLOCK2
Configuration
Required: Configure the SearXNG instance URL using the configuration file only. Environment variables are NOT supported.
Configuration file (searxng.ini):
CODEBLOCK3
Location: INLINECODE4
Note: If the configuration file does not exist or is missing required settings, the script will automatically create a default configuration file and prompt you to modify it.
Features
- - 🔒 Privacy-focused: Uses your local instance.
- 🛠️ Zero Dependencies: Pure Python (no
pip install required). - 🌐 Multi-engine: Aggregates Google, Bing, DuckDuckGo, etc.
- 📰 Categorized: Specific filters for IT, Science, News, and Images.
- 🚀 AI-Ready: Clean text output specifically formatted for LLM consumption.
API
Uses your local SearXNG JSON API endpoint (no authentication required by default).
SearXNG 搜索
使用本地 SearXNG 实例搜索网络——一个尊重隐私的元搜索引擎。此版本使用零依赖的 Python 后端。
使用指南(AI 必读)
- 1. 优先使用标准输出:除非用户明确要求原始数据或JSON,否则必须默认执行不带 --format json 的命令。
- 节省 Token:标准输出能显著减少上下文消耗,避免推理超时。
- 结果数量:默认请求 10 条结果即可,除非用户要求更多。
AI 约束
- - 最大结果数:除非用户明确要求,默认使用 -n 10 以节省上下文空间。
- 输出格式:禁止在普通对话中默认使用 --format json,必须使用标准表格输出。
命令
网页搜索
bash
标准搜索(前 10 条)
AI 应默认调用此命令
python3 {baseDir}/scripts/searxng.py search query
自定义结果数量(前 20 条)
python3 {baseDir}/scripts/searxng.py search query -n 20
JSON 搜索(仅在用户要求原始数据或 json 时使用)
警告:此模式会产生大量 Token,可能导致处理超时
python3 {baseDir}/scripts/searxng.py search query --format json
分类搜索
bash
专项搜索
python3 {baseDir}/scripts/searxng.py search query --category images
python3 {baseDir}/scripts/searxng.py search query --category news
python3 {baseDir}/scripts/searxng.py search query --category it
python3 {baseDir}/scripts/searxng.py search query --category science
高级选项
bash
指定语言(例如:zh-CN、en)
python3 {baseDir}/scripts/searxng.py search query --language zh-CN
时间过滤(day、week、month、year)
python3 {baseDir}/scripts/searxng.py search query --time-range day
配置
必需: 仅通过配置文件配置 SearXNG 实例 URL。不支持环境变量。
配置文件(searxng.ini):
ini
[searxng]
url = http://your-searxng-instance.com:port
位置:{baseDir}/scripts/searxng.ini
注意:如果配置文件不存在或缺少必需设置,脚本将自动创建默认配置文件并提示您修改。
功能特性
- - 🔒 注重隐私:使用您的本地实例。
- 🛠️ 零依赖:纯 Python(无需 pip install)。
- 🌐 多引擎:聚合 Google、Bing、DuckDuckGo 等。
- 📰 分类搜索:针对 IT、科学、新闻和图片的特定筛选。
- 🚀 AI 就绪:专为 LLM 消费格式化的干净文本输出。
API
使用您的本地 SearXNG JSON API 端点(默认无需身份验证)。