> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# YouTube SERP

> 面向自治智能体的 YouTube 搜索，返回排序结果和丰富元数据。可用于内容缺口分析、竞品监控、关键词研究，以及按地区/语言进行受众研究。

[在 GitHub 上查看 ->](https://github.com/AIsa-team/agent-skills/tree/main/social-media/youtube-serp)

**面向自治智能体的 YouTube 搜索结果和丰富元数据。** 一个 `AISA_API_KEY` 即可返回排序视频、播放量、发布时间和缩略图，并支持按国家和语言过滤。

## 安装

如果还没有安装 AIsa CLI，请先安装：

```bash theme={null}
npm install -g @aisa-one/cli
```

然后安装该技能：

```bash theme={null}
aisa skills install youtube-serp
```

## 智能体可以用它做什么？

> [card] 内容缺口分析
>
> “找出 ‘AI agent tutorial’ 当前排名靠前、但我们频道还没有覆盖的内容。”

> [card] 竞品监控
>
> “跟踪这个细分领域前 5 个频道的新上传视频。”

> [card] 关键词研究
>
> “哪些 ‘RAG’ 变体能带来最高播放量？”

> [card] 区域趋势
>
> “比较日本（jp/ja）和美国（us/en）的热门机器学习内容。”

> [card] 受众研究
>
> “哪些缩略图和标题适合智能体演示？”

> [card] 趋势发现
>
> “标记相对频道基线速度异常的视频。”

## 核心能力

* **关键词搜索** — 对任意查询返回排序 YouTube 结果
* **区域定向** — `gl`（国家：`us`、`jp`、`cn` 等）和 `hl`（界面语言：`en`、`ja`、`zh-CN` 等）
* **丰富元数据** — 标题、频道、播放量、发布日期、时长和缩略图
* **分页** — 使用过滤 token 跳转到第一页之后的结果

## 快速开始

```bash theme={null}
export AISA_API_KEY="your-key"
```

### 基础搜索

```bash theme={null}
curl "https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+agents+tutorial" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 地区 + 语言

```bash theme={null}
# 日本机器学习内容，日语界面
curl "https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=machine+learning&gl=jp&hl=ja" \
  -H "Authorization: Bearer $AISA_API_KEY"

# 美国 AI 趋势，英语界面
curl "https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+trends+2026&gl=us&hl=en" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 分页

响应会包含分页 token，可传回端点抓取下一页：

```bash theme={null}
curl "https://api.aisa.one/apis/v1/youtube/search?engine=youtube&q=AI+agents&sp=NEXT_PAGE_TOKEN" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

## Python 客户端

```bash theme={null}
# 基础搜索
python3 scripts/youtube_client.py search --query "autonomous agents"

# 指定国家
python3 scripts/youtube_client.py search --query "coding tutorial" --country us

# 指定国家 + 语言
python3 scripts/youtube_client.py search --query "機械学習" --country jp --lang ja
```

## 端点参考

| Endpoint | Method | 用途 |
| - | - | - |
| `/youtube/search` | GET | [YouTube 搜索](https://aisa.one/docs/api-reference/search/get_youtube-search.md) |

**常用参数：**

* `engine` — 固定为 `youtube`
* `q` — 搜索查询（必填）
* `gl` — 国家代码（`us`、`jp`、`cn` 等）
* `hl` — 语言代码（`en`、`ja`、`zh-CN` 等）
* `sp` — 分页 token

## 开始使用

1. 在 [aisa.one](https://aisa.one) 注册（新账户有 \$1 免费额度）。
2. 从控制台生成 API key。
3. `export AISA_API_KEY="your-key"` 并安装技能：
   ```bash theme={null}
   npm install -g @aisa-one/cli
   aisa skills install youtube-serp
   ```

## 相关

> [card] [YouTube Search Endpoint](https://aisa.one/docs/api-reference/search/get_youtube-search.md)
>
> 完整端点参考和交互式 Playground。

> [card] [多源搜索](https://aisa.one/docs/zh/agent-skills/multi-source-search.md)
>
> 将 YouTube 搜索与网页、学术搜索、Tavily 组合使用。

> [card] [错误码](https://aisa.one/docs/api-reference/errors.md)
>
> 处理 YouTube API 层错误。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.