> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keyapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get video information

> Get detailed information about a YouTube video, returning the full raw data (including playerResponse and initialData).

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">3 credits</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">per request</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`I want to make an API call to https://api.keyapi.ai/v1/youtube/get_video_info.

Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.

Here are the details:

Endpoint: GET https://api.keyapi.ai/v1/youtube/get_video_info

Description: Get detailed information about a YouTube video, returning the full raw data (including playerResponse and initialData).

Required Headers:
--header 'Authorization: Bearer <YOUR_API_KEY>'

Parameters:
- video_id (Required): Video ID
How to obtain: extract from the video URL, e.g., https://www.youtube.com/watch?v=oaSNBz4qMQY, the video_id is oaSNBz4qMQY. Example: oaSNBz4qMQY
- language_code (Optional): Set language preference
Options: "zh-CN", "en-US", "ja-JP", "ko-KR", etc.. Example: zh-CN
- need_format (Optional): Whether to clean and format the data. Example: true

Example Response:
{
"code": 0,
"message": "success",
"data": {
"video_id": "oaSNBz4qMQY",
"title": "",
"description": "Today, we've moved into a sorcerer village! This village hides a dark secret... a terrible monster sealed away in a cursed painting! We can't let it get loose, we have to find a way to take it down and save the village!

We hope you enjoy our videos! Have a great day! 

Maizen Merchandise ► https://shop-maizen.myspreadshop.com/",
"length_seconds": "",
"keywords": null,
"thumbnails": [],
"author": "Maizen",
"channel_id": "UCJHBJ7F-nAIlMGolm0Hu4vg",
"channel_handle": "@maizenofficial",
"channel_url": "https://www.youtube.com/channel/UCJHBJ7F-nAIlMGolm0Hu4vg",
"channel_avatar_thumbnails": [
  {
    "url": "https://yt3.ggpht.com/jtaYDxDtMB2WZp9dOXCCcX4xuaJNkl5iEZPlzjMLuiVqkyUM851nBUArs0wDSBGIWvUfny2uYw=s48-c-k-c0x00ffffff-no-rj",
    "width": 48,
    "height": 48
  },
  {
    "url": "https://yt3.ggpht.com/jtaYDxDtMB2WZp9dOXCCcX4xuaJNkl5iEZPlzjMLuiVqkyUM851nBUArs0wDSBGIWvUfny2uYw=s88-c-k-c0x00ffffff-no-rj",
    "width": 88,
    "height": 88
  },
  {
    "url": "https://yt3.ggpht.com/jtaYDxDtMB2WZp9dOXCCcX4xuaJNkl5iEZPlzjMLuiVqkyUM851nBUArs0wDSBGIWvUfny2uYw=s176-c-k-c0x00ffffff-no-rj",
    "width": 176,
    "height": 176
  }
],
"subscriber_count_text": "1610万位订阅者",
"is_verified": true,
"badge_tooltip": "已验证",
"view_count": "",
"view_count_text": "
... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/youtube.openapi.json GET /v1/youtube/get_video_info
openapi: 3.0.1
info:
  title: YouTube API english document
  description: >-
    The english reference documentation of the YouTube API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security: []
tags: []
paths:
  /v1/youtube/get_video_info:
    get:
      tags: []
      summary: Get video information
      description: >-
        Get detailed information about a YouTube video, returning the full raw
        data (including playerResponse and initialData).
      parameters:
        - name: video_id
          in: query
          description: >-
            Video ID

            How to obtain: extract from the video URL, e.g.,
            https://www.youtube.com/watch?v=oaSNBz4qMQY, the video_id is
            oaSNBz4qMQY
          required: true
          example: oaSNBz4qMQY
          schema:
            type: string
            example: oaSNBz4qMQY
        - name: language_code
          in: query
          description: |-
            Set language preference
            Options: "zh-CN", "en-US", "ja-JP", "ko-KR", etc.
          required: false
          example: zh-CN
          schema:
            type: string
            default: zh-CN
        - name: need_format
          in: query
          description: Whether to clean and format the data
          required: false
          example: 'true'
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  video_id: oaSNBz4qMQY
                  title: ''
                  description: >-
                    Today, we've moved into a sorcerer village! This village
                    hides a dark secret... a terrible monster sealed away in a
                    cursed painting! We can't let it get loose, we have to find
                    a way to take it down and save the village!


                    We hope you enjoy our videos! Have a great day! 


                    Maizen Merchandise ► https://shop-maizen.myspreadshop.com/
                  length_seconds: ''
                  keywords: null
                  thumbnails: []
                  author: Maizen
                  channel_id: UCJHBJ7F-nAIlMGolm0Hu4vg
                  channel_handle: '@maizenofficial'
                  channel_url: https://www.youtube.com/channel/UCJHBJ7F-nAIlMGolm0Hu4vg
                  channel_avatar_thumbnails:
                    - url: >-
                        https://yt3.ggpht.com/jtaYDxDtMB2WZp9dOXCCcX4xuaJNkl5iEZPlzjMLuiVqkyUM851nBUArs0wDSBGIWvUfny2uYw=s48-c-k-c0x00ffffff-no-rj
                      width: 48
                      height: 48
                    - url: >-
                        https://yt3.ggpht.com/jtaYDxDtMB2WZp9dOXCCcX4xuaJNkl5iEZPlzjMLuiVqkyUM851nBUArs0wDSBGIWvUfny2uYw=s88-c-k-c0x00ffffff-no-rj
                      width: 88
                      height: 88
                    - url: >-
                        https://yt3.ggpht.com/jtaYDxDtMB2WZp9dOXCCcX4xuaJNkl5iEZPlzjMLuiVqkyUM851nBUArs0wDSBGIWvUfny2uYw=s176-c-k-c0x00ffffff-no-rj
                      width: 176
                      height: 176
                  subscriber_count_text: 1610万位订阅者
                  is_verified: true
                  badge_tooltip: 已验证
                  view_count: ''
                  view_count_text: 1,666,377次观看
                  short_view_count: 166万次观看
                  like_count: ''
                  like_count_text: 1万
                  comment_count: '957'
                  publish_date: ''
                  upload_date: ''
                  date_text: 2026年1月9日
                  relative_date_text: 1个月前
                  category: ''
                  super_title: null
                  is_live_content: false
                  is_private: false
                  is_unlisted: false
                  is_family_safe: null
                  is_shorts_eligible: null
                  is_crawlable: null
                  allow_ratings: null
                  available_countries: null
                  captions: null
                  chapters: null
                  endscreen: null
                  merchandise:
                    - title: Mikey Plush
                      price: US$34.99
                      vendor_name: Juniper
                      thumbnails:
                        - url: >-
                            https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcSx2_7BAHeg38-wwtroU_fBkxRHIUOd2gqzSU5uuA9ImeKbIG8HK9fqnBXtcZ8MNLUB810zV5c
                          width: 128
                          height: 128
                        - url: >-
                            https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcRO_4gUShjDmyjUFTg84VZVExeSuptTefXMzm9RVFZQYXmqkC0IDLD7Ng_hBFhsIkXG7Lg3WwmY
                          width: 256
                          height: 256
                        - url: >-
                            https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcTrZMSLEwOZTT-ZrIpixYD3V5_YWbACztfiZKjFxzFKmJBL5GnA6A3yhmvf4Z3O-smnfp7oJ1d5
                          width: 512
                          height: 512
                      buy_url: >-
                        https://maizen.hellojuniper.com/p/7925971943615?srsltid=AfmBOooBhpu4Z073e6HGy3D-MFqpLIS242qPB-PwEA_KjOOTq7cBYr-jWZI&utm_content=YT3-Q921kxaDB_lY9syZ3s5W_IgzybbWdtKa5cfjIIY8BPb0JQpp3683rrXLtS02NU_7RuKTEbndZ8mlAOwn86I-bgnW&utm_term=UCJHBJ7F-nAIlMGolm0Hu4vg&utm_medium=product_shelf&utm_source=youtube
                    - title: JJ Plush
                      price: US$27.99
                      vendor_name: Juniper
                      thumbnails:
                        - url: >-
                            https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcRmxAQQ0n_PUFHULkJ4eH77c1d8tdgQ_Eti8OWKlfF0j2C-op-3QmLubwVxuGAFCHAOZ6mkohWt
                          width: 128
                          height: 128
                        - url: >-
                            https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcQX9GC3oeG6uYAppZ9LR9KjZMqRnoW32uMXKKSTre1xQOfg-tmDNxTzQuoAZYc7zt8Dqtonh8vS
                          width: 256
                          height: 256
                        - url: >-
                            https://encrypted-tbn3.gstatic.com/shopping?q=tbn:ANd9GcR4sThe7hhuWeN9BOJgj0bh-WOOFIqJFW-PHEEx3sxc3YjvePJb33cqK89wDDX3AXMvpI8CfjdC
                          width: 512
                          height: 512
                      buy_url: >-
                        https://maizen.hellojuniper.com/p/7925971288255?srsltid=AfmBOoqvx4_CIYpwC-8Ge5WVySiwVTsCDEek-SYugdTp-2QXe7js522UoC0&utm_content=YT3-cW5jNvizbEWWG-uoGKPFqAQk6oGm-Rd-bKWdgcyGAuut6Fnjza6h0_iChM8HdeYoODWilCpnEBNEFikIUXzmdG4t&utm_term=UCJHBJ7F-nAIlMGolm0Hu4vg&utm_medium=product_shelf&utm_source=youtube
                  storyboard_spec: null
                  embed_url: ''
                  video_url: https://www.youtube.com/watch?v=oaSNBz4qMQY
                  owner_profile_url: ''
                  playability_status: LOGIN_REQUIRED
                requestId: 9a121156-46b4-4fff-9bc1-0dda7589139b
          headers: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  data: null
                  message: Internal server error
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/youtube/get_video_info?video_id=oaSNBz4qMQY&language_code=zh-CN&need_format=true' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/youtube/get_video_info',
                params={"video_id": "oaSNBz4qMQY", "language_code": "zh-CN", "need_format": "true"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"video_id": "oaSNBz4qMQY",
            "language_code": "zh-CN", "need_format": "true"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/youtube/get_video_info?${params}`, {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````