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

# 获取帖子详情

> 获取YouTube帖子（社区帖子）的详细信息

<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">2 credit</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">每次请求</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">🤖 让 AI 帮你写调用代码</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">点击按钮复制一段结构化提示词，可直接交给 ChatGPT、Claude 或其他 AI 助手生成接口调用代码。</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("我想调用 KeyAPI 接口：GET https://api.keyapi.ai/v1/youtube/get_post_detail\n\n请帮我编写调用代码，并包含必要的错误处理、参数校验和响应处理逻辑。\n\n接口信息：\n\nEndpoint: GET https://api.keyapi.ai/v1/youtube/get_post_detail\n\nDescription: 获取YouTube帖子（社区帖子）的详细信息\n\nRequired Headers:\n--header 'Authorization: Bearer <YOUR_API_KEY>'\n\nParameters:\n- post_id (Required): 帖子ID，获取方式: 从帖子URL中提取，例如 https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy 中`UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy`. Example: UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy\n- language_code (Optional): 语言代码. Example: zh-CN\n- country_code (Optional): 国家代码. Example: US\n\nExample Response:\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"data\": {\n    \"post\": {\n      \"post_id\": \"UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy\",\n      \"post_url\": \"https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy\",\n      \"author_name\": \"YouTube Creators\",\n      \"author_channel_id\": \"UCkRfArvrzheW2E7b6SVT7vQ\",\n      \"author_url\": \"/@youtubecreators\",\n      \"author_thumbnails\": [\n        {\n          \"url\": \"//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s32-c-k-c0x00ffffff-no-rj-mo\",\n          \"width\": 32,\n          \"height\": 32\n        },\n        {\n          \"url\": \"//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s48-c-k-c0x00ffffff-no-rj-mo\",\n          \"width\": 48,\n          \"height\": 48\n        },\n        {\n          \"url\": \"//yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s76-c-k-c0x00ffffff-no-rj-mo\",\n          \"width\": 76,\n          \"height\": 76\n        }\n      ],\n      \"content_text\": \"🎉 Posts are rolling out to more creators than ever before!! 🎉 \\n\\nWe're so excited to announce that we’re starting to roll out posts access to all eligible channels TODAY and over the coming weeks. While posts will become available to most channels on YouTube, there are some cases where the feature will continue to be turned off as it has been historically:\\n\\n✅ Channels that are set as Made for Kids\\n✅ Folks who access YouTube with a supervised account\\n✅ More details can be found in our Help Center: https://yt.be/help/postsGA \\n\\nOnce you have access, get the post party on your channel started by: \\n\\n1️⃣ Tapping the “+” button in the YouTube mobile app or the 🎥 ”Create” > 📝 “Create post” button on desktop to draft a post\\n2️⃣ Play around with different format options - we have polls, quizzes, GIFs, text, images, and video posts!\\n3️⃣ Share a post with your audience and watch the connection between you and your viewers deepen\\n\\nThis update will roll out over the next few weeks. Happy posting! ⭐\",\n      \"published_time\": \"2年前（修改过）\",\n      \"vote_count\": \"4361\",\n      \"comment_count\": \"\",\n      \"attachment\": {\n        \"type\": \"image\",\n        \"images\": [\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s288-rw-nd-v1\",\n            \"width\": 288,\n            \"height\": 288\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s400-rw-nd-v1\",\n            \"width\": 400,\n            \"height\": 400\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s512-rw-nd-v1\",\n            \"width\": 512,\n            \"height\": 512\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s640-rw-nd-v1\",\n            \"width\": 640,\n            \"height\": 640\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s800-rw-nd-v1\",\n            \"width\": 800,\n            \"height\": 800\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s1024-rw-nd-v1\",\n            \"width\": 1024,\n            \"height\": 1024\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s1600-rw-nd-v1\",\n            \"width\": 1600,\n            \"height\": 1600\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s2048-rw-nd-v1\",\n            \"width\": 2048,\n            \"height\": 2048\n          },\n          {\n            \"url\": \"https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s2250-rw-nd-v1\",\n            \"width\": 2250,\n            \"height\": 2250\n          }\n        ]\n      }\n    },\n    \"channel_metadata\": {\n      \"title\": \"YouTube Creators\",\n      \"description\": \"\",\n      \"channel_url\": \"\",\n      \"channel_id\": \"UCkRfArvrzheW2E7b6SVT7vQ\",\n      \"avatar_url\": \"\"\n    },\n    \"comments_continuation_token\": \"4qmFsgKzAhIoRkVjb21tZW50X3Bvc3RfZGV0YWlsX3BhZ2Vfd2ViX3RvcF9sZXZlbBqGAkVnVndiM04wYzZvRFd5SkhNQURZQVFIcUFTUlZaMnQ0YVVOVFVtWkVObWMzVTFCc1YwZFFSR0V6ZG1KUU4yRkpjM2wwV0ZKcmRubnlBUmhWUTJ0U1prRnlkbko2YUdWWE1rVTNZalpUVmxRM2RsRkNFR052YlcxbGJuUnpMWE5sWTNScGIyN0NBMW9TR0ZWRGExSm1RWEoyY25wb1pWY3lSVGRpTmxOV1ZEZDJVUm9rVldkcmVHbERVMUptUkRabk4xTlFiRmRIVUVSaE0zWmlVRGRoU1hONWRGaFNhM1o1V2hoVlEydFNaa0Z5ZG5KNmFHVlhNa1UzWWpaVFZsUTNkbEUlM0Q%3D\"\n  },\n  \"requestId\": \"4e0db876-c5e3-4d63-9928-803683a9092d\"\n}\n\n请根据以上信息给出可直接运行的示例代码。")}>
      <span>✨</span>
      <span>复制给 AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml zh/youtube.zh.openapi.json GET /v1/youtube/get_post_detail
