GET /v1/youtube/search/search_v1
YouTube Search API (V1)
stable · 20 credits per success
Search YouTube videos by keyword, with optional language, upload-date, duration and sort filters, or continue with a pagination token. Use it to discover public videos or browse further result pages.
Request parameters
| Name | Type | In | Required | Description | Example |
|---|---|---|---|---|---|
| lang | string | query | no | 可选 IETF 语言标签,用于本地化结果,例如 en-US。留空则使用默认语言。 | demo |
| sortBy | string | query | no | 搜索结果的排序顺序。 可用值: - `relevance`: 按相关性排序 - `uploadDate`: 按上传日期排序 - `viewCount`: 按观看次数排序 - `rating`: 按评分排序 | relevance |
| keyword | string | query | no | 搜索词。第一页必填;使用 nextToken 时留空。 | 咖啡 |
| duration | string | query | no | 视频时长筛选。 可用值: - `all`:不限时长 - `short`:4分钟以下的短视频 - `medium`:4至20分钟的中等长度视频 - `long`:20分钟以上的长视频 | all |
| nextToken | string | query | no | 上一个响应返回的分页令牌。当提供时,关键词和过滤参数将被忽略;非常长的令牌可能超过 GET URL 的长度限制。 | demo |
| uploadDate | string | query | no | 上传日期过滤条件。 可用值: - `all`: 无上传日期限制 - `lastHour`: 最近一小时上传 - `today`: 今天上传 - `thisWeek`: 本周上传 - `thisMonth`: 本月上传 - `thisYe… | all |
Response fields
Field dictionary coming soon — the executable panel shows the live shape.
Errors
| code | HTTP | Meaning | Billed |
|---|---|---|---|
| 40001 | 400 | Invalid parameters | no |
| 40102 | 401 | Invalid or revoked API Key | no |
| 40201 | 402 | Insufficient credits | no |
| 40402 | 404 | Resource not found | no |
| 42201 | 422 | Quality gate failed | no |
| 42901 | 429 | Rate limit exceeded | no |
| 50401 | 504 | Upstream timeout | no |
| 50201 | 502 | Upstream error | no |
Billing
Success costs 20 credits. Any failure — including a 200 that fails the quality gate — costs 0.