---
title: "Extract Comments Endpoint"
method: POST
path: "/enrich/comments"
tags: ["enrichment"]
---

# Extract Comments Endpoint

`POST /enrich/comments`

## Request

- Base URL: `https://api.dataforb2b.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dataforb2b.ai/enrich/comments`
- Auth: none declared

Extract comments made by a LinkedIn profile

Extracts the comments a user has made on LinkedIn posts.

**Supported profile_identifier formats:**
- Full URL: `https://www.linkedin.com/in/john-doe-123456/`
- Short URL: `linkedin.com/in/john-doe`
- Public ID only: `john-doe`
- Member identity: `ACoAABxxxxxx`
- Encoded profile ID: `prof_PVXj1LZJg54zXKcnKNBusu8LgvJX5SYm5QYj`

**Pagination:**
- `offset`: Number of comments to skip (default: 0)
- `count`: Number of comments to return (default: 10, max: 100)

**Example request:**
```json
{
    "profile_identifier": "john-doe",
    "offset": 0,
    "count": 20
}
```

**Example response:**
```json
{
    "total": 20,
    "offset": 0,
    "count": 20,
    "has_next_page": true,
    "credits_used": 1,
    "results": [
        {
            "comment_id": "urn:li:comment:(activity:7xxx,xxx)",
            "comment_content": "Great post! Thanks for sharing.",
            "comment_time": "2d",
            "comment_time_days": 2,
            "commenter": {
                "name": "John Doe",
                "profile_url": "https://linkedin.com/in/john-doe",
                "headline": "Software Engineer"
            },
            "post": {
                "url": "https://linkedin.com/feed/update/urn:li:activity:xxx",
                "content": "Original post content...",
                "author": {
                    "name": "Jane Smith"
                }
            }
        }
    ],
    "profile_id": "prof_PVXj1LZJg54zXKcnKNBusu8LgvJX5SYm5QYj"
}
```

**Credits:** 1 credit per 10 comments (or fraction thereof)

## Headers

- `api-key` string, nullable

## Request body

- ExtractCommentsRequest: Request for extracting profile comments
  - `profile_identifier` string, required: LinkedIn profile identifier. Supports: https://linkedin.com/in/john-doe, john-doe, ACoAABxxxxxx, prof_xxx
  - `count` integer: Number of comments to return (max 1000, auto-paginates internally)
  - `pagination_token` string, nullable: Pagination token from previous response to get next page

## Response `200`

Successful Response

- ExtractCommentsResponse: Response containing extracted profile comments
  - `total` integer: Total number of comments returned
  - `has_next` boolean: Whether there are more comments to fetch
  - `next_pagination_token` string, nullable: Token to fetch next page (null if no more results)
  - `credits_used` number: Credits used for this request
  - `commenter` CommenterInfo: Info about the commenter (the profile being scraped)
    - `name` string, nullable
    - `profile_url` string, nullable
    - `profile_picture` string, nullable
    - `profile_id` string, nullable
    - `headline` string, nullable
  - `results` object[]: List of extracted comments

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dataforb2b/apis/dataforb2b-api.md) · [All operations](https://skmtc.dev/dataforb2b/apis/dataforb2b-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dataforb2b/apis/dataforb2b-api/revisions/24ea79caa1a1?raw)
