# 获取频道视频 /Get channel videos

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/youtube/web_v2/get_channel_videos:
    get:
      summary: 获取频道视频 /Get channel videos
      deprecated: false
      description: >-
        # [中文]

        ### 用途:

        - 获取YouTube频道的视频列表

        - 支持分页获取，可通过 continuation_token 获取更多视频


        ### 参数详解:


        #### 📌 必选参数:

        **channel_id** (string)

        - **作用**: 频道ID

        - **获取方式**:
          - 从频道URL中提取，例如 `https://www.youtube.com/channel/UCJHBJ7F-nAIlMGolm0Hu4vg`
          - 或从 `@用户名` 格式的URL中，先访问频道页面获取真实的频道ID
        - **示例**: `"UCJHBJ7F-nAIlMGolm0Hu4vg"`


        #### ⚙️ 可选参数:

        **language_code** (string, 可选)

        - **作用**: 设置语言偏好

        - **默认值**: `"zh-CN"`

        - **可用值**: `"zh-CN"`, `"en-US"`, `"ja-JP"`, `"ko-KR"` 等


        **country_code** (string, 可选)

        - **作用**: 设置地区代码

        - **默认值**: `"US"`

        - **可用值**: `"US"`, `"JP"`, `"GB"` 等


        **continuation_token** (string, 可选)

        - **作用**: 分页token，用于获取下一页视频

        - **获取方式**: 从上一次请求的响应中提取

        - **首次请求**: 不传此参数或传 `null`


        **need_format** (boolean, 可选)

        - **作用**: 是否返回清洗后的精简数据

        - **默认值**: `true`

        - **可用值**:
          - `false` - 返回原始完整数据
          - `true` - 返回清洗后的精简数据（推荐，默认）

        ### 返回数据结构 (need_format=true):

        ```json

        {
          "channel": {
            "id": "UCJHBJ7F-nAIlMGolm0Hu4vg",
            "name": "Maizen",
            "description": "Thank you very much for watching our videos...",
            "handle_url": "http://www.youtube.com/@maizenofficial",
            "avatar": "https://yt3.googleusercontent.com/...=s900-...",
            "url": "https://www.youtube.com/channel/UCJHBJ7F-nAIlMGolm0Hu4vg",
            "rss_url": "https://www.youtube.com/feeds/videos.xml?channel_id=...",
            "keywords": "Minecraft",
            "is_family_safe": true,
            "is_verified": true
          },
          "videos": [
            {
              "video_id": "zd3yCa1bJCM",
              "title": "Minecraft: DREAM! - Asleep Custom Map",
              "thumbnail": "https://i.ytimg.com/vi/zd3yCa1bJCM/hqdefault.jpg",
              "thumbnails": [
                {"url": "...", "width": 168, "height": 94},
                {"url": "...", "width": 336, "height": 188}
              ],
              "moving_thumbnail": "https://i.ytimg.com/an_webp/zd3yCa1bJCM/mqdefault_6s.webp?...",
              "duration": "16:57",
              "duration_accessibility": "16分钟57秒钟",
              "view_count": "343,369次观看",
              "short_view_count": "34万次观看",
              "published_time": "18小时前",
              "description": "",
              "is_live": false,
              "is_verified": true,
              "url": "https://www.youtube.com/watch?v=zd3yCa1bJCM",
              "playback_url": "https://rr5---sn-ogueln67.googlevideo.com/initplayback?..."
            }
          ],
          "continuation_token": "下一页token"
        }

        ```


        ### 清洗后的字段说明:


        **`channel` (object, 频道级 metadata，整页 listing 共用):**


        ⚠️ **仅首次请求（未传 `continuation_token`）返回此字段**。分页请求的响应里 YouTube 不再下发频道级
        metadata，此时返回里**不包含** `channel` 字段，请缓存首页结果作为权威值。同理
        `videos[].is_verified` 在分页响应里恒为 `false`（不可信）。


        - `id`: 频道ID（同请求参数 channel_id）

        - `name`: 频道名称

        - `description`: 频道简介（多行文本，常含联系方式 / 社媒链接 / 频道介绍）

        - `handle_url`: 频道 handle URL（如
        `http://www.youtube.com/@maizenofficial`）

        - `avatar`: 频道头像 URL（最大尺寸，最大 900×900）

        - `url`: 频道主页 URL

        - `rss_url`: 频道 RSS 订阅链接

        - `keywords`: 频道关键词

        - `is_family_safe`: 是否适合家庭观看

        - `is_verified`: 频道是否已通过 YouTube 蓝勾认证


        **`videos[]` (列表，每条视频):**

        - `video_id`: 视频ID

        - `title`: 视频标题

        - `thumbnail`: 最高清晰度缩略图URL

        - `thumbnails`: 所有分辨率的缩略图列表

        - `moving_thumbnail`: 动态缩略图URL（webp格式，鼠标悬停预览）

        - `duration`: 视频时长（如"16:57"）

        - `duration_accessibility`: 时长无障碍文本（如"16分钟57秒钟"）

        - `view_count`: 完整观看次数（如"343,369次观看"）

        - `short_view_count`: 简短观看次数（如"34万次观看"。注：lockup 格式下与 `view_count`
        同值，仅保留以兼容旧调用方）

        - `published_time`: 发布时间（如"18小时前"）

        - `description`: ⚠️ YouTube 自 2026 起的频道视频列表（lockup
        格式）已不再下发视频描述片段，此字段恒为空字符串 `""`；如需频道整体简介请使用顶层
        `channel.description`，单条视频描述请单独调用视频详情接口

        - `is_live`: 是否为直播

        - `is_verified`: 频道是否已认证（频道页下与顶层 `channel.is_verified` 同值）

        - `url`: 视频播放页URL

        - `playback_url`: 视频播放初始化URL（googlevideo.com）

        - `continuation_token`: 下一页的分页token


        # [English]

        ### Purpose:

        - Get YouTube channel video list

        - Supports pagination via continuation_token


        ### Parameters:


        #### 📌 Required:

        **channel_id** (string)

        - **Purpose**: Channel ID

        - **How to get**:
          - Extract from channel URL, e.g., `https://www.youtube.com/channel/UCJHBJ7F-nAIlMGolm0Hu4vg`
          - Or visit the channel page to get the real channel ID from `@username` format URLs
        - **Example**: `"UCJHBJ7F-nAIlMGolm0Hu4vg"`


        #### ⚙️ Optional:

        **language_code** (string, optional)

        - **Purpose**: Set language preference

        - **Default**: `"zh-CN"`

        - **Values**: `"zh-CN"`, `"en-US"`, `"ja-JP"`, `"ko-KR"`, etc.


        **country_code** (string, optional)

        - **Purpose**: Set region code

        - **Default**: `"US"`

        - **Values**: `"US"`, `"JP"`, `"GB"`, etc.


        **continuation_token** (string, optional)

        - **Purpose**: Pagination token for next page

        - **How to get**: Extract from previous response

        - **First request**: Omit or set to `null`


        **need_format** (boolean, optional)

        - **Purpose**: Whether to return cleaned simplified data

        - **Default**: `true`

        - **Values**:
          - `false` - Return raw complete data
          - `true` - Return cleaned simplified data (recommended, default)

        ### Response Structure (need_format=true):

        ```json

        {
          "channel": {
            "id": "UCJHBJ7F-nAIlMGolm0Hu4vg",
            "name": "Maizen",
            "description": "Thank you very much for watching our videos...",
            "handle_url": "http://www.youtube.com/@maizenofficial",
            "avatar": "https://yt3.googleusercontent.com/...=s900-...",
            "url": "https://www.youtube.com/channel/UCJHBJ7F-nAIlMGolm0Hu4vg",
            "rss_url": "https://www.youtube.com/feeds/videos.xml?channel_id=...",
            "keywords": "Minecraft",
            "is_family_safe": true,
            "is_verified": true
          },
          "videos": [
            {
              "video_id": "zd3yCa1bJCM",
              "title": "Minecraft: DREAM! - Asleep Custom Map",
              "thumbnail": "https://i.ytimg.com/vi/zd3yCa1bJCM/hqdefault.jpg",
              "thumbnails": [
                {"url": "...", "width": 168, "height": 94},
                {"url": "...", "width": 336, "height": 188}
              ],
              "moving_thumbnail": "https://i.ytimg.com/an_webp/zd3yCa1bJCM/mqdefault_6s.webp?...",
              "duration": "16:57",
              "duration_accessibility": "16 minutes, 57 seconds",
              "view_count": "343,369 views",
              "short_view_count": "343K views",
              "published_time": "18 hours ago",
              "description": "",
              "is_live": false,
              "is_verified": true,
              "url": "https://www.youtube.com/watch?v=zd3yCa1bJCM",
              "playback_url": "https://rr5---sn-ogueln67.googlevideo.com/initplayback?..."
            }
          ],
          "continuation_token": "next page token"
        }

        ```


        ### Cleaned Data Field Descriptions:


        **`channel` (object, channel-level metadata, shared across the
        listing):**


        ⚠️ **Only returned on the first request (when `continuation_token` is
        not provided).** Paginated responses do not include channel-level
        metadata from YouTube, so the `channel` field is **omitted** — cache the
        first-page value as the source of truth. Likewise,
        `videos[].is_verified` is always `false` on paginated responses
        (unreliable).


        - `id`: Channel ID (same as the `channel_id` query param)

        - `name`: Channel name

        - `description`: Channel bio (multi-line text, often contains contact
        info / social links / channel introduction)

        - `handle_url`: Channel handle URL (e.g.,
        `http://www.youtube.com/@maizenofficial`)

        - `avatar`: Channel avatar URL (largest size, up to 900×900)

        - `url`: Channel home URL

        - `rss_url`: Channel RSS feed URL

        - `keywords`: Channel keywords

        - `is_family_safe`: Whether the channel is family-safe

        - `is_verified`: Whether the channel has a YouTube verified (blue check)
        badge


        **`videos[]` (list, per video):**

        - `video_id`: Video ID

        - `title`: Video title

        - `thumbnail`: Highest resolution thumbnail URL

        - `thumbnails`: List of all resolution thumbnails

        - `moving_thumbnail`: Moving thumbnail URL (webp format, hover preview)

        - `duration`: Video duration (e.g., "16:57")

        - `duration_accessibility`: Duration accessibility text (e.g., "16
        minutes, 57 seconds")

        - `view_count`: Full view count (e.g., "343,369 views")

        - `short_view_count`: Short view count (e.g., "343K views". Note: under
        the lockup format this is identical to `view_count`; kept only for
        backward compatibility)

        - `published_time`: Published time (e.g., "18 hours ago")

        - `description`: ⚠️ Since 2026, YouTube's channel video listings (lockup
        format) no longer include per-video description snippets. This field is
        always `""`. For the channel-wide bio use the top-level
        `channel.description`; for per-video descriptions call the video detail
        endpoint.

        - `is_live`: Whether it's a live stream

        - `is_verified`: Whether the channel is verified (same as top-level
        `channel.is_verified` in the channel-videos context)

        - `url`: Video playback page URL

        - `playback_url`: Video playback initialization URL (googlevideo.com)

        - `continuation_token`: Pagination token for next page


        # [示例/Examples]

        ## 获取频道首页视频 / Get first page of channel videos

        GET /youtube_web/get_channel_videos?channel_id=UCJHBJ7F-nAIlMGolm0Hu4vg


        ## 获取清洗后的数据（推荐）/ Get cleaned data (recommended)

        GET
        /youtube_web/get_channel_videos?channel_id=UCJHBJ7F-nAIlMGolm0Hu4vg&need_format=true


        ## 获取下一页 / Get next page

        GET
        /youtube_web/get_channel_videos?channel_id=UCJHBJ7F-nAIlMGolm0Hu4vg&continuation_token=xxxxx&need_format=true
      operationId: get_channel_videos_api_v1_youtube_web_v2_get_channel_videos_get
      tags:
        - YouTube-Web-V2-API
        - YouTube-Web-V2-API
      parameters:
        - name: channel_id
          in: query
          description: 频道ID/Channel ID
          required: true
          example: UCJHBJ7F-nAIlMGolm0Hu4vg
          schema:
            type: string
            description: 频道ID/Channel ID
            title: Channel Id
        - name: language_code
          in: query
          description: 语言代码（如zh-CN, en-US等）/Language code
          required: false
          example: zh-CN
          schema:
            type: string
            description: 语言代码（如zh-CN, en-US等）/Language code
            default: zh-CN
            title: Language Code
        - name: country_code
          in: query
          description: 国家代码（如US, JP等）/Country code
          required: false
          example: US
          schema:
            type: string
            description: 国家代码（如US, JP等）/Country code
            default: US
            title: Country Code
        - name: continuation_token
          in: query
          description: 分页token，用于获取下一页/Pagination token for next page
          required: false
          schema:
            type: string
            description: 分页token，用于获取下一页/Pagination token for next page
            title: Continuation Token
        - name: need_format
          in: query
          description: 是否需要清洗数据，提取关键内容，移除冗余数据/Whether to clean and format the data
          required: false
          schema:
            type: boolean
            description: 是否需要清洗数据，提取关键内容，移除冗余数据/Whether to clean and format the data
            default: true
            title: Need Format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseModel'
          headers: {}
          x-apifox-name: OK
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          headers: {}
          x-apifox-name: Unprocessable Entity
      security:
        - HTTPBearer: []
          x-apifox:
            schemeGroups:
              - id: SaIrrDd6fVWrWIqzErar5
                schemeIds:
                  - HTTPBearer
            required: true
            use:
              id: SaIrrDd6fVWrWIqzErar5
            scopes:
              SaIrrDd6fVWrWIqzErar5:
                HTTPBearer: []
      x-apifox-folder: YouTube-Web-V2-API
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/4705614/apis/api-419083089-run
components:
  schemas:
    ResponseModel:
      properties:
        code:
          type: integer
          title: Code
          description: HTTP status code | HTTP状态码
          default: 200
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Unique request identifier | 唯一请求标识符
        message:
          type: string
          title: Message
          description: Response message (EN-US) | 响应消息 (English)
          default: Request successful. This request will incur a charge.
        message_zh:
          type: string
          title: Message Zh
          description: Response message (ZH-CN) | 响应消息 (中文)
          default: 请求成功，本次请求将被计费。
        support:
          type: string
          title: Support
          description: Support message | 支持消息
          default: 'Discord: https://discord.gg/aMEAS8Xsvz'
        time:
          type: string
          title: Time
          description: The time the response was generated | 生成响应的时间
        time_stamp:
          type: integer
          title: Time Stamp
          description: The timestamp the response was generated | 生成响应的时间戳
        time_zone:
          type: string
          title: Time Zone
          description: The timezone of the response time | 响应时间的时区
          default: America/Los_Angeles
        docs:
          anyOf:
            - type: string
            - type: 'null'
          title: Docs
          description: >-
            Link to the API Swagger documentation for this endpoint | 此端点的 API
            Swagger 文档链接
        cache_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Cache Message
          description: Cache message (EN-US) | 缓存消息 (English)
          default: >-
            This response is cached and accessible via the URL below for 24
            hours at no extra cost. The cache is for request tracing only — it
            doesn't affect the API's data freshness and won't be returned
            through the API again.
        cache_message_zh:
          anyOf:
            - type: string
            - type: 'null'
          title: Cache Message Zh
          description: Cache message (ZH-CN) | 缓存消息 (中文)
          default: >-
            本次响应已缓存，可通过下方 URL 直接查看，有效期 24
            小时，访问缓存链接无额外费用。缓存仅用于请求溯源，不影响接口数据的时效性，也不会再次通过接口返回。
        cache_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Cache Url
          description: The URL to access the cached result | 访问缓存结果的 URL
        router:
          type: string
          title: Router
          description: The endpoint that generated this response | 生成此响应的端点
          default: ''
        params:
          type: string
        data:
          anyOf:
            - type: string
            - type: 'null'
          title: Data
          description: The response data | 响应数据
      type: object
      title: ResponseModel
      x-apifox-orders:
        - code
        - request_id
        - message
        - message_zh
        - support
        - time
        - time_stamp
        - time_zone
        - docs
        - cache_message
        - cache_message_zh
        - cache_url
        - router
        - params
        - data
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      x-apifox-orders:
        - detail
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
      x-apifox-orders:
        - loc
        - msg
        - type
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    HTTPBearer:
      type: bearer
      description: >
        ----

        #### API Token Introduction:

        ##### Method 1: Use API Token in the Request Header (Recommended)

        - **Header**: `Authorization`

        - **Format**: `Bearer {token}`

        - **Example**: `{"Authorization": "Bearer your_token"}`

        - **Swagger UI**: Click on the `Authorize` button in the upper right
        corner of the page to enter the API token directly without the `Bearer`
        keyword.


        ##### Method 2: Use API Token in the Cookie (Not Recommended, Use Only
        When Method 1 is Unavailable)

        - **Cookie**: `Authorization`

        - **Format**: `Bearer {token}`

        - **Example**: `Authorization=Bearer your_token`


        #### Get API Token:

        1. Register and log in to your account on the TikHub website.

        2. Go to the user center, click on the API token menu, and create an API
        token.

        3. Copy and use the API token in the request header.

        4. Keep your API token confidential and use it only in the request
        header.


        ----


        #### API令牌简介:

        ##### 方法一：在请求头中使用API令牌（推荐）

        - **请求头**: `Authorization`

        - **格式**: `Bearer {token}`

        - **示例**: `{"Authorization": "Bearer your_token"}`

        - **Swagger UI**: 点击页面右上角的`Authorize`按钮，直接输入API令牌，不需要`Bearer`关键字。


        ##### 方法二：在Cookie中使用API令牌（不推荐，仅在无法使用方法一时使用）

        - **Cookie**: `Authorization`

        - **格式**: `Bearer {token}`

        - **示例**: `Authorization=Bearer your_token`


        #### 获取API令牌:

        1. 在TikHub网站注册并登录账户。

        2. 进入用户中心，点击API令牌菜单，创建API令牌。

        3. 复制并在请求头中使用API令牌。

        4. 保密您的API令牌，仅在请求头中使用。
      scheme: bearer
servers:
  - url: https://api.tikhub.io
    description: Production Environment
security: []

```
