# 搜索视频

按查询词搜索 YouTube 公开视频。

ID: native-http:social.youtube.content.search · Region: cn · Status: available

catalog_version: 5c920c774a55e44d7e8c709143b88a18b8b2afcef91a5d19a8c9ae5d565d9077
updated_at: 2026-10-21T12:06:16.523771+00:00

按查询词搜索 YouTube 公开视频。

历史数据以数据集发布版本定义覆盖周期；实时读取反映请求时资料，不保证覆盖全部记录。

Docs: https://docs.asklear.cn/capabilities/native-http%3Asocial.youtube.content.search

## POST /v1/native/social/youtube/content/search

native · available · api_key

REST 需要客户 API Key；MCP 需要已开放的服务及现有授权；CLI 需要已发布且包含该命令的客户端。

按查询词搜索 YouTube 公开视频。

按成功请求计费，每次请求计一次；max_credits 限制本次费用上限。

恢复同一次原生请求时复用原 Idempotency-Key。

等待态响应提供结果/状态引用。先读取原结果；超时或结果不明时禁止自动重新提交付费执行。401/403/422 应先修正鉴权、权限或输入。

### Input schema / 输入契约

```json
{
  "$defs": {
    "Schema1": {}
  },
  "additionalProperties": false,
  "properties": {
    "input": {
      "additionalProperties": false,
      "properties": {
        "cursor": {
          "default": "",
          "description": "分页token，用于获取下一页/Continuation token for next page",
          "maxLength": 4096,
          "type": "string"
        },
        "duration": {
          "anyOf": [
            {
              "enum": [
                "short",
                "medium",
                "long"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "时长过滤/Duration filter: short (<4min), medium (4-20min), long (>20min)"
        },
        "features": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "特性过滤（逗号分隔）/Feature filter (comma separated): live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr"
        },
        "keyword": {
          "description": "搜索关键词（首次请求必填）/Search keyword (required for first request)",
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        },
        "sort_by": {
          "default": "",
          "description": "排序方式/Sort by",
          "enum": [
            "",
            "relevance",
            "upload_date",
            "view_count",
            "rating"
          ],
          "type": "string"
        },
        "type": {
          "anyOf": [
            {
              "enum": [
                "video",
                "channel",
                "playlist",
                "movie"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "类型过滤/Type filter"
        },
        "upload_date": {
          "default": "",
          "description": "上传时间过滤/Upload date filter",
          "enum": [
            "",
            "last_hour",
            "today",
            "this_week",
            "this_month",
            "this_year"
          ],
          "type": "string"
        }
      },
      "required": [
        "keyword"
      ],
      "type": "object"
    },
    "max_credits": {
      "anyOf": [
        {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "task_query": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional task attribution: when provided, write one concise, self-contained task_query in the user's language and reuse that exact value in every call for the task, including discovery, search, approval retry, results, export, and status checks. For MCP calls, when omitted, Asklear records a generic non-user-specific attribution so compatible clients can still call the tool. REST calls may omit it and remain unattributed. It is a task description, not a task identifier. Do not include hidden reasoning, credentials, or direct personal identifiers such as phone numbers, email addresses, identity numbers, or street addresses.",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}
```

### Synthetic request / 合成请求

```json
{
  "input": {
    "keyword": "example"
  }
}
```

### Response schema / 响应契约

```json
{
  "$defs": {
    "Schema1": {},
    "Schema2": {
      "properties": {
        "api_name": {
          "type": "string"
        },
        "credits_charged": {
          "minimum": 0,
          "type": "integer"
        },
        "latency_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "next_input": {
          "anyOf": [
            {
              "additionalProperties": false,
              "properties": {
                "cursor": {
                  "default": "",
                  "maxLength": 4096,
                  "type": "string"
                },
                "duration": {
                  "anyOf": [
                    {
                      "enum": [
                        "short",
                        "medium",
                        "long"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "时长过滤/Duration filter: short (<4min), medium (4-20min), long (>20min)"
                },
                "features": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "特性过滤（逗号分隔）/Feature filter (comma separated): live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr"
                },
                "keyword": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "sort_by": {
                  "default": "",
                  "enum": [
                    "",
                    "relevance",
                    "upload_date",
                    "view_count",
                    "rating"
                  ],
                  "type": "string"
                },
                "type": {
                  "anyOf": [
                    {
                      "enum": [
                        "video",
                        "channel",
                        "playlist",
                        "movie"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "类型过滤/Type filter"
                },
                "upload_date": {
                  "default": "",
                  "enum": [
                    "",
                    "last_hour",
                    "today",
                    "this_week",
                    "this_month",
                    "this_year"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "keyword"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "api_name",
        "request_id",
        "latency_ms",
        "credits_charged",
        "next_input"
      ],
      "type": "object"
    }
  },
  "properties": {
    "data": {
      "additionalProperties": true,
      "description": "Known optional fields from sanitized offline fixtures; conditional fields may be null. Additional business fields are retained.",
      "properties": {
        "code": {
          "type": [
            "integer",
            "null"
          ]
        },
        "data": {
          "additionalProperties": true,
          "properties": {
            "channels": {
              "items": {
                "description": "Observed as null; the non-null type is not established."
              },
              "type": [
                "array",
                "null"
              ]
            },
            "completion_suggestions": {
              "items": {
                "description": "Observed as null; the non-null type is not established."
              },
              "type": [
                "array",
                "null"
              ]
            },
            "continuation_token": {
              "type": [
                "string",
                "null"
              ]
            },
            "keyword": {
              "type": [
                "string",
                "null"
              ]
            },
            "playlists": {
              "items": {
                "description": "Observed as null; the non-null type is not established."
              },
              "type": [
                "array",
                "null"
              ]
            },
            "shorts": {
              "items": {
                "description": "Observed as null; the non-null type is not established."
              },
              "type": [
                "array",
                "null"
              ]
            },
            "videos": {
              "items": {
                "additionalProperties": true,
                "properties": {
                  "author": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "channel_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "description_snippet": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "duration": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "published_time": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "thumbnails": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "height": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "width": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "video_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "view_count": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": [
                  "object",
                  "null"
                ]
              },
              "type": [
                "array",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "meta": {
      "$ref": "#/$defs/Schema2"
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}
```