openapi: 3.0.1
info:
  title: YouTube API 中文文档
  description: YouTube API 的中文参考文档，包含接口用途、参数说明、响应状态和示例结构。
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security: []
tags: []
paths:
  /v1/youtube/get_post_detail:
    get:
      tags: []
      summary: 获取帖子详情/Get post detail
      description: 获取YouTube帖子（社区帖子）的详细信息
      parameters:
        - name: post_id
          in: query
          description: >-
            帖子ID，获取方式: 从帖子URL中提取，例如
            https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy
            中`UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy`
          required: true
          example: UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy
          schema:
            type: string
            example: UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy
        - name: language_code
          in: query
          description: 语言代码
          required: false
          example: zh-CN
          schema:
            type: string
            default: zh-CN
        - name: country_code
          in: query
          description: 国家代码
          required: false
          example: US
          schema:
            type: string
            default: US
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  post:
                    post_id: UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy
                    post_url: >-
                      https://www.youtube.com/post/UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy
                    author_name: YouTube Creators
                    author_channel_id: UCkRfArvrzheW2E7b6SVT7vQ
                    author_url: /@youtubecreators
                    author_thumbnails:
                      - url: >-
                          //yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s32-c-k-c0x00ffffff-no-rj-mo
                        width: 32
                        height: 32
                      - url: >-
                          //yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s48-c-k-c0x00ffffff-no-rj-mo
                        width: 48
                        height: 48
                      - url: >-
                          //yt3.googleusercontent.com/LZeUOuOM8lzINkYAKi1X3pCQz1xsSD_EndPUR1vOGesaGavUtyM_-bCUq7Gld-LPX_R7uieWsA=s76-c-k-c0x00ffffff-no-rj-mo
                        width: 76
                        height: 76
                    content_text: >-
                      🎉 Posts are rolling out to more creators than ever
                      before!! 🎉 


                      We're so excited to announce that we’re starting to roll
                      out posts access to all eligible channels TODAY and over
                      the coming weeks. While posts will become available to
                      most channels on YouTube, there are some cases where the
                      feature will continue to be turned off as it has been
                      historically:


                      ✅ Channels that are set as Made for Kids

                      ✅ Folks who access YouTube with a supervised account

                      ✅ More details can be found in our Help Center:
                      https://yt.be/help/postsGA 


                      Once you have access, get the post party on your channel
                      started by: 


                      1️⃣ Tapping the “+” button in the YouTube mobile app or
                      the 🎥 ”Create” > 📝 “Create post” button on desktop to
                      draft a post

                      2️⃣ Play around with different format options - we have
                      polls, quizzes, GIFs, text, images, and video posts!

                      3️⃣ Share a post with your audience and watch the
                      connection between you and your viewers deepen


                      This update will roll out over the next few weeks. Happy
                      posting! ⭐
                    published_time: 2年前（修改过）
                    vote_count: '4361'
                    comment_count: ''
                    attachment:
                      type: image
                      images:
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s288-rw-nd-v1
                          width: 288
                          height: 288
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s400-rw-nd-v1
                          width: 400
                          height: 400
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s512-rw-nd-v1
                          width: 512
                          height: 512
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s640-rw-nd-v1
                          width: 640
                          height: 640
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s800-rw-nd-v1
                          width: 800
                          height: 800
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s1024-rw-nd-v1
                          width: 1024
                          height: 1024
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s1600-rw-nd-v1
                          width: 1600
                          height: 1600
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s2048-rw-nd-v1
                          width: 2048
                          height: 2048
                        - url: >-
                            https://yt3.ggpht.com/wbxSQ9KLMZWcSCw2Q78wZ1YfvUb9zpWRs6QYRSHt4n277DENaKkLxd9WYZeU4NGCplLEe4E1Ty1TMQ=s2250-rw-nd-v1
                          width: 2250
                          height: 2250
                  channel_metadata:
                    title: YouTube Creators
                    description: ''
                    channel_url: ''
                    channel_id: UCkRfArvrzheW2E7b6SVT7vQ
                    avatar_url: ''
                  comments_continuation_token: >-
                    4qmFsgKzAhIoRkVjb21tZW50X3Bvc3RfZGV0YWlsX3BhZ2Vfd2ViX3RvcF9sZXZlbBqGAkVnVndiM04wYzZvRFd5SkhNQURZQVFIcUFTUlZaMnQ0YVVOVFVtWkVObWMzVTFCc1YwZFFSR0V6ZG1KUU4yRkpjM2wwV0ZKcmRubnlBUmhWUTJ0U1prRnlkbko2YUdWWE1rVTNZalpUVmxRM2RsRkNFR052YlcxbGJuUnpMWE5sWTNScGIyN0NBMW9TR0ZWRGExSm1RWEoyY25wb1pWY3lSVGRpTmxOV1ZEZDJVUm9rVldkcmVHbERVMUptUkRabk4xTlFiRmRIVUVSaE0zWmlVRGRoU1hONWRGaFNhM1o1V2hoVlEydFNaa0Z5ZG5KNmFHVlhNa1UzWWpaVFZsUTNkbEUlM0Q%3D
                requestId: 4e0db876-c5e3-4d63-9928-803683a9092d
          headers: {}
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/youtube/get_post_detail?post_id=UgkxiCSRfD6g7SPlWGPDa3vbP7aIsytXRkvy&language_code=zh-CN&country_code=US' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

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


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

            const data = await response.json();

            console.log(data);
components:
  responses:
    '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
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        接口鉴权凭证。请在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。
        可在 [Dashboard](https://keyapi.ai/app/dashboard) 获取你的 API Key。

````