简介
Z.AI 官方 AI 优化搜索 API,专为 LLM 设计,返回结构化结果(标题、URL、摘要),支持域名过滤与时间筛选
原始描述
AI-optimized web search via Z.AI Web Search API. Returns structured results (title, URL, summary) for LLM processing.
安装
下载 zip 解压后,把里面的文件放进你的 Agent 的 skills 目录即可使用。
给 Agent 的直链(让它自己下载安装):
https://v110.com/skill/z-ai-web-search.zip
Claude Code 放 ~/.claude/skills/;Codex、TypingMind 等按各自文档的 skills 目录放置。技能申请什么权限由作者决定,装前请确认。
中文使用说明 来自收录源
核心功能与定位
Z.AI Web Search 是由智谱 AI(Z.AI)官方提供的 AI 优化型网络搜索工具,专为 LLM 场景设计。区别于传统搜索引擎面向人类的网页展示,该 API 直接返回结构化数据(标题、URL、摘要、站点名称、favicon),大幅降低模型处理 HTML 的噪声成本。
核心用法
| 命令 | 说明 |
|---|---|
node search.mjs "query" |
基础搜索,默认返回 10 条结果 |
-n 15 |
指定结果数量(1-50) |
--domain sohu.com |
限定特定域名 |
--recency oneWeek / --days 7 |
时间范围筛选(1天/7天/30天/365天) |
node extract.mjs "URL" |
本地 URL 内容抓取(非官方 API,仅基础 HTML 清洗) |
显著优点
- LLM 原生设计:预清洗的摘要文本减少 token 消耗,避免模型被网页导航、广告等噪声干扰
- 结构化输出:标准 JSON 格式便于直接注入 prompt 或 RAG 流程
- 时间筛选灵活:支持近 1 天到 1 年的梯度过滤,适合追踪热点或历史资料
- 域名白名单:可限定权威信源(如
arxiv.org、who.int),提升答案可信度 - 官方背书:智谱 AI 作为国内头部大模型厂商,API 稳定性与持续迭代有保障
潜在局限
- 地域覆盖:中文互联网收录较强,但英文长尾内容可能弱于 Google/Bing
- 提取功能非官方:
extract.mjs仅为本地脚本,无 JS 渲染能力,动态网页抓取受限 - 摘要质量依赖原文:若源站内容质量差,摘要价值同步降低
- 成本考量:需 Z.AI 平台 API Key,商业化使用需关注用量计费
适合人群
- 构建 AI 搜索 Agent、知识问答系统的开发者
- 需要为 LLM 提供实时信息增强的 RAG 应用
- 中文内容检索优先的企业级用户
- 希望避免自建爬虫与清洗管道的团队
常规风险提示
- API Key 安全:
ZAI_API_KEY需妥善保管,避免硬编码泄露 - 内容合规:搜索结果可能包含未审核的第三方信息,输出前建议增加安全过滤层
- 时效性边界:
--days筛选基于索引时间而非网页更新时间,极端时效场景需二次校验 - 服务依赖:单一供应商风险,关键业务建议设计降级方案(如备用搜索引擎)
技能正文
name: z.ai-web-search description: AI-optimized web search via Z.AI Web Search API. Returns structured results (title, URL, summary) for LLM processing. homepage: https://docs.z.ai/guides/tools/web-search metadata: {"clawdbot":{"emoji":"🔍","requires":{"bins":["node"],"env":["ZAI_API_KEY"]},"primaryEnv":"ZAI_API_KEY"}}
Z.AI Web Search
AI-optimized web search using Z.AI Web Search API. Designed for LLMs – returns structured results with titles, URLs, summaries, site names and favicons.
Search
node {baseDir}/scripts/search.mjs "query"
node {baseDir}/scripts/search.mjs "query" -n 15
node {baseDir}/scripts/search.mjs "query" --domain sohu.com
node {baseDir}/scripts/search.mjs "query" --recency oneWeek
node {baseDir}/scripts/search.mjs "query" --days 7
Options
-n <count>: Number of results (default: 10, max: 50)--domain <domain>: Limit results to specified domain (e.g.sohu.com,www.example.com)--recency <filter>: Time range –oneDay,oneWeek,oneMonth,oneYear,noLimit(default)--days <n>: Shorthand for recency (1→oneDay, 7→oneWeek, 30→oneMonth, 365→oneYear)
Extract content from URL
node {baseDir}/scripts/extract.mjs "https://example.com/article"
Note: Z.AI does not provide an extract API. This script uses native fetch to retrieve pages and strips HTML for basic text extraction. For richer content, use search results (they include summaries).
Setup
- Get API key at Z.AI Platform
- Set
ZAI_API_KEYin your environment - Docs: Web Search Guide
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。