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

# Profile comments

> Get comments of LinkedIn profile by post URL.

Get comments made by a LinkedIn profile.\
For example, it will scrape this page: [https://www.linkedin.com/in/williamhgates/recent-activity/comments/](https://www.linkedin.com/in/williamhgates/recent-activity/comments/)

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    profile: 'https://www.linkedin.com/in/satyanadella',
    // profileId: 'ACoAAAEkwwAB9KEc2TrQgOLEQ-vzRyZeCDyc6DQ', // profileId is preferable & faster
  });
  fetch(`https://api.harvestapi.io/linkedin/profile-comments?${params.toString()}`, {
    headers: { 'X-API-Key': '<api-key>' },
  })
    .then((response) => response.json())
    .then((data) => console.log(data));
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/profile-comments?profile=https://www.linkedin.com/in/satyanadella \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/profile-comments?profile=https://www.linkedin.com/in/satyanadella"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```
</CodeGroup>


## OpenAPI

````yaml GET /linkedin/profile-comments
openapi: 3.0.1
info:
  title: HarvestAPI LinkedIn API reference
  description: HarvestAPI LinkedIn API reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.harvestapi.io
security:
  - ApiKeyAuthHeader: []
paths:
  /linkedin/profile-comments:
    get:
      summary: Get comments of LinkedIn profile
      description: Get comments of LinkedIn profile by post URL.
      parameters:
        - name: profile
          in: query
          description: URL of the LinkedIn profile
          schema:
            type: string
        - name: profileId
          in: query
          description: Profile ID of the LinkedIn profile. It's faster to search by ID
          schema:
            type: string
        - name: postedLimit
          in: query
          description: >-
            Filter posts by maximum posted date. Supported values: '24h',
            'week', 'month'
          schema:
            type: string
        - name: page
          in: query
          description: Page number for pagination. Default is 1
          schema:
            type: integer
            default: 1
        - name: paginationToken
          in: query
          description: >-
            Required for pages > 1. Use this token from the previous page
            response.
          schema:
            type: string
            format: nullable
      responses:
        '200':
          description: Profile comments response
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostComment'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    type: object
                  status:
                    type: string
                  error:
                    type: string
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PostComment:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the comment.
          example: '7330012053861998592'
        linkedinUrl:
          type: string
          format: url
          description: The direct URL to the comment on LinkedIn.
          example: >-
            https://www.linkedin.com/feed/update/urn:li:ugcPost:7329991434395160578?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7329991434395160578%2C7330012053861998592%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287330012053861998592%2Curn%3Ali%3AugcPost%3A7329991434395160578%29
        commentary:
          type: string
          description: The text content of the comment.
          example: Exciting 🔥
        createdAt:
          type: string
          format: date-time
          description: The ISO 8601 timestamp of when the comment was created.
          example: '2025-05-18T23:30:58.680Z'
        numComments:
          type: integer
          description: The number of replies to this comment.
          example: 0
        numShares:
          type: integer
          nullable: true
          description: >-
            The number of times this comment has been shared (often null for
            comments).
          example: null
        numImpressions:
          type: integer
          nullable: true
          description: The number of impressions for this comment (often null).
          example: null
        reactionTypeCounts:
          type: array
          description: A list of reaction types and their counts for this comment.
          items:
            type: object
            properties:
              type:
                type: string
                description: The type of reaction.
                enum:
                  - LIKE
                  - EMPATHY
                  - PRAISE
                  - INTEREST
                  - MAYBE
                example: LIKE
              count:
                type: integer
                description: The number of this type of reaction.
                example: 1
            required:
              - type
              - count
        postId:
          type: string
          description: The ID of the post to which this comment belongs.
          example: '7329991434395160578'
        actor:
          type: object
          properties:
            id:
              type: string
              description: The unique identifier for the actor who made the comment.
              example: ACoAABLGFg4BRMcDx84MmyU8X-Jqcw9wKCA1QxU
            name:
              type: string
              description: The name of the actor.
              example: Harshavardhan G H
            linkedinUrl:
              type: string
              format: url
              description: The LinkedIn profile URL of the actor.
              example: https://www.linkedin.com/in/harshavardhangh
            position:
              type: string
              description: The current position or headline of the actor.
              example: >-
                Business Analyst | Data-Driven Decision Maker | 5+ Years of
                Experience in Municipal Data Systems & Public Sector Projects |
                Passionate About Driving Innovation in Local Governance | Always
                Exploring New Technologies
            pictureUrl:
              type: string
              format: url
              description: The URL of the actor's profile picture.
              example: >-
                https://media.licdn.com/dms/image/v2/D5603AQF38AglH7bh-A/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1730799919024?e=1753920000&v=beta&t=Jo-oVn--3ftKSEMtrITF0b3_UG97a0n401-ztV_9Gac
            picture:
              type: object
              properties:
                url:
                  type: string
                  format: url
                  description: The URL of the picture.
                  example: >-
                    https://media.licdn.com/dms/image/v2/D5603AQF38AglH7bh-A/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1730799919024?e=1753920000&v=beta&t=Jo-oVn--3ftKSEMtrITF0b3_UG97a0n401-ztV_9Gac
                width:
                  type: integer
                  description: The width of the picture in pixels.
                  example: 800
                height:
                  type: integer
                  description: The height of the picture in pixels.
                  example: 800
                expiresAt:
                  type: integer
                  format: int64
                  description: >-
                    The expiration timestamp of the picture URL in milliseconds
                    since epoch.
                  example: 1753920000000
              required:
                - url
                - width
                - height
                - expiresAt
            author:
              type: boolean
              description: >-
                Indicates if the actor is the original author of the parent
                post.
              example: false
          required:
            - id
            - name
            - linkedinUrl
            - author
        createdAtTimestamp:
          type: integer
          format: int64
          description: >-
            The timestamp of when the comment was created, in milliseconds since
            epoch.
          example: 1747611058680
        pinned:
          type: boolean
          description: Indicates if the comment is pinned.
          example: false
        contributed:
          type: boolean
          description: >-
            Indicates if the actor is a contributor to the content (e.g., a
            group admin or page role).
          example: false
        edited:
          type: boolean
          description: Indicates if the comment has been edited.
          example: false
      required:
        - id
        - linkedinUrl
        - commentary
        - createdAt
        - numComments
        - postId
        - actor
        - createdAtTimestamp
        - pinned
        - contributed
        - edited
    Pagination:
      type: object
      properties:
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int32
        pageNumber:
          type: integer
          format: int32
        previousElements:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        paginationToken:
          type: string
          format: nullable
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuthHeader:
      type: apiKey
      in: header
      name: X-API-Key

````