### Synthetic response / 合成响应

```json
{
  "data": {
    "code": 200,
    "data": {
      "channels": [],
      "completion_suggestions": [],
      "continuation_token": "EXAMPLE-YOUTUBE-CONTINUATION-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
      "keyword": "cat",
      "playlists": [],
      "shorts": [],
      "videos": [
        {
          "author": "CAT MEME TRIP",
          "channel_id": "UC8MZrwaFDAdiXlJie-HRjgA",
          "description_snippet": "",
          "duration": "48:45",
          "published_time": "4 months ago",
          "thumbnails": [
            {
              "height": 202,
              "url": "https://i.ytimg.com/vi/0IHQ4ArwRLY/hq720.jpg?sqp=-oaymwEjCOgCEMoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLDJuJ6duP-U-jK_ZzymdrNwzvPuVw",
              "width": 360
            }
          ],
          "title": "CAT MEMES FAMILY VACATION TRIP COMPILATION FULL",
          "url": "https://www.youtube.com/watch?v=0IHQ4ArwRLY",
          "video_id": "0IHQ4ArwRLY",
          "view_count": "617,145 views"
        }
      ]
    },
    "message": "redacted provider response"
  },
  "meta": {
    "api_name": "social.youtube.content.search",
    "credits_charged": 4,
    "latency_ms": 12,
    "next_input": {
      "cursor": "EXAMPLE-YOUTUBE-CONTINUATION-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
      "keyword": "cat"
    },
    "request_id": "asklear-example"
  }
}
```

- data (object): Known optional fields from sanitized offline fixtures; conditional fields may be null. Additional business fields are retained.
- data.code (integer|null): 暂无字段说明
- data.data (object|null): 暂无字段说明
- data.data.channels (array|null): 暂无字段说明
- data.data.completion_suggestions (array|null): 暂无字段说明
- data.data.continuation_token (string|null): 暂无字段说明
- data.data.keyword (string|null): 暂无字段说明
- data.data.playlists (array|null): 暂无字段说明
- data.data.shorts (array|null): 暂无字段说明
- data.data.videos (array|null): 暂无字段说明
- data.message (string|null): 暂无字段说明
- meta (object): 暂无字段说明
- meta.api_name (string): 暂无字段说明
- meta.request_id (string): 暂无字段说明
- meta.latency_ms (integer): 暂无字段说明
- meta.credits_charged (integer): 暂无字段说明
- meta.next_input (scalar): 暂无字段说明
- data.data.videos[].author (string|null): 作者显示名称。
- data.data.videos[].channel_id (string|null): 作者 ID。
- data.data.videos[].description_snippet (string|null): 如有则返回公开摘要。
- data.data.videos[].duration (string|null): 如有则返回展示用时长文本。
- data.data.videos[].published_time (string|null): 如有则返回原始发布时间文本。
- data.data.videos[].thumbnails (array|null): 暂无字段说明
- data.data.videos[].thumbnails[].height (integer|null): 暂无字段说明
- data.data.videos[].thumbnails[].url (string|null): 暂无字段说明
- data.data.videos[].thumbnails[].width (integer|null): 暂无字段说明
- data.data.videos[].title (string|null): 如有则返回公开标题。
- data.data.videos[].url (string|null): 如有则返回公开结果 URL。
- data.data.videos[].video_id (string|null): 视频公开标识。
- data.data.videos[].view_count (string|null): 浏览数。
- meta.next_input.cursor (string): 暂无字段说明
- meta.next_input.duration (string|null): 时长过滤/Duration filter: short (<4min), medium (4-20min), long (>20min)
- meta.next_input.features (string|null): 特性过滤（逗号分隔）/Feature filter (comma separated): live, 4k, hd, subtitles, creative_commons, 360, vr180, 3d, hdr
- meta.next_input.keyword (string): 暂无字段说明
- meta.next_input.sort_by (string): 暂无字段说明
- meta.next_input.type (string|null): 类型过滤/Type filter
- meta.next_input.upload_date (string): 暂无字段说明

Follow up: GET /v1/native/results/{query_id}
读取已保存结果，不重复查询数据或收费。

