# Lobsters 评论 API (lobsters.comments)

- Canonical page: [https://everyinfra.com/lobsters-api/comments](https://everyinfra.com/lobsters-api/comments?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "lobsters", "action": "comments", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Lobsters story 链接，如 https://lobste.rs/s/5kmyma，后面带不带标题那一段都收；也可以只给 short_id 5kmyma。认不出的写法在扣费前被拒。 |
| limit | integer (1–) | no | not declared | 正整数（≥1），本次最多返回的条数：不传则返回本次取到的全部结果，传了只把结果截短到这个条数以内，不会多取，也不会变多。扣费不受 `limit` 影响。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 编号：story 的 short_id（如 5kmyma，trending、latest_posts、tag_posts、post_detail），或评论的 short_id（comments）。 |
| post_id | 评论所在 story 的 short_id（comments）。 |
| text | 正文：story 自带的文字（没有自带文字的链接 story 没有这个字段），或评论的纯文本（comments）。 |
| text_html | 评论带格式的 HTML 原文（comments）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| upvote_count | 净得分：赞减踩（story 和评论都有）；平台不分开给赞和踩。 |
| depth | 评论的嵌套层级（comments），照页面给的数；谁回复谁以 parent_id 为准。 |
| parent_id | 被回复的那条评论的 short_id（comments），回复别的评论时才有。 |
| rank | 这一行在这一次结果里的位置，从 1 开始（trending、latest_posts、tag_posts、comments）。 |
| post_comment_count | 这个 story 的评论数（comments），来自这一次的汇总。 |
| collected_at | 这条数据的抓取时刻（ISO 8601，UTC）。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## 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": "lobsters",
  "action": "comments",
  "params": {
    "url": "https://lobste.rs/s/5kmyma"
  }
}'
```

```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": "lobsters",
        "action": "comments",
        "params": {
            "url": "https://lobste.rs/s/5kmyma",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "lobsters",
  "action": "comments",
  "results": [
    {
      "id": …,
      "post_id": …,
      "text": …,
      "text_html": …,
      "posted_at": …,
      "author_username": …,
      "upvote_count": …,
      "depth": …,
      "parent_id": …,
      "rank": …,
      "post_comment_count": …,
      "collected_at": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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