z.ai-web-search

TotalClaw 作者 totalclaw

通过 Z.AI Web 搜索 API 进行 AI 优化的网络搜索。返回 LLM 处理的结构化结果(标题、URL、摘要)。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~bartoszpijet-zai-search
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~bartoszpijet-zai-search/file -o bartoszpijet-zai-search.md
# 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

```bash
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

```bash
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](https://chat.z.ai)
- Set `ZAI_API_KEY` in your environment
- Docs: [Web Search Guide](https://docs.z.ai/guides/tools/web-search)

---

## 中文说明

# Z.AI Web Search

使用 Z.AI Web Search API 进行 AI 优化的网络搜索。专为 LLM 设计——返回带有标题、URL、摘要、站点名称和网站图标的结构化结果。

## 搜索

```bash
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
```

## 选项

- `-n <count>`:结果数量(默认:10,最大:50)
- `--domain <domain>`:将结果限制为指定域名(例如 `sohu.com`、`www.example.com`)
- `--recency <filter>`:时间范围——`oneDay`、`oneWeek`、`oneMonth`、`oneYear`、`noLimit`(默认)
- `--days <n>`:recency 的简写(1→oneDay,7→oneWeek,30→oneMonth,365→oneYear)

## 从 URL 提取内容

```bash
node {baseDir}/scripts/extract.mjs "https://example.com/article"
```

注意:Z.AI 不提供提取 API。此脚本使用原生 fetch 获取页面并剥离 HTML 以进行基本的文本提取。如需更丰富的内容,请使用搜索结果(其中包含摘要)。

## 设置

- 在 [Z.AI Platform](https://chat.z.ai) 获取 API 密钥
- 在你的环境中设置 `ZAI_API_KEY`
- 文档:[Web Search Guide](https://docs.z.ai/guides/tools/web-search)