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

# Post reactions

> Get reactions of LinkedIn post by post URL.

### Profile URL format note

This endpoint scrapes the Reactions pop-up of a post on the LinkedIn website.
For reactions, LinkedIn website usually returns profile URLs in profile ID format,
for example: `https://linkedin.com/in/ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc` without public identifiers / slugs - we
did't find a way to get slugs directly from the Reactions pop-up or decode these IDs.\
The get the usual profile URL the workaround is to call the [Profile endpoint](/linkedin-api-reference/profile/get)
for each profile reaction (check main profile version to reduce costs).

## Examples

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    post: 'https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM',
    // post: 'https://www.linkedin.com/feed/update/urn:li:activity:7320867199693246465/' // Or Activity URL
  });
  fetch(`https://api.harvestapi.io/linkedin/post-reactions?${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/post-reactions?post=https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM \
    --header 'X-API-Key: <api-key>'
  ```

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

  url = "https://api.harvestapi.io/linkedin/post-reactions?post=https://www.linkedin.com/posts/microsoft-events_microsoft-build-has-arrived-in-seattle-and-ugcPost-7329991434395160578-GnK7?utm_source=share&utm_medium=member_desktop&rcm=ACoAACzazy4B3ajZsA0WxWr6m4S77iItYbYCLZM"

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

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

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


## OpenAPI

````yaml GET /linkedin/post-reactions
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/post-reactions:
    get:
      summary: Get reactions of LinkedIn post
      description: Get reactions of LinkedIn post by post URL.
      parameters:
        - name: post
          in: query
          description: URL of the LinkedIn post (required)
          schema:
            type: string
        - name: page
          in: query
          description: Page number for pagination. Default is 1
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Post reactions response
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostReaction'
                  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:
    PostReaction:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the reaction.
          example: >-
            urn:li:fsd_reaction:(urn:li:fsd_profile:ACoAAFsSba4BjCtAJXsUcfwXs0LPljAa2PsGpc8,urn:li:activity:7330681775884533760,0)
        reactionType:
          type: string
          description: The type of reaction.
          example: LIKE
        postId:
          type: string
          description: The ID of the post that was reacted to.
          example: '7330681775884533760'
        actor:
          type: object
          properties:
            id:
              type: string
              description: The unique identifier for the actor.
              example: ACoAAFsSba4BjCtAJXsUcfwXs0LPljAa2PsGpc8
            name:
              type: string
              description: The name of the actor.
              example: Om More
            linkedinUrl:
              type: string
              format: url
              description: The LinkedIn profile URL of the actor.
              example: >-
                https://www.linkedin.com/in/ACoAAFsSba4BjCtAJXsUcfwXs0LPljAa2PsGpc8
            position:
              type: string
              description: The current position of the actor.
              example: >-
                Student at Yashwantrao Mohite College of Arts, Science and
                Commerce, Pune
            pictureUrl:
              type: string
              format: url
              description: The URL of the actor's profile picture.
              example: >-
                https://media.licdn.com/dms/image/v2/D4E03AQEjFjWHGRTC2Q/profile-displayphoto-shrink_800_800/B4EZcG0eZVHAAc-/0/1748166110665?e=1753920000&v=beta&t=HOMnbBij0Z_MV2RvUu5zLKCpOaN8Cbnh72uqaH99ZLA
            picture:
              type: object
              properties:
                url:
                  type: string
                  format: url
                  description: The URL of the picture.
                  example: >-
                    https://media.licdn.com/dms/image/v2/D4E03AQEjFjWHGRTC2Q/profile-displayphoto-shrink_800_800/B4EZcG0eZVHAAc-/0/1748166110665?e=1753920000&v=beta&t=HOMnbBij0Z_MV2RvUu5zLKCpOaN8Cbnh72uqaH99ZLA
                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
          required:
            - id
            - name
            - linkedinUrl
      required:
        - id
        - reactionType
        - postId
        - actor
    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

````