# LinkedIn Post Comments (`linkedin.post_comments`)

Comments on a public LinkedIn post: full text, commenter name, profile URL and headline, timestamps and engagement.

Docs: https://primaryapi.com/docs/api-reference/linkedin/post_comments

- Endpoint: `POST https://api.primaryapi.com/v1/run/linkedin.post_comments`
- Category: Social · Platform: `linkedin` · Kind: list · Status: live
- Price: 4 credits per call; up to 125 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=linkedin.post_comments`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `url` | string | yes |  | max 2048 chars | Public LinkedIn post URL. |
| `limit` | integer | no | 100 | 1–100 | Maximum comments to return (1-100, default 100). Pass nextCursor for more. |
| `postedLimit` | enum | no |  | one of: any, 24h, week, month, 3months, 6months, year | Only return comments posted within this window (default any). |
| `cursor` | string | no |  |  | Opaque pagination cursor: pass the previous response's nextCursor. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `items` | object[] | Comments, newest first |
| `items[].id` | string | Comment id |
| `items[].url` | string \| null | Permalink of the comment |
| `items[].commentary` | string \| null | Comment text |
| `items[].createdUtc` | integer \| null | When the comment was posted (Unix seconds) |
| `items[].edited` | boolean \| null | The comment was edited |
| `items[].pinned` | boolean \| null | The comment is pinned by the post author |
| `items[].postId` | string \| null | Id of the post the comment belongs to |
| `items[].actor` | object | The member who commented or reacted |
| `items[].actor.id` | string \| null | LinkedIn member id (the id inside the member URN), when known |
| `items[].actor.name` | string \| null | Display name |
| `items[].actor.linkedinUrl` | string \| null | Profile URL |
| `items[].actor.position` | string \| null | Headline shown next to the name |
| `items[].actor.pictureUrl` | string \| null | Profile photo URL (LinkedIn image links expire) |
| `items[].engagement` | object | Engagement on the comment |
| `items[].engagement.comments` | integer \| null | Replies to the comment |
| `items[].engagement.shares` | integer \| null | Shares (usually not shown for comments) |
| `items[].engagement.impressions` | integer \| null | Impressions (usually not shown for comments) |
| `items[].engagement.reactions` | object[] | Reactions to the comment, by type |
| `items[].engagement.reactions[].type` | string | Reaction type: LIKE, PRAISE, EMPATHY, APPRECIATION, INTEREST, ENTERTAINMENT … |
| `items[].engagement.reactions[].count` | integer | How many reactions of this type |
| `totalResults` | integer \| null | Total results LinkedIn reports for this list, when known |
| `nextCursor` | string \| null | Pass as cursor (with the same url) for the next comments |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

Pagination: pass the previous response’s `nextCursor` as `cursor` to get the next page; `nextCursor: null` means there are no more results.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/linkedin.post_comments" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.linkedin.com/posts/satyanadella_today-at-microsoft-build-activity-7329207003942125568-xyz","limit":50}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "items": [
        {
          "id": "string",
          "url": "https://www.linkedin.com/posts/satyanadella_today-at-microsoft-build-activity-7329207003942125568-xyz",
          "commentary": "string",
          "createdUtc": 0,
          "edited": true,
          "pinned": true,
          "postId": "string",
          "actor": {
            "id": "string",
            "name": "string",
            "linkedinUrl": "https://example.com",
            "position": "string",
            "pictureUrl": "https://example.com"
          },
          "engagement": {
            "comments": 0,
            "shares": 0,
            "impressions": 0,
            "reactions": [
              {
                "type": "string",
                "count": 0
              }
            ]
          }
        }
      ],
      "totalResults": 0,
      "nextCursor": null
    }
  },
  "provider": "PrimaryAPI",
  "credits": 4,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z",
  "nextCursor": null
}
```

## Pricing and reliability

- Usual price: 4 credits per call
- Price ceiling: up to 125 credits if a call is retried elsewhere. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=linkedin.post_comments`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

Top-level comments, newest first, up to 100 per call; pass nextCursor (with the same url) for more. postedLimit narrows the list to comments posted within the window. A deleted or private post answers found=false.

## Legal

Public LinkedIn data only. LinkedIn’s User Agreement restricts automated collection and LinkedIn enforces it; use the data for lawful purposes, keep copies only as long as you need them, and treat post and article text as the author’s content (analysis, not republication). Results contain personal data about identifiable people (GDPR, UK GDPR, CCPA): have a lawful basis, honour deletion requests, and never use it for spam or unsolicited bulk outreach.

