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

# 获取帖子评论

> 按帖子 urn 获取该帖子的评论列表。

 **注意：**
- 实时接口可能遇到风控，如果接口返回code=500，请继续重试（code!=200不消耗额度）

<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 credits</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 接口，请根据提供的接口信息生成一份可直接运行的 Python 示例代码。

## 接口信息

Endpoint: GET https://api.keyapi.ai/v1/linkedin/get_post_comments
Summary: 获取帖子评论

Required Headers:
- Authorization: Bearer <YOUR_API_KEY>

Parameters:
- urn (Required): 帖子 activity urn. Example: 7267273010393358336
- sort_by (Optional): 无描述. Example: Most relevant
- page (Optional): 页码，默认1. Example: 1
- pagination_token (Optional): 翻页时传上一次响应返回的 token.
- share_urn (Optional): 分享类帖子可另传 share urn.


## 代码要求

- 使用 Python \`requests\` 库
- 提供完整、可直接运行的示例
- 处理 HTTP 请求异常、超时以及非 2xx 响应
- 处理 JSON 解析异常
- 示例参数优先使用接口信息中提供的 Example
- 保持代码简洁，避免不必要的封装和复杂设计
`)}
    >
      ✨ 复制给 AI
    </button>
  </div>
</div>


## OpenAPI

