# LinkedIn 评论 API (linkedin.comments)

- Canonical page: https://everyinfra.com/linkedin-api/comments
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "linkedin", "action": "comments", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 200 per call
- Mode: async by default (202 + job_id, poll GET /api/v1/jobs/{job_id})

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=linkedin&action=comments

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | comments 的 LinkedIn 帖子完整链接，用来读取该帖评论；不要传公司主页或个人主页。 |
| num_comments | integer | no | not declared | 评论读取条数上限的兼容输入，不是最低评论数筛选；不保证结果按此数字截取。 |
| num_likes | integer | no | not declared | 点赞信息读取条数上限的兼容输入，不是最低点赞数筛选，也不是帖子热度过滤条件。 |
| sort | enum: newest / relevance | no | not declared | search 帖子与 comments 评论均支持 newest 最新、relevance 相关度；两者排序的是不同对象，不代表人物、公司或职位可以用同一参数排序。 |
| limit | integer (1–200) | no | 20 | 这次调用最多返回的条数，整数，1–200；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| url | 该记录在原平台上的可访问链接。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_headline | 内容作者的 headline（帖子/评论里用）。 |
| author_url | 作者在原平台的主页链接。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| is_pinned | 是否为置顶内容。 |
| is_edited | 帖子是否被编辑过。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| post_url | 帖子链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "linkedin",
  "action": "comments",
  "params": {
    "url": "https://www.linkedin.com/posts/linkedin_no-is-a-complete-sentence-activity-7247998907798978560-J_hB"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "linkedin",
        "action": "comments",
        "params": {
            "url": "https://www.linkedin.com/posts/linkedin_no-is-a-complete-sentence-activity-7247998907798978560-J_hB",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T18:28:34Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "linkedin",
  "action": "comments",
  "results": [
    {
      "id": "•••",
      "text": "账号被封了怎么解决，没提醒就直接被封，请求解封。How to solve the problem if the account is blocked? No reminder is directly blocked. Request to unblock the account.",
      "url": "https://www.linkedin.com/feed/update/urn:li:activity:7247998907798978560?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7247998907798978560%2C7268081540427857920%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287268081540427857920%2Curn%3Ali%3Aactivity%3A7247998907798978560%29",
      "author_name": "•••",
      "author_username": "•••",
      "author_headline": "•••",
      "author_url": "https://www.linkedin.com/•••",
      "like_count": 0,
      "reply_count": 0,
      "is_pinned": false,
      "is_edited": false,
      "posted_at": "2024-11-29T02:01:13.664000+00:00",
      "post_url": "https://www.linkedin.com/posts/linkedin_no-is-a-complete-sentence-activity-7247998907798978560-J_hB",
      "platform": "linkedin"
    },
    {
      "id": "•••",
      "text": "Thank you for the reminder that setting boundaries is both powerful and essential. This perspective is truly empowering!",
      "url": "https://www.linkedin.com/feed/update/urn:li:activity:7247998907798978560?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7247998907798978560%2C7265451425814454272%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287265451425814454272%2Curn%3Ali%3Aactivity%3A7247998907798978560%29",
      "author_name": "•••",
      "author_username": "•••",
      "author_headline": "•••",
      "author_url": "https://www.linkedin.com/•••",
      "like_count": 0,
      "reply_count": 0,
      "is_pinned": false,
      "is_edited": false,
      "posted_at": "2024-11-21T19:50:05.474000+00:00",
      "post_url": "https://www.linkedin.com/posts/linkedin_no-is-a-complete-sentence-activity-7247998907798978560-J_hB",
      "platform": "linkedin"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=linkedin
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
