# Gab 单条内容 API (gab.post)

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

单条内容按 `url` 读取一条 Gab 帖子，结果是一个对象而不是列表，正文全文返回，点赞、转发、回复三个数字和帖子带的媒体链接也在里面。它回答「这一条帖子说了什么、反响如何」，适合核实一条被引用的帖子，或者在引用前留一份它当时的互动数据。

`url` 要填帖子的完整链接，建议写成 https://gab.com/<username>/posts/<ID> 的形式，不能填用户主页。`repost_count` 是转发数，不含引用转发。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Gab 帖子完整链接，建议 https://gab.com/<username>/posts/<ID>；post 查单帖，replies 查该帖相关回复上下文。不是用户主页，也不能保证获得完整的全部讨论历史。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| media_urls | 媒体文件链接。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| 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": "gab",
  "action": "post",
  "params": {
    "url": "https://gab.com/a/posts/116982017666460565"
  }
}'
```

```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": "gab",
        "action": "post",
        "params": {
            "url": "https://gab.com/a/posts/116982017666460565",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "gab",
  "action": "post",
  "results": {
    "id": "116982017666460565",
    "url": "https://gab.com/a/posts/116982017666460565",
    "text": "In the desktop web version of\nhttps://\ngab.ai\nyou can now edit docs, presentations, and spreadsheets with Gab AI right in the browser.",
    "author_username": "•••",
    "author_name": "•••",
    "like_count": 135,
    "repost_count": 28,
    "reply_count": 12,
    "media_urls": [
      "https://m3.gab.com/media_attachments/a1/f3/9f/a1f39f58a07a986c616aaea20cddeff2.jpg"
    ],
    "posted_at": "2026-07-25T18:25:31.686000+00:00",
    "platform": "gab"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `url` 可以填账号主页吗？

不可以。这一页要的是帖子的完整链接，建议写成 https://gab.com/<username>/posts/<ID>。想读一个账号发的帖子，要用用户内容那一页，传的是用户名，不是帖子链接。

### `repost_count` 包含引用转发吗？

不包含，它区别于引用转发，只算转发。和 `like_count`、`reply_count` 一样，null 表示不公开，不等于 0。要估算一条帖子的传播，别把没公开的数据当成没人转发。

### 怎么读这条帖子的回复？

用回复列表那一页，同样传这条帖子的链接。这一页只返回帖子本身，`reply_count` 只是回复数的数字，不会把回复内容带回来。`media_urls` 是帖子带的媒体文件链接，需要留存时要自己下载。

## Also

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