````yaml zh/linkedin.zh.openapi.json GET /v1/linkedin/get_post_comments
openapi: 3.0.1
info:
  title: Linkedin API 中文文档
  description: Linkedin API 的中文参考文档，包含接口用途、参数说明、响应状态和示例结构。
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production-KeyAPI
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/linkedin/get_post_comments:
    get:
      tags: []
      summary: 获取帖子评论
      description: |-
        按帖子 urn 获取该帖子的评论列表。

         **注意：**
        - 实时接口可能遇到风控，如果接口返回code=500，请继续重试（code!=200不消耗额度）
      parameters:
        - name: urn
          in: query
          description: 帖子 activity urn
          required: true
          example: '7267273010393358336'
          schema:
            type: string
            example: '7267273010393358336'
        - name: sort_by
          in: query
          description: ''
          required: false
          example: Most relevant
          schema:
            type: string
            enum:
              - Most relevant
              - Most recent
            default: Most relevant
        - name: page
          in: query
          description: 页码，默认1
          required: false
          schema:
            type: integer
            default: 1
        - name: pagination_token
          in: query
          description: 翻页时传上一次响应返回的 token
          required: false
          schema:
            type: string
        - name: share_urn
          in: query
          description: 分享类帖子可另传 share urn
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  data:
                    - annotation: null
                      commenter:
                        headline: Aspiring Property Manager/ Real Estate Agent
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D5603AQEJqtVUnnxbnw/profile-displayphoto-shrink_100_100/B56ZNp39shGkAU-/0/1732648099135?e=1789603200&v=beta&t=vOahh6BK4NfBz31VphAceKiT0lH48KpY_9kpGO7uP1M
                        linkedin_url: https://www.linkedin.com/in/manzanarespropmgmt
                        name: Monate Manzanares
                        urn: ACoAAAVRCsEBuy-uzvc61779lB-qNXG8crFwka8
                      created_at: 1732655923782
                      created_datetime: '2024-11-26 21:18:43'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267285671738765313%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267285671738765313%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: Love this
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: >-
                          Direct and Indirect Procurement | Functional Data
                          Analyst | WSQ ACLP certified trainer
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D5603AQEiERY7Nu8jcg/profile-displayphoto-scale_400_400/B56ZsvmXbxKAAk-/0/1766030146823?e=1789603200&v=beta&t=Og8kA3np8gIuqo4S5WngzXiCys2ve1l2jeW9OEtw0ss
                        linkedin_url: https://www.linkedin.com/in/ssgoh
                        name: Goh Swee Siong
                        urn: ACoAAADnyUIBn1S7927C1UWPZibcZinFb4Eq8Vg
                      created_at: 1732656234066
                      created_datetime: '2024-11-26 21:23:54'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267286973164187649%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267286973164187649%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: >-
                        This happened all the time in high performance culture
                        nowadays. Nothing new. As the doer, we need to seek
                        clarification and pin down to do or not to do even at
                        the expense of irking the manager.
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: >-
                          Sociologist//SDGs Advocate//Financial Advisor &
                          Planner//Researcher//Realtor//Educationist//Sales//Digital
                          Marketing//Humanitarian//Hospitality//Volunteer &
                          Positive Change Agent..
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D4E03AQHRnbHUVkdzrw/profile-displayphoto-shrink_400_400/B4EZSgBCPQGYAg-/0/1737851415290?e=1789603200&v=beta&t=nzChuAptIS1Mi5lSQc59DaexGA8C76x4XAts0GrycAA
                        linkedin_url: https://www.linkedin.com/in/john-emmanuel-72220774
                        name: JoHn EmmanuEl
                        urn: ACoAAA-xS0oBF3Yu651R6w26kmSzH_Q5L35uTgo
                      created_at: 1732652963885
                      created_datetime: '2024-11-26 20:29:23'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267273257030926336%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267273257030926336%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: Very Apt... 😎👌🙌👍
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: >-
                          💎 WellBeing Workplace Advocate | Business Connector |
                          Linkedin Top 300 Global Excellence Leader 2025|
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/C5603AQFey0FYTUHnrA/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1551406391787?e=1789603200&v=beta&t=9xjlYxxMHAVgKnCMdH0AsaGBba0rUgCm1zO30OmEeD4
                        linkedin_url: https://www.linkedin.com/in/reenastrehle
                        name: Reena Strehle
                        urn: ACoAACJeMFYBk9sz2-MbXT-m3d7aNnXFHofzpkI
                      created_at: 1732663452583
                      created_datetime: '2024-11-26 23:24:12'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267317249823170561%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267317249823170561%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: >-
                        Clarity should be a non-negotiable in communication!


                        A little slip-up can become big quite fast, Anthony J
                        James.
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: TRANSLATOR/DATA ENTRY AT DIGITAL COACH.IT
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D5635AQFyVzrVgQL2aw/profile-framedphoto-shrink_800_800/profile-framedphoto-shrink_800_800/0/1736500277895?e=1788318000&v=beta&t=5jnaT7vvQE9daR9rIv1uBna1_YpeIEgOAK1krfRwAxA
                        linkedin_url: >-
                          https://www.linkedin.com/in/md-monowarul-hoque-33444b324
                        name: Md Monowarul Hoque
                        urn: ACoAAFHvgBgBT9AvS87FIA1cCBori9vbZ36Baok
                      created_at: 1732809192123
                      created_datetime: '2024-11-28 15:53:12'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267928525754556416%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267928525754556416%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: https://kwork.com/manage_kworks
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: >-
                          Neuroscientist & Behavioural Economist | Forbes Women
                          Australia | Helping businesses remove buyer resistance
                          using Consumer Psychology | International Speaker &
                          Podcast Host
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D5603AQEt8h4IB9Prmg/profile-displayphoto-scale_100_100/B56ZqPxijQI0Ac-/0/1763348721935?e=1789603200&v=beta&t=9RD7tUoQWPWj8gM9Kp4y5o9eSSERAIg0ObsggYltPKc
                        linkedin_url: https://www.linkedin.com/in/leanne-elich
                        name: Dr Leanne Elich  PhD. GAICD. M.npn. F.npn
                        urn: ACoAAAL_ujEBd3Lz-RNNjbpu7XZTRbV9byHsng0
                      created_at: 1732777378817
                      created_datetime: '2024-11-28 07:02:58'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267795091077894144%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267795091077894144%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: >-
                        Classic indecision, Anthony J James! But hey, sometimes
                        it's all about taking the time to get it right.
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: >-
                          LinkedIn for Business Coach | I Help Coaches & B2B
                          Professionals Generate Qualified Leads & Clients on
                          LinkedIn within 7 Days Using Strategic Conversion
                          Conversations ✅ 330+ Recommendations 👉 Find Out More
                          DM ‘COACH’ 👈
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D4E03AQHV9a_S6MZ78g/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1670469073919?e=1789603200&v=beta&t=xEN04MOsx18tiBD9XOL-xpywjRf5h4_f2op3jbuly8A
                        linkedin_url: https://www.linkedin.com/in/derickmildred
                        name: Derick Mildred
                        urn: ACoAAAAS6BsBglQNMEueykIsc3sKcszsxmMNlEk
                      created_at: 1732755894176
                      created_datetime: '2024-11-28 01:04:54'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267704977962205184%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267704977962205184%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: >-
                        Hi Anthony J James It's a reminder of the constant
                        balancing act we face in decision-making. It's
                        fascinating how these choices shape our paths. 😎 😎 
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: '--'
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/C5603AQF47oO7yApInA/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1627583406821?e=1789603200&v=beta&t=iQMX406zvD8_I6YQWRg4MtQyyBVFF6nJmJGOhqWEIx4
                        linkedin_url: https://www.linkedin.com/in/abhishek-yadav-1b9b26218
                        name: Abhishek Yadav
                        urn: ACoAADb7z50BJmviL2rXY8cC2nFbNFseZUKQ75U
                      created_at: 1733167003542
                      created_datetime: '2024-12-02 19:16:43'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7269429295620476928%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287269429295620476928%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: I will do
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: emekli şirketinde serbest emekli
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/D4D03AQHxKEVq5zy-UA/profile-displayphoto-scale_100_100/B4DZscMpghH0Ac-/0/1765704638488?e=1789603200&v=beta&t=vQtF32e8xVwUwuRexUgDJvDy5wU7qKiwO9-LJHedD48
                        linkedin_url: https://www.linkedin.com/in/erdin-buluryar-4b750b136
                        name: ERDİN BULURYAR
                        urn: ACoAACEt6QsBIPm3mjyJwKuleM6VGGdTp6eQioM
                      created_at: 1732819322288
                      created_datetime: '2024-11-28 18:42:02'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7267971014746120193%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287267971014746120193%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: Ana düşünce strateji olmalıdır 😀
                      thread_urn: null
                    - annotation: null
                      commenter:
                        headline: >-
                          "Trust must be repeated again and again because the
                          error is constantly preached around." J.W. von Goethe
                        image_url: >-
                          https://media.licdn.com/dms/image/v2/C5603AQFV0X4RAvtPYw/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1642000333845?e=1789603200&v=beta&t=e_HluMBTHnATXxMW1NhQvLM36xPvbqjBlf0lsagy-LM
                        linkedin_url: https://www.linkedin.com/in/dr-corina-ross-8a928419
                        name: Dr. Corina Ross
                        urn: ACoAAAPHEAEBYwqtDnmtfItB-2BcQa9tnJHVfJs
                      created_at: 1733046436128
                      created_datetime: '2024-12-01 09:47:16'
                      permalink: >-
                        https://www.linkedin.com/feed/update/urn:li:activity:7267273010393358336?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7267273010393358336%2C7268923599233732608%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287268923599233732608%2Curn%3Ali%3Aactivity%3A7267273010393358336%29
                      pinned: false
                      replies: []
                      text: >-
                        The choice between short-term and big, immediate but
                        risky advantages and long-term and small sure advantages
                        had always been questioned. In economics, the government
                        has traditionally chosen the second choice, while
                        private business is based on the first one. And the head
                        can be "off", indifferently of choice :).
                      thread_urn: null
                  pagination_token: 1375446365-1787712727772-bd019ae7596614622bf07e5b0c3b3707
                  total: 10
                requestId: da567eb8-2e2f-44b7-964e-65f6763264df
          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/api/v1/linkedin/web_v2/get_post_comments?urn=7267273010393358336&sort_by=Most%20relevant&page=1' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/api/v1/linkedin/web_v2/get_post_comments',
                params={"urn":"7267273010393358336","sort_by":"Most relevant","page":1},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new
            URLSearchParams({"urn":"7267273010393358336","sort_by":"Most
            relevant","page":1});


            const response = await
            fetch(`https://api.keyapi.ai/api/v1/linkedin/web_v2/get_post_comments?${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
            properties: {}
          example:
            code: 400
            message: Bad Request
            data: {}
            requestId: 2c59c78f-a0fc-4adc-8201-d801a05b8412
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties: {}
          example:
            code: 401
            message: Unauthorized
            data: {}
            requestId: 2c59c78f-a0fc-4adc-8201-d801a05b8412
    '402':
      description: Payment Required
      content:
        application/json:
          schema:
            type: object
            properties: {}
          example:
            code: 402
            message: Insufficient credits
            data: {}
            requestId: 2c59c78f-a0fc-4adc-8201-d801a05b8412
    '429':
      description: Too Many Requests
      content:
        application/json:
          schema:
            type: object
            properties: {}
          example:
            code: 429
            message: Too Many Requests
            data: {}
            requestId: 2c59c78f-a0fc-4adc-8201-d801a05b8412
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties: {}
          example:
            code: 500
            message: Internal Server Error
            data: {}
            requestId: 2c59c78f-a0fc-4adc-8201-d801a05b8412
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        接口鉴权凭证。请在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。
        可在 [Dashboard](https://keyapi.ai/app/dashboard) 获取你的 API Key。

````