---
seo:
  description: TwexAPI 通过 https://api.twexapi.io 对外提供标准的 RESTful API，全面支持 Twitter/X…
sidebar:
  label: Overview
title: TwexAPI REST API 规范参考
---
TwexAPI 通过 `https://api.twexapi.io` 对外提供标准的 RESTful API，全面支持 Twitter/X 平台的数据读取、内容写入、推文高级搜索、用户资料与社交图谱导出、私信收发、话题趋势榜单、长文章处理、社区动态及 AI Agent 集成等全套功能。

**核心功能与能力：**

* **推文高级搜索 (Search)** — 关键词、Hashtag 话题标签、Cashtag 金融代码检索，支持复杂布尔逻辑与时间窗口过滤
* **推文与互动分析 (Tweets)** — 获取完整推文串（Thread）、推文详情、评论回复列表、点赞/转推/引用用户导出、AI 情感倾向分析
* **用户与社交图谱 (Users)** — 用户公开资料卡查询、批量多用户解析、基于游标（Cursor）的大规模粉丝与关注列表导出
* **发推与互动写操作 (Tweet Actions)** — 自动化发推、跟帖回复、一键发布推文串、点赞、转推、收藏、关注、修改个人资料
* **私信会话管理 (Direct Messages)** — 发送纯文本或媒体私信、权限检查、会话列表及历史聊天记录提取
* **全球热搜榜单 (Trending)** — 全球及各国家地区热门趋势推文、热搜话题分类
* **X 长文章 (Articles)** — 一键将 X Articles 提取为干净规范的 Markdown（专为大模型 RAG 语料优化）、长文章草稿与一站式发布流水线

所有接口成功时均返回统一封装格式（包含 `code: 200`、`msg: "success"` 和 `data` 数据节点）。详见 [错误处理指南](/zh/guides/error-handling)。

## 身份认证 (Authentication)

所有 API 请求均须在 HTTP 请求头中携带您的 API 密钥：

```txt
Authorization: Bearer YOUR_API_KEY
```

对于发推、点赞、转推、关注、发私信等写操作，还需在请求参数中附带目标账号的 Twitter Cookie 或 `auth_token`。完整凭据提取与调用示例请查阅 [身份认证与鉴权指南](/zh/authentication)。

<ApiOverview source="zh-api-reference" />

## Cookie Endpoints

<ApiTagOperations source="zh-api-reference" tag="cookie-endpoints" />

## Search Endpoints

<ApiTagOperations source="zh-api-reference" tag="search-endpoints" />

## Tweet Actions Endpoints

<ApiTagOperations source="zh-api-reference" tag="tweet-actions-endpoints" />

## Users Endpoints

<ApiTagOperations source="zh-api-reference" tag="users-endpoints" />

## Followers & Following Endpoints

<ApiTagOperations source="zh-api-reference" tag="followers-following-endpoints" />

## Tweet Replies Endpoints

<ApiTagOperations source="zh-api-reference" tag="tweet-replies-endpoints" />

## DM Endpoints

<ApiTagOperations source="zh-api-reference" tag="dm-endpoints" />

## Article Endpoints

<ApiTagOperations source="zh-api-reference" tag="article-endpoints" />

## Tweets Endpoints

<ApiTagOperations source="zh-api-reference" tag="tweets-endpoints" />

## Grok Endpoints

<ApiTagOperations source="zh-api-reference" tag="grok-endpoints" />

## Tweet Engagement Endpoints

<ApiTagOperations source="zh-api-reference" tag="tweet-engagement-endpoints" />

## Lists Endpoints

<ApiTagOperations source="zh-api-reference" tag="lists-endpoints" />

## Communities Endpoints

<ApiTagOperations source="zh-api-reference" tag="communities-endpoints" />

## Twitter Profile Actions Endpoints

<ApiTagOperations source="zh-api-reference" tag="twitter-profile-actions-endpoints" />

## Trending Endpoints

<ApiTagOperations source="zh-api-reference" tag="trending-endpoints" />

## Timeline Endpoints

<ApiTagOperations source="zh-api-reference" tag="timeline-endpoints" />

## All Tweets Replies Endpoints

<ApiTagOperations source="zh-api-reference" tag="all-tweets-replies-endpoints" />

## Twitter Account Based in Endpoints

<ApiTagOperations source="zh-api-reference" tag="twitter-account-based-in-endpoints" />

## Twitter User About Endpoints

<ApiTagOperations source="zh-api-reference" tag="twitter-user-about-endpoints" />

## Balance Endpoints

<ApiTagOperations source="zh-api-reference" tag="balance-endpoints" />
