SuperAPI AI 工具集

searxng

通用与其它

查看项目

更新于 10-15 22:11

技能介绍

用途:该技能通过自托管的 SearXNG 实例提供免费、无限制的网页搜索,聚合 Google、Bing、DuckDuckGo、Reddit、GitHub 等 70 多个搜索引擎,适合需要联网检索资料、查代码问题、搜中文内容或获取最新资讯的场景。

主要能力:支持指定搜索引擎、语言、页码、时间范围和安全搜索等参数。参数包括 q(查询词,URL 编码)、engines(如 google,bing,duckduckgo,stackoverflow,github,baidu)、lang(zh、en、all)、pageno(页码)、time_range(day、week、month、year)、safesearch(0、1、2)。

使用方式:先运行 bash skills/searxng/scripts/setup.sh 自动安装并启动 SearXNG(基于 Docker,幂等,可安全重复运行)。随后通过 web_fetch 查询本地实例,例如 http://localhost:8888/search?q=YOUR+QUERY&format=json。常见变体:限定引擎 http://localhost:8888/search?q=react+hooks&engines=google,bing&format=json;按时间筛选 http://localhost:8888/search?q=openai+news&time_range=week&format=json;中文内容 http://localhost:8888/search?q=人工智能&engines=baidu,bing&lang=zh&format=json;开发问题 http://localhost:8888/search?q=rust+async+error&engines=stackoverflow,github&format=json。

最佳实践:先读结果中的 content 摘要,往往已含答案,抓取整页会显著增加 token 消耗,仅在摘要不足时抓取;限制在前 3–5 条结果;按任务定向引擎,如代码用 stackoverflow,github,中文用 baidu,bing&lang=zh,近期事件加 &time_range=week。

限制:若 web_fetch 阻止 localhost(SSRF 防护),出现 Blocked hostname 错误时,可改用 browser 工具直接通过 Google 搜索,但更耗 token;首次请求可能较慢(引擎预热);远程或生产使用需为 SearXNG 实例添加认证。