# Get LinkedIn post comments (https://snitchfeed.com/docs/api/linkedin/posts/comments)

**Authentication:** All requests require `Authorization: Bearer <api_key>` header. Obtain your API key from the SnitchFeed platform under Integrations → API Keys.

## `POST /data/linkedin/posts/comments`

**Full URL:** `https://api.snitchfeed.com/v1/data/linkedin/posts/comments`

**Summary:** Get LinkedIn post comments

Fetch comments and commenter profiles from a public LinkedIn post by post URL, up to 1000 per request. Costs 1 credit per comment returned, minimum 50 credits per request.

Returns up to `maxComments` comments (default 100, max 1000).

**Recommended client timeout: 90 seconds.** Larger `maxComments` values take longer because multiple pages are fetched.

Credits

Each **successful** response deducts **1 credit per comment returned**, with a minimum of **50 credits** per successful request. Requests that return no comments, and requests that fail (4xx / 5xx), are not billed.

See the [credits documentation](https://snitchfeed.com/docs/api/credits) for the full rate table.

### Request Body

**Content-Type:** `application/json`

#### Fields

Request body for `POST /data/linkedin/posts/comments`.

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `postUrl` | string | ✓ | Public LinkedIn post URL (e.g. `https://www.linkedin.com/posts/...` or a `feed/update/urn:li:activity:...` URL). (minLength: 1, maxLength: 2048) |
| `maxComments` | integer |  | Maximum comments to return (100-1000). Default 100. Charged at 1 credit per comment returned, minimum 50 credits per request. (min: 100, max: 1000) |

### Responses

#### `200`: Post comments

#### Response fields

Successful `POST /data/linkedin/posts/comments` response.

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `comments` | object[] | ✓ | Comments returned for this request (up to `maxComments`). |
| `meta` | object | ✓ |  |
| `returnedCount` | integer | ✓ | Number of comments in this response. |
| `total` | integer | ✓ | Total comments reported by LinkedIn for this post when available. |
| `creditsCharged` | integer | ✓ | Credits deducted for this successful request. |

#### `400`: Validation or bad request

#### Response fields

Validation error

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "validation_error" | ✓ |  |
| `message` | string | ✓ |  |
| `issues` | object[] | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "validation_error",
    "message": "query: String must contain at least 1 character(s)",
    "issues": [
      {
        "path": "query",
        "message": "String must contain at least 1 character(s)"
      }
    ]
  }
}
```

#### `401`: Unauthorized

#### Response fields

Unauthorized

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "unauthorized" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "unauthorized",
    "message": "Invalid or revoked API key."
  }
}
```

#### `403`: Forbidden: the credential is a partner OAuth token (`/data` endpoints need an organization API key), the key lacks the `search:read` scope, the organization's plan does not include API access or this endpoint's platform, or the key owner's role lacks the required permission.

#### Response fields

Forbidden — the API key lacks a required scope, or its owner's role lacks the underlying permission.

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "forbidden" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "forbidden",
    "message": "This credential does not have the \"search:read\" scope."
  }
}
```

#### `404`: LinkedIn couldn't find that profile, company or post. Check the URL. Not charged.

#### Response fields

Resource not found

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "not_found" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "not_found",
    "message": "LinkedIn couldn't find that profile, post or account. Check the URL or handle and try again."
  }
}
```

#### `429`: Rate limited (20 requests per minute per surface) or too many concurrent in-flight requests (max 2 per organization)

#### Response fields

Rate limited or too many concurrent in-flight requests

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "rate_limited" | ✓ |  |
| `message` | string | ✓ |  |
| `retryAfter` | integer | ✓ | Seconds until the rate limit resets (same value as the `Retry-After` response header). |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded for linkedin. Try again later.",
    "retryAfter": 42
  }
}
```

#### `502`: Upstream error

#### Response fields

Upstream error

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "upstream_error" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "upstream_error",
    "message": "LinkedIn search could not be completed. You won't be charged for this request."
  }
}
```

#### `503`: LinkedIn comments scrape temporarily unavailable

#### Response fields

LinkedIn search temporarily unavailable

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "linkedin_unavailable" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "ce8f36c6-c9e6-4ab1-93b3-d11bbbe886aa",
  "error": {
    "code": "linkedin_unavailable",
    "message": "LinkedIn search is temporarily unavailable. Retry later. You won't be charged for this request."
  }
}
```
