# X（推特）API

21 个接口读 X（推特）：帖子、用户、对话串、热榜、X 社群、X 列表。一次 $0.0003 起。不用登录 X，不用 Cookie；失败不收费。

也叫：X (Twitter)

近 30 天可用 100%：接口在接调用的时间占比

## 接口

### 帖子 (7)

| 接口 | 请求 | 返回 | 价格 |
| --- | --- | --- | --- |
| [X 帖子搜索](https://dataxapi.com/zh/apis/x/posts/search.md) | `GET /v1/x/posts/search` | 内容列表 | $0.0020 / 次 |
| [X 长文详情](https://dataxapi.com/zh/apis/x/posts/article/get.md) | `GET /v1/x/posts/article/get` | 内容 | $0.0020 / 次 |
| [X 帖子详情](https://dataxapi.com/zh/apis/x/posts/get.md) | `GET /v1/x/posts/get` | 内容 | $0.0003 / 次 |
| [X 视频字幕](https://dataxapi.com/zh/apis/x/posts/transcript/get.md) | `GET /v1/x/posts/transcript/get` | 逐字稿 | $0.0020 / 次 |
| [X 帖子引用列表](https://dataxapi.com/zh/apis/x/posts/quotes/list.md) | `GET /v1/x/posts/quotes/list` | 内容列表 | $0.0003 / 条 |
| [X 帖子回复列表](https://dataxapi.com/zh/apis/x/posts/replies/list.md) | `GET /v1/x/posts/replies/list` | 内容列表 | $0.0020 / 次 |
| [X 帖子转推用户](https://dataxapi.com/zh/apis/x/posts/retweeters/list.md) | `GET /v1/x/posts/retweeters/list` | 账号列表 | $0.0020 / 次 |

### 用户 (6)

| 接口 | 请求 | 返回 | 价格 |
| --- | --- | --- | --- |
| [X 用户搜索](https://dataxapi.com/zh/apis/x/users/search.md) | `GET /v1/x/users/search` | 账号列表 | $0.0004 / 条 |
| [X 用户资料](https://dataxapi.com/zh/apis/x/users/get.md) | `GET /v1/x/users/get` | 账号 | $0.0004 / 条 |
| [X 用户粉丝列表](https://dataxapi.com/zh/apis/x/users/followers/list.md) | `GET /v1/x/users/followers/list` | 账号列表 | $0.0001 / 条 |
| [X 用户关注列表](https://dataxapi.com/zh/apis/x/users/following/list.md) | `GET /v1/x/users/following/list` | 账号列表 | $0.0001 / 条 |
| [X 用户提及](https://dataxapi.com/zh/apis/x/users/mentions/list.md) | `GET /v1/x/users/mentions/list` | 内容列表 | $0.0003 / 条 |
| [X 用户帖子列表](https://dataxapi.com/zh/apis/x/users/posts/list.md) | `GET /v1/x/users/posts/list` | 内容列表 | $0.0020 / 次 |

### 对话串 (1)

| 接口 | 请求 | 返回 | 价格 |
| --- | --- | --- | --- |
| [X 帖子对话串](https://dataxapi.com/zh/apis/x/threads/posts/list.md) | `GET /v1/x/threads/posts/list` | 内容列表 | $0.0003 / 条 |

### 热榜 (1)

| 接口 | 请求 | 返回 | 价格 |
| --- | --- | --- | --- |
| [X 趋势榜](https://dataxapi.com/zh/apis/x/trends/list.md) | `GET /v1/x/trends/list` | 热点列表 | $0.0090 / 次 |

### [X 社群](https://dataxapi.com/zh/apis/x/communities.md) (3)

X 的社群（Communities）：社群资料、社群里的帖子和成员。

| 接口 | 请求 | 返回 | 价格 |
| --- | --- | --- | --- |
| [X 社群资料](https://dataxapi.com/zh/apis/x/communities/get.md) | `GET /v1/x/communities/get` | 社区 | $0.0004 / 次 |
| [X 社群成员](https://dataxapi.com/zh/apis/x/communities/members/list.md) | `GET /v1/x/communities/members/list` | 账号列表 | $0.0004 / 条 |
| [X 社群帖子](https://dataxapi.com/zh/apis/x/communities/posts/list.md) | `GET /v1/x/communities/posts/list` | 内容列表 | $0.0003 / 条 |

### [X 列表](https://dataxapi.com/zh/apis/x/lists.md) (3)

X 的列表（Lists）：列表里的帖子、成员和关注者。

| 接口 | 请求 | 返回 | 价格 |
| --- | --- | --- | --- |
| [X 列表关注者](https://dataxapi.com/zh/apis/x/lists/followers/list.md) | `GET /v1/x/lists/followers/list` | 账号列表 | $0.0004 / 条 |
| [X 列表成员](https://dataxapi.com/zh/apis/x/lists/members/list.md) | `GET /v1/x/lists/members/list` | 账号列表 | $0.0004 / 条 |
| [X 列表帖子](https://dataxapi.com/zh/apis/x/lists/posts/list.md) | `GET /v1/x/lists/posts/list` | 内容列表 | $0.0020 / 次 |

## 调用前要知道的

- **每页条数**：列表每页 20 到 200 条，各接口不同。16 个列表里有 14 个能翻页：把 `page.next_cursor` 作为 `cursor` 传回，每一页是一次单独的调用。其余只有一页。
- **给不了的字段**：21 个接口里有 16 个填不满它返回的对象。每个接口的页面列出了给不了哪些，每次返回也在 `meta.unavailable` 里再写一遍：缺的字段不会被悄悄写成 0。
- **对象不存在时读起来像空结果**：X 社群帖子、X 列表帖子、X 帖子引用列表、X 帖子回复列表、X 帖子转推用户、X 帖子对话串、X 用户粉丝列表、X 用户关注列表、X 用户提及、X 用户帖子列表、X 社群成员、X 列表关注者、X 列表成员：对象不存在和对象下面没有东西分不出来，所以返回空结果而不是 404，并按空结果计费。
- **一次取多个**：用 `ids` 一次请求可以取多个：X 用户资料（最多 100 个）。
- **预览结构**：有 1 个接口返回的是预览结构，字段还可能调整；其余返回统一的结构，所有平台都一样。
- **快照**：X 趋势榜：榜单是每 5 分钟刷新一次的快照，`meta.fetched_at` 写明是什么时候取的。

## 调用结果不对时先看这里

- **账号名还是编号**：粉丝、关注、提及和用户帖子用 `username`，就是不带 @ 的账号名；用户资料可以用账号名、编号，或者一次最多 100 个 `ids`。
- **账号或帖子不存在时**：粉丝、关注、提及、引用、转推这几个，对象不存在时返回空列表，按空结果计费。用户帖子、帖子回复、列表帖子则返回 `upstream_failed`，不扣费，可以再试一次。
- **几个数各是什么**：`metrics.comments` 是回复数，`metrics.favorites` 是书签数，`metrics.reposts` 是转推数；引用另算，在 `ext.quotes`。
- **列表关注者只有一页**：`x.lists.followers.list` 最多返回 20 个账号，没有下一页。
- **视频转文字限两分钟**：超过两分钟的视频按参数不合法拒绝；没人说话的视频、没有视频的帖子、不存在的帖子，都按不存在返回。两种都不扣费。

## 常见问题

### X（推特）API 怎么收费？

按次收费，没有订阅。一次 $0.0003 到 $0.0400，每个接口的页面写明自己的价格。有 11 个接口按返回的条数计费，每次有最低和最高。拿到数据才扣费，失败不收。

### 需要 X 账号或 Cookie 吗？

不需要。你只拿一把 DataXAPI 的 Key：不用登录 X，不用 Cookie，也不用养设备。接口只返回公开可见的数据。

### 数据是实时的吗？

每次调用都当场去 X 取，`meta.fetched_at` 写明取到的时间。X 趋势榜：榜单是每 5 分钟刷新一次的快照。结果保留 24 小时，带同一个 `Idempotency-Key` 重试不会再扣一次。

### 空结果收费吗？

16 个接口里有 15 个在列表返回空结果时照价收费：搜索已经执行了。读单个对象而对象不存在时返回 `not_found`，收不收费看接口页。

### X 改版了怎么办？

调用失败不管什么原因都不扣费。被暂停的接口返回 `capability_paused`，同样不扣费；`GET /v1/catalog/status` 写着现在哪些能用。

## 怎么做和常见问题

- [如何按关键词搜索 X（推特）帖子](https://dataxapi.com/zh/guides/x-search-posts-by-keyword.md)
- [如何获取 X（推特）各国热门话题](https://dataxapi.com/zh/guides/x-trends-by-country.md)
- [如何批量获取一条推文的回复](https://dataxapi.com/zh/guides/x-post-replies.md)
- [怎么查某个国家的 X 热搜？](https://dataxapi.com/zh/answers/how-to-get-x-trends-for-a-country.md)

---

怎么调用、怎么计费、怎么处理报错，所有接口都一样：https://dataxapi.com/zh/llms.txt

最后核对于 2026-11-02 11:50 UTC。目录修订号 0568dd5a20b9e888。 [网页版](https://dataxapi.com/zh/apis/x/)
