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

# Search Videos

> 搜索 YouTube，返回匹配的视频、频道和播放列表。

搜索 YouTube，返回匹配的视频、频道和播放列表。需设置 `engine=youtube` 并在 `q` 中传入查询词；两者均为必填。可选地按国家（`gl`）和界面语言（`hl`）收窄，或在 `sp` 中传入 YouTube 筛选 token 以实现分页和上传日期、时长、结果类型等高级筛选。适合用于查找某个话题的视频内容、跟踪某频道的近期上传，或评估某主题的视频覆盖度。

注意：该接口通过 AIsa 映射路径 `/apis/v1/youtube/search` 提供服务；上游提供商的原生路径并未直接挂载。

> [!NOTE]
>
> **第一次用？** 把任意 MCP 客户端指向 `https://mcp.aisa.one/mcp` —— Claude Code、
> Codex、Cursor、VS Code 都可以。鉴权走 OAuth：客户端打开浏览器，你点一次
> Allow，不需要粘贴任何 key。之后智能体通过几个元工具调用所有端点：
> `search`、`list_categories`、`get_details` 和 `batch_quote` 免费，`batch_use`
> 按次计费。各客户端的接入步骤见[通过 MCP 连接](https://aisa.one/docs/zh/agent-quickstart.md)；实时工具列表和
> 每次调用的价格见 [aisa.one/zh-cn/mcp](https://aisa.one/zh-cn/mcp#connect)。

[在你的 agent 里把这个端点跑起来 →](https://aisa.one/mcp?from=/zh/api-reference/search/get_youtube-search)

## 请求规范

* **方法与路径:** GET /apis/v1/youtube/search
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/youtube/search`
* **engine:** query; 必填
* **gl:** query; 可选
* **hl:** query; 可选
* **q:** query; 必填
* **sp:** query; 可选

[完整 OpenAPI 定义](https://aisa.one/docs/openapi-public/zh/youtube.json)

有效请求声明（包括认证和引用的 schema）：

```json theme={null}
{
  "operationId": "get_youtube_search",
  "method": "GET",
  "path": "/apis/v1/youtube/search",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [
    {
      "description": "SearchApi engine identifier. Use `youtube` for this YouTube endpoint.",
      "in": "query",
      "name": "engine",
      "required": true,
      "schema": {
        "enum": [
          "youtube"
        ],
        "type": "string"
      }
    },
    {
      "description": "Country code (e.g. us, jp)",
      "in": "query",
      "name": "gl",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Interface language",
      "in": "query",
      "name": "hl",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Search query. Required by runtime and upstream SearchApi.",
      "in": "query",
      "name": "q",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "YouTube filter token (pagination or advanced filters)",
      "in": "query",
      "name": "sp",
      "required": false,
      "schema": {
        "type": "string"
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 费用与请求规则

请求费用。 默认请求预估费用：\$0.0029 USD。 最终费用以实际用量为准。 账户适用价格可能不同；支持报价的接口可按实际请求获取报价。


## OpenAPI

````yaml openapi-public/zh/youtube.json GET /apis/v1/youtube/search
openapi: 3.1.0
info:
  description: ''
  title: Youtube
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    youtube:
      description: ''
      title: Youtube
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: df38108c5e38fb1e141efbcf9c4ae031508a206b64d543a25442fd82a1088b1c
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/airbnb/search
    - /apis/v1/ebay/search
    - /apis/v1/youtube/channel
    - /apis/v1/youtube/channels/shorts
    - /apis/v1/youtube/channels/videos
    - /apis/v1/youtube/community-posts
    - /apis/v1/youtube/playlists
    - /apis/v1/youtube/search
    - /apis/v1/youtube/search/hashtags
    - /apis/v1/youtube/shorts/trending
    - /apis/v1/youtube/videos
    - /apis/v1/youtube/videos/comments
    - /apis/v1/youtube/videos/comments/analysis
    - /apis/v1/youtube/videos/comments/replies
    - /apis/v1/youtube/videos/transcript
  x-aisa-document:
    composer_version: '31'
    facts_hash: df38108c5e38fb1e141efbcf9c4ae031508a206b64d543a25442fd82a1088b1c
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
    public_projection:
      version: '4'
      source_document_hash: sha256:9089b0c9a735f52274805537455639a576691d7eeb8b83bba0d5e792585a180b
    document_hash: sha256:f96536c9ccd99cfb198e4faa1501c8281408c685307b425122d3c9bad10ebe68
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: youtube
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/youtube/search:
    get:
      tags:
        - group1000
      summary: Search Videos
      description: >-
        搜索 YouTube，返回匹配的视频、频道和播放列表。需设置 `engine=youtube` 并在 `q`
        中传入查询词；两者均为必填。可选地按国家（`gl`）和界面语言（`hl`）收窄，或在 `sp` 中传入 YouTube 筛选 token
        以实现分页和上传日期、时长、结果类型等高级筛选。适合用于查找某个话题的视频内容、跟踪某频道的近期上传，或评估某主题的视频覆盖度。注意：该接口通过
        AIsa 映射路径 `/apis/v1/youtube/search` 提供服务；上游提供商的原生路径并未直接挂载。


        > **请求示例待验证。**
        此接口的请求示例尚未在生产环境验证。静态示例用于说明请求格式，请替换为自己的参数。正式调用前，可用免费的报价模式（`X-AISA-Cost-Mode:
        quote`）查看预估费用。
      operationId: get_youtube_search
      parameters:
        - description: SearchApi 引擎标识符。此 YouTube 端点使用 `youtube`。
          in: query
          name: engine
          required: true
          schema:
            enum:
              - youtube
            type: string
        - description: 国家/地区代码（例如 us、jp）
          in: query
          name: gl
          required: false
          schema:
            type: string
        - description: 界面语言
          in: query
          name: hl
          required: false
          schema:
            type: string
        - description: 搜索查询。运行时和上游 SearchApi 必填。
          in: query
          name: q
          required: true
          schema:
            type: string
        - description: YouTube 筛选 token（分页或高级筛选）
          in: query
          name: sp
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseFc5Af1Fcba22_SearchResponse'
          description: 成功响应
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  schemas:
    ResponseFc5Af1Fcba22_SearchResponse:
      properties:
        ads:
          description: Advertisement results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Ad'
          type: array
        channels:
          description: YouTube channel results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Channel'
          type: array
        error:
          description: Error message if the search failed
          type: string
        featured_channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_FeaturedChannel'
        movies:
          description: Movie results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Movie'
          type: array
        pagination:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Pagination'
        people_also_search_for:
          description: Related search suggestions
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_PeopleAlsoSearchFor'
          type: array
        playlists:
          description: Playlist results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Playlist'
          type: array
        posts:
          description: Community post results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Posts'
          type: array
        search_information:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_SearchInformation'
        search_metadata:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_SearchMetadata'
        search_parameters:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_SearchParameters'
        sections:
          description: Section results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Section'
          type: array
        shorts:
          description: YouTube Shorts results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Shorts'
          type: array
        suggestions:
          description: Search query suggestions
          items:
            type: string
          type: array
        videos:
          description: Video search results
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Video'
          type: array
      type: object
    ResponseFc5Af1Fcba22_Ad:
      properties:
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_AdChannel'
        description:
          description: Ad description
          type: string
        id:
          description: Video ID for video ads
          type: string
        length:
          description: Video duration for video ads
          type: string
        link:
          description: Ad link
          type: string
        position:
          description: Position in search results
          type: integer
        thumbnail:
          description: Ad thumbnail URL
          type: string
        title:
          description: Ad title
          type: string
        website:
          description: Advertiser website URL
          type: string
      type: object
    ResponseFc5Af1Fcba22_Channel:
      properties:
        description:
          description: Channel description
          type: string
        id:
          description: YouTube channel ID
          type: string
        is_verified:
          description: Whether the channel is verified
          type: boolean
        link:
          description: Link to the channel
          type: string
        position:
          description: Position in search results
          type: integer
        subscribers:
          description: Number of subscribers
          type: integer
        thumbnail:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Thumbnail'
        title:
          description: Channel name
          type: string
        video_count:
          description: Number of videos
          type: integer
      type: object
    ResponseFc5Af1Fcba22_FeaturedChannel:
      properties:
        highlighted_video:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_HighlightedVideo'
        id:
          description: Featured channel ID
          type: string
        link:
          description: Link to the featured channel
          type: string
        subtitle:
          description: Featured channel subtitle
          type: string
        title:
          description: Featured channel title
          type: string
        videos:
          description: Featured channel videos
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_FeaturedVideo'
          type: array
      type: object
    ResponseFc5Af1Fcba22_Movie:
      properties:
        badges:
          description: Movie badges
          items:
            type: string
          type: array
        buttons:
          description: Action buttons
          items:
            type: string
          type: array
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_MovieChannel'
        description:
          description: Movie description
          type: string
        id:
          description: Movie video ID
          type: string
        length:
          description: Movie duration
          type: string
        link:
          description: Link to the movie
          type: string
        metadata_items:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_MetadataItems'
        position:
          description: Position in search results
          type: integer
        thumbnail:
          description: Movie thumbnail URL
          type: string
        title:
          description: Movie title
          type: string
      type: object
    ResponseFc5Af1Fcba22_Pagination:
      properties:
        next_page_token:
          description: Token to fetch the next page of results
          type: string
      type: object
    ResponseFc5Af1Fcba22_PeopleAlsoSearchFor:
      properties:
        link:
          description: Link to perform the search
          type: string
        query:
          description: Suggested search query
          type: string
        thumbnail:
          description: Thumbnail for the suggestion
          type: string
      type: object
    ResponseFc5Af1Fcba22_Playlist:
      properties:
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_PlaylistChannel'
        id:
          description: Playlist ID
          type: string
        link:
          description: Link to the playlist
          type: string
        position:
          description: Position in search results
          type: integer
        published_time:
          description: Time since publication
          type: string
        thumbnail:
          description: Playlist thumbnail URL
          type: string
        title:
          description: Playlist title
          type: string
        video_count:
          description: Number of videos in playlist
          type: integer
        videos:
          description: Videos in the playlist
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_PlaylistVideo'
          type: array
      type: object
    ResponseFc5Af1Fcba22_Posts:
      properties:
        items:
          description: Community posts
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Post'
          type: array
        position:
          description: Position in search results
          type: integer
        section_title:
          description: Section title for posts
          type: string
      type: object
    ResponseFc5Af1Fcba22_SearchInformation:
      properties:
        corrected_query:
          description: Corrected query if spelling fix was applied
          type: string
        original_query:
          description: Original query before correction
          type: string
        original_query_sp:
          description: SP parameter for original query
          type: string
        state:
          description: State of query correction if applicable
          type: string
        total_results:
          description: Total number of results found
          type: integer
      type: object
    ResponseFc5Af1Fcba22_SearchMetadata:
      properties:
        created_at:
          description: Timestamp when the search was created
          format: date-time
          type: string
        html_url:
          description: URL to view HTML results
          type: string
        id:
          description: 搜索请求的唯一标识符
          type: string
        json_url:
          description: URL to view JSON results
          type: string
        parsing_time_taken:
          description: Time taken to parse the results in seconds
          type: number
        request_time_taken:
          description: Time taken to make the request in seconds
          type: number
        request_url:
          description: YouTube URL for this search
          type: string
        status:
          description: Status of the search request
          type: string
        total_time_taken:
          description: Total time taken for the search in seconds
          type: number
      required:
        - id
        - status
        - created_at
      type: object
    ResponseFc5Af1Fcba22_SearchParameters:
      properties:
        engine:
          description: Search engine used
          type: string
        gl:
          description: Country code that was used
          type: string
        hl:
          description: Interface language that was used
          type: string
        q:
          description: Search query that was used
          type: string
        sp:
          description: Filter/pagination parameter that was used
          type: string
      type: object
    ResponseFc5Af1Fcba22_Section:
      properties:
        items:
          description: Items in the section
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_SectionItem'
          type: array
        position:
          description: Position in search results
          type: integer
        section_title:
          description: Section title
          type: string
      type: object
    ResponseFc5Af1Fcba22_Shorts:
      properties:
        items:
          description: Short videos
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Short'
          type: array
        position:
          description: Position in search results
          type: integer
        section_title:
          description: Section title for shorts
          type: string
      type: object
    ResponseFc5Af1Fcba22_Video:
      properties:
        badges:
          description: Video badges
          items:
            type: string
          type: array
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_VideoChannel'
        description:
          description: Video description snippet
          type: string
        id:
          description: YouTube video ID
          type: string
        is_live:
          description: Whether the video is currently live
          type: boolean
        key_moments:
          description: Key moments in the video
          items:
            $ref: '#/components/schemas/ResponseFc5Af1Fcba22_KeyMoment'
          type: array
        length:
          description: Video duration
          type: string
        link:
          description: Link to the video
          type: string
        position:
          description: Position in search results
          type: integer
        published_time:
          description: Time since publication
          type: string
        thumbnail:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_Thumbnail'
        title:
          description: Video title
          type: string
        views:
          description: Number of views
          type: integer
      type: object
    ResponseFc5Af1Fcba22_AdChannel:
      properties:
        id:
          description: Channel ID
          type: string
        link:
          description: Link to the channel
          type: string
        title:
          description: Channel name
          type: string
      type: object
    ResponseFc5Af1Fcba22_Thumbnail:
      properties:
        rich:
          description: Rich/animated thumbnail URL
          type: string
        static:
          description: Static thumbnail URL
          type: string
      type: object
    ResponseFc5Af1Fcba22_HighlightedVideo:
      properties:
        id:
          description: Video ID
          type: string
        length:
          description: Video duration
          type: string
        link:
          description: Link to the video
          type: string
        subtitle:
          description: Video subtitle
          type: string
        title:
          description: Video title
          type: string
      type: object
    ResponseFc5Af1Fcba22_FeaturedVideo:
      properties:
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_FeaturedVideoChannel'
        id:
          description: Video ID
          type: string
        length:
          description: Video duration
          type: string
        link:
          description: Link to the video
          type: string
        subtitle:
          description: Video subtitle
          type: string
        thumbnail:
          description: Video thumbnail URL
          type: string
        title:
          description: Video title
          type: string
      type: object
    ResponseFc5Af1Fcba22_MovieChannel:
      properties:
        id:
          description: Channel ID
          type: string
        is_verified:
          description: Whether the channel is verified
          type: boolean
        link:
          description: Link to the channel
          type: string
        title:
          description: Channel name
          type: string
      type: object
    ResponseFc5Af1Fcba22_MetadataItems:
      properties:
        bottom:
          description: Bottom metadata items
          items:
            type: string
          type: array
        top:
          description: Top metadata items
          items:
            type: string
          type: array
      type: object
    ResponseFc5Af1Fcba22_PlaylistChannel:
      properties:
        id:
          description: Channel ID
          type: string
        is_verified:
          description: Whether the channel is verified
          type: boolean
        link:
          description: Link to the channel
          type: string
        title:
          description: Channel name
          type: string
      type: object
    ResponseFc5Af1Fcba22_PlaylistVideo:
      properties:
        id:
          description: Video ID
          type: string
        length:
          description: Video duration
          type: string
        link:
          description: Link to the video
          type: string
        title:
          description: Video title
          type: string
      type: object
    ResponseFc5Af1Fcba22_Post:
      properties:
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_PostChannel'
        comments:
          description: Number of comments text
          type: string
        extracted_comments:
          description: Number of comments as integer
          type: integer
        extracted_likes:
          description: Number of likes as integer
          type: integer
        id:
          description: Post ID
          type: string
        likes:
          description: Number of likes text
          type: string
        link:
          description: Link to the post
          type: string
        position:
          description: Position within posts section
          type: integer
        published_time:
          description: Time since publication
          type: string
        text:
          description: Post text content
          type: string
        thumbnail:
          description: Post thumbnail URL
          type: string
      type: object
    ResponseFc5Af1Fcba22_SectionItem:
      properties:
        channel:
          $ref: '#/components/schemas/ResponseFc5Af1Fcba22_SectionChannel'
        id:
          description: Item ID
          type: string
        length:
          description: Item duration
          type: string
        link:
          description: Link to the item
          type: string
        published_time:
          description: Time since publication
          type: string
        thumbnail:
          description: Item thumbnail URL
          type: string
        title:
          description: Item title
          type: string
        views:
          description: Number of views
          type: integer
      type: object
    ResponseFc5Af1Fcba22_Short:
      properties:
        duration:
          description: Short duration
          type: string
        id:
          description: Short video ID
          type: string
        link:
          description: Link to the short
          type: string
        position:
          description: Position within shorts section
          type: integer
        thumbnail:
          description: Short thumbnail URL
          type: string
        title:
          description: Short title
          type: string
        views:
          description: Number of views
          type: integer
      type: object
    ResponseFc5Af1Fcba22_VideoChannel:
      properties:
        id:
          description: Channel ID
          type: string
        is_verified:
          description: Whether the channel is verified
          type: boolean
        link:
          description: Link to the channel
          type: string
        thumbnail:
          description: Channel thumbnail URL
          type: string
        title:
          description: Channel name
          type: string
      type: object
    ResponseFc5Af1Fcba22_KeyMoment:
      properties:
        start_seconds:
          description: Start time of the moment in seconds
          type: integer
        thumbnail:
          description: Key moment thumbnail URL
          type: string
        title:
          description: Key moment title
          type: string
      type: object
    ResponseFc5Af1Fcba22_FeaturedVideoChannel:
      properties:
        id:
          description: Channel ID
          type: string
        link:
          description: Link to the channel
          type: string
        title:
          description: Channel name
          type: string
      type: object
    ResponseFc5Af1Fcba22_PostChannel:
      properties:
        id:
          description: Channel ID
          type: string
        is_verified:
          description: Whether the channel is verified
          type: boolean
        link:
          description: Link to the channel
          type: string
        thumbnail:
          description: Channel thumbnail URL
          type: string
        title:
          description: Channel name
          type: string
      type: object
    ResponseFc5Af1Fcba22_SectionChannel:
      properties:
        id:
          description: Channel ID
          type: string
        link:
          description: Link to the channel
          type: string
        title:
          description: Channel name
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

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