> ## 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.

# YouTube 搜索 API

> YouTube 搜索



## OpenAPI

````yaml openapi/zh/youte-search.json GET /youtube/search
openapi: 3.0.3
info:
  title: YouTube Search API
  description: SearchApi.io YouTube 搜索端点
  version: 1.0.0
servers:
  - url: https://api.aisa.one/apis/v1
    description: YouTube Search API Server
security:
  - bearerAuth: []
paths:
  /youtube/search:
    get:
      tags:
        - YouTube Search
      summary: YouTube 搜索
      description: >-
        通过 SearchApi 执行 YouTube 搜索。此 AIsa 封装使用 AIsa 映射路径
        `/apis/v1/youtube/search`；上游 SearchApi 的规范路径未直接挂载。使用
        `engine=youtube`，并提供必填的 `q` 查询。
      parameters:
        - name: engine
          in: query
          required: true
          schema:
            type: string
            enum:
              - youtube
          description: SearchApi 引擎标识符。此 YouTube 端点使用 `youtube`。
        - name: q
          in: query
          required: true
          schema:
            type: string
          description: 搜索查询。运行时和上游 SearchApi 必填。
        - name: sp
          in: query
          required: false
          schema:
            type: string
          description: YouTube 筛选 token（分页或高级筛选）
        - name: gl
          in: query
          required: false
          schema:
            type: string
          description: 国家/地区代码（例如 us、jp）
        - name: hl
          in: query
          required: false
          schema:
            type: string
          description: 界面语言
      responses:
        '200':
          description: YouTube 搜索成功响应
          content:
            application/json:
              schema:
                type: object
                description: SearchApi 通过 AIsa 封装器返回的 YouTube 搜索结果载荷。
                additionalProperties: true
                properties:
                  search_metadata:
                    type: object
                    additionalProperties: true
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                      created_at:
                        type: string
                      request_time_taken:
                        type: number
                      parsing_time_taken:
                        type: number
                      total_time_taken:
                        type: number
                      request_url:
                        type: string
                      html_url:
                        type: string
                      json_url:
                        type: string
                  search_parameters:
                    type: object
                    additionalProperties: true
                  search_information:
                    type: object
                    additionalProperties: true
                    properties:
                      total_results:
                        type: integer
                  videos:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      properties:
                        position:
                          type: integer
                        id:
                          type: string
                        title:
                          type: string
                        link:
                          type: string
                        description:
                          type: string
                        thumbnail:
                          type: string
                        published_time:
                          type: string
                        length:
                          type: string
                        views:
                          oneOf:
                            - type: integer
                            - type: string
                        channel:
                          type: object
                          additionalProperties: true
                        is_live:
                          type: boolean
                        badges:
                          type: array
                          items:
                            type: string
                  channels:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      properties:
                        position:
                          type: integer
                        id:
                          type: string
                        title:
                          type: string
                        link:
                          type: string
                        description:
                          type: string
                        thumbnail:
                          type: string
                        subscribers:
                          type: string
                  shorts:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      properties:
                        position:
                          type: integer
                        section_title:
                          type: string
                        items:
                          type: array
                          items:
                            type: object
                            additionalProperties: true
                  sections:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      properties:
                        position:
                          type: integer
                        section_title:
                          type: string
                        items:
                          type: array
                          items:
                            type: object
                            additionalProperties: true
                  playlists:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                  ads:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                  pagination:
                    type: object
                    additionalProperties: true
                    properties:
                      next_page_token:
                        type: string
        '400':
          description: 请求参数无效
        '401':
          description: 未授权 / API 密钥无效
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````