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

# 获取单个Reddit帖子详情

> 根据帖子ID获取单个帖子详情，可选择性包含特定评论的上下文。

 `注意：ID格式需要添加类型前缀。 帖子ID前缀：t3_ (例如: t3_XXXXX)
 评论ID前缀: t1_ (例如: t1_XXXXX)`

<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">1 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/reddit/fetch_post_details\n\n请帮我编写调用代码，并包含必要的错误处理、参数校验和响应处理逻辑。\n\n接口信息：\n\nEndpoint: GET https://api.keyapi.ai/v1/reddit/fetch_post_details\n\nDescription: Reddit 的「帖子详情」接口用于根据指定标识查询完整信息，返回基础资料、统计指标以及示例中的扩展字段。常用必填参数包括 post_id。\n\nRequired Headers:\n--header 'Authorization: Bearer <YOUR_API_KEY>'\n\nParameters:\n- post_id (Required): 帖子 ID. Example: t3_1ojnh50\n- include_comment_id (Optional): include_comment_id 标识符. Example: false\n- comment_id (Optional): comment_id 标识符\n- need_format (Optional): need_format 参数. Example: false\n\nExample Response:\n{\n  \"code\": 0,\n  \"message\": \"success\",\n  \"data\": {\n    \"postsInfoByIds\": [\n      {\n        \"__typename\": \"SubredditPost\",\n        \"authorCommunityBadge\": null,\n        \"subreddit\": {\n          \"__typename\": \"Subreddit\",\n          \"id\": \"t5_mvcq5\",\n          \"name\": \"TikTokCringe\",\n          \"prefixedName\": \"r/TikTokCringe\",\n          \"isQuarantined\": false,\n          \"title\": \"The Best and Worst of TikTok\",\n          \"type\": \"PUBLIC\",\n          \"subscribersCount\": 5365597,\n          \"isNsfw\": false,\n          \"isSubscribed\": false,\n          \"isThumbnailsEnabled\": true,\n          \"styles\": {\n            \"icon\": \"https://styles.redditmedia.com/t5_mvcq5/styles/communityIcon_twjztnhoy2691.jpg?width=64&height=64&frame=1&auto=webp&crop=64:64,smart&s=4372e5388bf0e14e147686cbdb3edf26a872b4de\",\n            \"legacyIcon\": null,\n            \"primaryColor\": \"#B33BD8\",\n            \"backgroundColor\": \"#000000\",\n            \"bannerBackgroundImage\": \"https://styles.redditmedia.com/t5_mvcq5/styles/bannerBackgroundImage_gjg9dsefkz591.jpg?format=pjpg&s=ab45f817c3c7613d0b223efab13391e15ea0b402\",\n            \"legacyPrimaryColor\": \"#7E53C1\"\n          },\n          \"modPermissions\": null,\n          \"communityStatus\": null,\n          \"isTitleSafe\": true,\n          \"isUserBanned\": false,\n          \"tippingStatus\": null,\n          \"whitelistStatus\": \"SOME_ADS\"\n        },\n        \"crosspostRoot\": null,\n        \"id\": \"t3_1ojnh50\",\n        \"createdAt\": \"2025-10-30T01:58:59.142000+0000\",\n        \"editedAt\": null,\n        \"postTitle\": \"[ 已被版主删除 ]\",\n        \"url\": \"https://www.reddit.com/r/TikTokCringe/comments/1ojnh50/%E5%B7%B2%E8%A2%AB%E7%89%88%E4%B8%BB%E5%88%A0%E9%99%A4/\",\n        \"content\": null,\n        \"domain\": \"v.redd.it\",\n        \"isSpoiler\": false,\n        \"isNsfw\": false,\n        \"isCommercialCommunication\": false,\n        \"isLocked\": true,\n        \"isSaved\": false,\n        \"isReactAllowed\": false,\n        \"isHidden\": false,\n        \"isGildable\": false,\n        \"isCrosspostable\": false,\n        \"isScoreHidden\": false,\n        \"isArchived\": false,\n        \"isStickied\": false,\n        \"isPollIncluded\": false,\n        \"poll\": null,\n        \"isFollowed\": false,\n        \"awardingsInfo\": null,\n        \"awardings\": [\n          {\n            \"__typename\": \"AwardingTotal\",\n            \"award\": {\n              \"__typename\": \"Award\",\n              \"id\": \"award_wholesome_seal\",\n              \"name\": \"正能量\",\n              \"tags\": [\n                \"award:legacy\",\n                \"award:group:legacytop\"\n              ],\n              \"static_icon_16\": {\n                \"__typename\": \"MediaSource\",\n                \"url\": \"https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_16.png\",\n                \"dimensions\": {\n                  \"width\": 16,\n                  \"height\": 16\n                }\n              },\n              \"static_icon_24\": {\n                \"__typename\": \"MediaSource\",\n                \"url\": \"https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_24.png\",\n                \"dimensions\": {\n                  \"width\": 24,\n                  \"height\": 24\n                }\n              },\n              \"static_icon_32\": {\n                \"__typename\": \"MediaSource\",\n                \"url\": \"https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_32.png\",\n                \"dimensions\": {\n                  \"width\": 32,\n                  \"height\": 32\n                }\n              },\n              \"static_icon_48\": {\n                \"__typename\": \"MediaSource\",\n                \"url\": \"https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_48.png\",\n                \"dimensions\": {\n                  \"width\": 48,\n                  \"height\": 48\n                }\n              },\n              \"static_icon_64\": {\n                \"__typename\": \"MediaSource\",\n                \"url\": \"https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_64.png\",\n                \"dimensions\": {\n                  \"width\": 64,\n                  \"height\": 64\n                }\n              }\n            },\n            \"total\": 1\n          }\n        ],\n        \"isContestMode\": false,\n        \"distinguishedAs\": null,\n        \"voteState\": \"NONE\",\n        \"score\": 33358,\n        \"commentCount\": 11462,\n        \"viewCount\": null,\n        \"authorFlair\": null,\n        \"flair\": {\n          \"__typename\": \"PostFlair\",\n          \"type\": \"text\",\n          \"text\": \"Cringe\",\n          \"richtext\": null,\n          \"textColor\": \"LIGHT\",\n          \"template\": {\n            \"id\": \"d74470ce-5c6c-11e9-9455-0e158690b334\",\n            \"isEditable\": false,\n            \"backgroundColor\": \"#EA0027\"\n          }\n        },\n        \"authorInfo\": {\n          \"__typename\": \"Redditor\",\n          \"id\": \"t2_n5zmzf3v0\",\n          \"name\": \"ambachk\",\n          \"isBlocked\": false,\n          \"isCakeDayNow\": false,\n          \"newIcon\": {\n            \"__typename\": \"MediaSource\",\n            \"url\": \"https://styles.redditmedia.com/t5_9uhspc/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfZWI5NTlhNzE1ZGZmZmU2ZjgyZjQ2MDU1MzM5ODJjNDg1OWNiMTRmZV8xNTcxMjU1MA_rare_7f655c9b-871f-4906-97c6-431b2d32153b-headshot.png?s=f96f520312f1ccc9ac807f95086bd0104e994b4a\",\n            \"dimensions\": {\n              \"width\": 256,\n              \"height\": 256\n            }\n          },\n          \"iconSmall\": {\n            \"__typename\": \"MediaSource\",\n            \"url\": \"https://styles.redditmedia.com/t5_9uhspc/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfZWI5NTlhNzE1ZGZmZmU2ZjgyZjQ2MDU1MzM5ODJjNDg1OWNiMTRmZV8xNTcxMjU1MA_rare_7f655c9b-871f-4906-97c6-431b2d32153b-headshot.png?width=50&height=50&frame=1&auto=webp&crop=50%3A50%2Csmart&s=1db50c27a77053b8cc9d3ddf09109ebc22224142\",\n            \"dimensions\": {\n              \"width\": 50,\n              \"height\": 50\n            }\n          },\n          \"snoovatarIcon\": {\n            \"__typename\": \"MediaSource\",\n            \"url\": \"https://i.redd.it/snoovatar/avatars/nftv2_bmZ0X2VpcDE1NToxMzdfZWI5NTlhNzE1ZGZmZmU2ZjgyZjQ2MDU1MzM5ODJjNDg1OWNiMTRmZV8xNTcxMjU1MA_rare_7f655c9b-871f-4906-97c6-431b2d32153b.png\",\n            \"dimensions\": {\n              \"width\": 380,\n              \"height\": 600\n            }\n          },\n          \"profile\": {\n            \"isNsfw\": false\n          },\n          \"accountType\": \"USER\"\n        },\n        \"isThumbnailEnabled\": true,\n        \"thumbnail\": null,\n        \"media\": null,\n        \"moderationInfo\": null,\n        \"suggestedCommentSort\": null,\n        \"permalink\": \"/r/TikTokCringe/comments/1ojnh50/已被版主删除/\",\n        \"isSelfPost\": false,\n        \"postHint\": null,\n        \"postEventInfo\": null,\n        \"gallery\": null,\n        \"devvit\": null,\n        \"outboundLink\": {\n          \"url\": \"https://www.reddit.com/r/TikTokCringe/comments/1ojnh50/%E5%B7%B2%E8%A2%AB%E7%89%88%E4%B8%BB%E5%88%A0%E9%99%A4/\",\n          \"expiresAt\": \"2026-03-05T14:06:20.679900+0000\"\n        },\n        \"postStats\": {\n          \"viewCountTotal\": null,\n          \"shareAllTotal\": 12621\n        },\n        \"postStatsPrivate\": {\n          \"viewCountTotals\": null\n        },\n        \"isAuthorBlocked\": false,\n        \"upvoteRatio\": 0.8373503764285327,\n        \"reactedFrom\": null,\n        \"attributionInfo\": null,\n        \"crowdControlLevel\": \"OFF\",\n        \"isCrowdControlFilterEnabled\": false,\n        \"languageCode\": \"en\",\n        \"isTranslatable\": false,\n        \"isTranslated\": false,\n        \"translatedLanguage\": null,\n        \"removedByCategory\": \"MODERATOR\",\n        \"modContentDiscussion\": null,\n        \"predictedRemovalSavedResponses\": []\n      }\n    ]\n  }\n}\n\n请根据以上信息给出可直接运行的示例代码。")}>
      ✨ 复制给 AI
    </button>
  </div>
