---
title: "Scrape LinkedIn post comments"
method: POST
path: "/collect/linkedin/comments"
tags: ["scrapers"]
---

# Scrape LinkedIn post comments

`POST /collect/linkedin/comments`

Returns paginated top-level comments for a LinkedIn post (newest first). Each commenter carries name, headline, profileUrl, profileUrn, publicIdentifier, imageUrl, PLUS rich comment-level metadata: commentText (what they wrote — gold for personalised outreach), timestamp (when they commented), isPostAuthor (skip if true), commentUrn (use with scrape_comment_repliers to get reply tree), repliesCount, hasReplyFromPostAuthor. When campaignSlug is provided, also includes knownDistance (cached connection degree from recent visits) and actionsCompleted (message/reply/like/visit/connect booleans). Use count=0 to get only the total count without profile data. Response includes previousTotal to detect new comments without client-side tracking.

## Request body

- object
  - `postUrl` string, required — LinkedIn post URL to inspect for comments.
  - `start` integer — Pagination offset (multiples of 100).
  - `count` integer — Number of comments to fetch per page (0-100, default 100). Use count=0 to fetch only the total count without profile data.
  - `campaignSlug` string — When provided, each profile in the response includes actionsCompleted (message/reply/like/visit/connect booleans) and knownDistance (cached memberDistance from recent visits, null if not cached). Enables campaign-aware scraping without manual cross-referencing. Also auto-adds contacts to the campaign.
  - `omitData` boolean — When true, returns only counts (no profiles array). Data is still saved to DB.

## Response `200`

List of profiles who commented on the post

- object
  - `success` true, required
  - `profiles` object[], required
    - `name` string, required
    - `headline` string, nullable, required
    - `profileUrl` string, nullable, required
    - `imageUrl` string, nullable, required
    - `publicIdentifier` string, nullable, required — Vanity slug from profile URL (e.g. john-doe) when not URN-based
    - `profileUrn` string, nullable, required — LinkedIn profile URN (e.g. urn:li:fsd_profile:ACoAAA...) when available
    - `type` 'comment', required
    - `commentText` string
    - `timestamp` integer, nullable, required
    - `isEdited` boolean
    - `commentUrn` string — Full comment URN — use directly for /reply and /like endpoints. Do NOT reconstruct from hash fields.
    - `commentHash` string — SHA256 hash of commentUrn — use for dedup slugs only, not for building URNs.
    - `isPostAuthor` boolean — True if the commenter is the post author.
    - `repliesCount` integer — Number of replies to this comment.
    - `hasReplyFromPostAuthor` boolean, nullable — True if the post author already replied to this comment. Null when unknown (e.g. LinkedIn only preloaded partial replies).
    - `parentCommentUrn` string — URN of the parent comment, present on replies only.
    - `postUrn` string — URN of the post being commented on.
    - `postHash` string — SHA256 hash of postUrn — use for dedup slugs only.
    - `actionsCompleted` object — Per-profile action completion status within the campaign. Only present when campaignSlug is provided in the request.
      - `message` boolean, required
      - `reply` boolean, required
      - `like` boolean, required
      - `visit` boolean, required
      - `connect` boolean, required
    - `knownDistance` integer, nullable, required — Cached memberDistance from a recent profile visit (1 = connected, 2 = 2nd degree, etc.). null if campaignSlug not provided or profile not visited recently.
  - `count` integer, required — Number of profiles returned in this page.
  - `total` integer, required — Total number of comments on the post.
  - `start` integer, required — Pagination offset used for this response.
  - `hasMore` boolean, required — True when more pages are available beyond this one.
  - `previousTotal` integer, nullable, required — The total from your last call to this endpoint for the same post (null on first call). Compare with total to detect new comments without client-side tracking.
  - `processedCount` integer — Number of returned profiles that already have a completed 'message' action in this campaign. Only present when campaignSlug is provided.
  - `newCount` integer — Number of returned profiles that have NOT yet been messaged in this campaign. Only present when campaignSlug is provided.
  - `creditsUsed` integer, required — Credits consumed by this call (0 for free endpoints, cached results, or duplicates).
  - `retryAfter` integer, required — Seconds to wait before making another call of the same type. 0 means no wait needed.

## Other responses

- `400` — The server cannot or will not process the request due to something that is perceived to be a client error.
- `401` — Although HTTP specifies "unauthorized", this response means "unauthenticated". Authenticate to continue. NOTE: 401 is also returned with code "linkedin_not_connected" when the caller IS authenticated but has no connected LinkedIn account — connect LinkedIn (not re-authenticate) to continue.
- `403` — The client does not have access rights to the content.
- `404` — The server cannot find the requested resource.
- `409` — The request conflicts with the current state of the server.
- `410` — The requested content has been permanently deleted from the server.
- `422` — The request was well-formed but was unable to be followed due to semantic errors.
- `429` — Rate limit exceeded. Read error.retryAfter for the wait time in seconds.
- `500` — The server encountered a situation it does not know how to handle.
- `502` — LinkedIn returned a server error or the proxy connection failed. Retry after a few seconds.
- `503` — Proxy capacity temporarily exceeded. Retry after a few seconds.

---

[API](https://skmtc.net/berea/apis/bereach-api.md) · [All operations](https://skmtc.net/berea/apis/bereach-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/berea/bereach-api/versions/3caf12036b26/schema)
