# Lobsters 标签下的帖子 API (lobsters.tag_posts)

- Canonical page: [https://everyinfra.com/lobsters-api/tag_posts](https://everyinfra.com/lobsters-api/tag_posts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "lobsters", "action": "tag_posts", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of 25 per call (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- 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=tag_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| tag | not declared | yes | not declared | Lobsters 标签名，如 programming、rust，就是标签页链接 https://lobste.rs/t/<标签名> 里的那一段；大小写都收。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页，其他参数和第一页一样；不传从第一页开始。每页算一次调用；没有 next_page_token 就是最后一页。每页最多 25 条，按标签页的顺序。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 编号：story 的 short_id（如 5kmyma，trending、latest_posts、tag_posts、post_detail），或评论的 short_id（comments）。 |
| url | Lobsters 上的链接：story 的讨论页（trending、latest_posts、tag_posts、post_detail），或用户主页（profile）。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文：story 自带的文字（没有自带文字的链接 story 没有这个字段），或评论的纯文本（comments）。 |
| upvote_count | 净得分：赞减踩（story 和评论都有）；平台不分开给赞和踩。 |
| comment_count | story 的评论数（trending、latest_posts、tag_posts、post_detail）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| tags | 标签数组。无标签时为空数组，不是 null。 |
| links | story 提交的外部链接列表（trending、latest_posts、tag_posts、post_detail）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| rank | 这一行在这一次结果里的位置，从 1 开始（trending、latest_posts、tag_posts、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": "tag_posts",
  "params": {
    "tag": "programming"
  }
}'
```

```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": "tag_posts",
        "params": {
            "tag": "programming",
        },
    },
    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": "tag_posts",
  "results": [
    {
      "id": …,
      "url": …,
      "title": …,
      "text": …,
      "upvote_count": …,
      "comment_count": …,
      "author_username": …,
      "tags": …,
      "links": …,
      "posted_at": …,
      "rank": …,
      "collected_at": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "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