</div>


## OpenAPI

````yaml zh/reddit.zh.openapi.json GET /v1/reddit/fetch_post_details
openapi: 3.0.1
info:
  title: Reddit API 中文文档
  description: Reddit API 的中文参考文档，包含接口用途、参数说明、响应状态和示例结构。
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/reddit/fetch_post_details:
    get:
      tags: []
      summary: 获取单个Reddit帖子详情
      description: |-
        根据帖子ID获取单个帖子详情，可选择性包含特定评论的上下文。

         `注意：ID格式需要添加类型前缀。 帖子ID前缀：t3_ (例如: t3_XXXXX)
         评论ID前缀: t1_ (例如: t1_XXXXX)`
      parameters:
        - name: post_id
          in: query
          description: 帖子 ID， 格式如： t3_XXXXX
          required: true
          example: t3_1ojnh50
          schema:
            type: string
            example: t3_1ojnh50
        - name: include_comment_id
          in: query
          description: 是否包含特定评论ID，默认False
          required: false
          example: 'false'
          schema:
            type: boolean
            default: false
        - name: comment_id
          in: query
          description: 评论ID（当include_comment_id为True时使用），格式如： t1_XXXXXX
          required: false
          schema:
            type: string
            example: t1_n5zmzf3v0
        - name: need_format
          in: query
          description: 是否需要清洗数据
          required: false
          example: 'false'
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  postsInfoByIds:
                    - __typename: SubredditPost
                      authorCommunityBadge: null
                      subreddit:
                        __typename: Subreddit
                        id: t5_mvcq5
                        name: TikTokCringe
                        prefixedName: r/TikTokCringe
                        isQuarantined: false
                        title: The Best and Worst of TikTok
                        type: PUBLIC
                        subscribersCount: 5365597
                        isNsfw: false
                        isSubscribed: false
                        isThumbnailsEnabled: true
                        styles:
                          icon: >-
                            https://styles.redditmedia.com/t5_mvcq5/styles/communityIcon_twjztnhoy2691.jpg?width=64&height=64&frame=1&auto=webp&crop=64:64,smart&s=4372e5388bf0e14e147686cbdb3edf26a872b4de
                          legacyIcon: null
                          primaryColor: '#B33BD8'
                          backgroundColor: '#000000'
                          bannerBackgroundImage: >-
                            https://styles.redditmedia.com/t5_mvcq5/styles/bannerBackgroundImage_gjg9dsefkz591.jpg?format=pjpg&s=ab45f817c3c7613d0b223efab13391e15ea0b402
                          legacyPrimaryColor: '#7E53C1'
                        modPermissions: null
                        communityStatus: null
                        isTitleSafe: true
                        isUserBanned: false
                        tippingStatus: null
                        whitelistStatus: SOME_ADS
                      crosspostRoot: null
                      id: t3_1ojnh50
                      createdAt: 2025-10-30T01:58:59.142000+0000
                      editedAt: null
                      postTitle: '[ 已被版主删除 ]'
                      url: >-
                        https://www.reddit.com/r/TikTokCringe/comments/1ojnh50/%E5%B7%B2%E8%A2%AB%E7%89%88%E4%B8%BB%E5%88%A0%E9%99%A4/
                      content: null
                      domain: v.redd.it
                      isSpoiler: false
                      isNsfw: false
                      isCommercialCommunication: false
                      isLocked: true
                      isSaved: false
                      isReactAllowed: false
                      isHidden: false
                      isGildable: false
                      isCrosspostable: false
                      isScoreHidden: false
                      isArchived: false
                      isStickied: false
                      isPollIncluded: false
                      poll: null
                      isFollowed: false
                      awardingsInfo: null
                      awardings:
                        - __typename: AwardingTotal
                          award:
                            __typename: Award
                            id: award_wholesome_seal
                            name: 正能量
                            tags:
                              - award:legacy
                              - award:group:legacytop
                            static_icon_16:
                              __typename: MediaSource
                              url: >-
                                https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_16.png
                              dimensions:
                                width: 16
                                height: 16
                            static_icon_24:
                              __typename: MediaSource
                              url: >-
                                https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_24.png
                              dimensions:
                                width: 24
                                height: 24
                            static_icon_32:
                              __typename: MediaSource
                              url: >-
                                https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_32.png
                              dimensions:
                                width: 32
                                height: 32
                            static_icon_48:
                              __typename: MediaSource
                              url: >-
                                https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_48.png
                              dimensions:
                                width: 48
                                height: 48
                            static_icon_64:
                              __typename: MediaSource
                              url: >-
                                https://www.redditstatic.com/marketplace-assets/v1/core/awards/wholsome_v1_64.png
                              dimensions:
                                width: 64
                                height: 64
                          total: 1
                      isContestMode: false
                      distinguishedAs: null
                      voteState: NONE
                      score: 33358
                      commentCount: 11462
                      viewCount: null
                      authorFlair: null
                      flair:
                        __typename: PostFlair
                        type: text
                        text: Cringe
                        richtext: null
                        textColor: LIGHT
                        template:
                          id: d74470ce-5c6c-11e9-9455-0e158690b334
                          isEditable: false
                          backgroundColor: '#EA0027'
                      authorInfo:
                        __typename: Redditor
                        id: t2_n5zmzf3v0
                        name: ambachk
                        isBlocked: false
                        isCakeDayNow: false
                        newIcon:
                          __typename: MediaSource
                          url: >-
                            https://styles.redditmedia.com/t5_9uhspc/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfZWI5NTlhNzE1ZGZmZmU2ZjgyZjQ2MDU1MzM5ODJjNDg1OWNiMTRmZV8xNTcxMjU1MA_rare_7f655c9b-871f-4906-97c6-431b2d32153b-headshot.png?s=f96f520312f1ccc9ac807f95086bd0104e994b4a
                          dimensions:
                            width: 256
                            height: 256
                        iconSmall:
                          __typename: MediaSource
                          url: >-
                            https://styles.redditmedia.com/t5_9uhspc/styles/profileIcon_snoo-nftv2_bmZ0X2VpcDE1NToxMzdfZWI5NTlhNzE1ZGZmZmU2ZjgyZjQ2MDU1MzM5ODJjNDg1OWNiMTRmZV8xNTcxMjU1MA_rare_7f655c9b-871f-4906-97c6-431b2d32153b-headshot.png?width=50&height=50&frame=1&auto=webp&crop=50%3A50%2Csmart&s=1db50c27a77053b8cc9d3ddf09109ebc22224142
                          dimensions:
                            width: 50
                            height: 50
                        snoovatarIcon:
                          __typename: MediaSource
                          url: >-
                            https://i.redd.it/snoovatar/avatars/nftv2_bmZ0X2VpcDE1NToxMzdfZWI5NTlhNzE1ZGZmZmU2ZjgyZjQ2MDU1MzM5ODJjNDg1OWNiMTRmZV8xNTcxMjU1MA_rare_7f655c9b-871f-4906-97c6-431b2d32153b.png
                          dimensions:
                            width: 380
                            height: 600
                        profile:
                          isNsfw: false
                        accountType: USER
                      isThumbnailEnabled: true
                      thumbnail: null
                      media: null
                      moderationInfo: null
                      suggestedCommentSort: null
                      permalink: /r/TikTokCringe/comments/1ojnh50/已被版主删除/
                      isSelfPost: false
                      postHint: null
                      postEventInfo: null
                      gallery: null
                      devvit: null
                      outboundLink:
                        url: >-
                          https://www.reddit.com/r/TikTokCringe/comments/1ojnh50/%E5%B7%B2%E8%A2%AB%E7%89%88%E4%B8%BB%E5%88%A0%E9%99%A4/
                        expiresAt: 2026-03-05T14:06:20.679900+0000
                      postStats:
                        viewCountTotal: null
                        shareAllTotal: 12621
                      postStatsPrivate:
                        viewCountTotals: null
                      isAuthorBlocked: false
                      upvoteRatio: 0.8373503764285327
                      reactedFrom: null
                      attributionInfo: null
                      crowdControlLevel: 'OFF'
                      isCrowdControlFilterEnabled: false
                      languageCode: en
                      isTranslatable: false
                      isTranslated: false
                      translatedLanguage: null
                      removedByCategory: MODERATOR
                      modContentDiscussion: null
                      predictedRemovalSavedResponses: []
          headers: {}
        '400':
          description: 请求参数错误，请检查必填字段和参数格式
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: 鉴权失败，请检查 Authorization Header 中的 Bearer Token 或 API Key 是否有效
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: 账户余额或额度不足
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: 请求过于频繁，已触发限流
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: 服务器内部错误，请稍后重试
          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/reddit/fetch_post_details?post_id=t3_1ojnh50&include_comment_id=false&need_format=false' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/reddit/fetch_post_details',
                params={"post_id": "t3_1ojnh50", "include_comment_id": "false", "need_format": "false"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"post_id": "t3_1ojnh50",
            "include_comment_id": "false", "need_format": "false"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/reddit/fetch_post_details?${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: |-
        接口鉴权凭证。请在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。
        可在 [Dashboard](https://keyapi.ai/app/dashboard) 获取你的 API Key。

````