> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sorsa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API 参考指南

# 完整 API 参考：所有 Sorsa 端点

下方按类别列出了所有 Sorsa API 端点。每个端点使用相同的基础 URL（`https://api.sorsa.io/v3`），并通过 `ApiKey` 请求头验证身份。无论使用哪个端点，每次调用都只扣除 1 次请求配额。新账号包含 100 次免费请求，可测试所有可用端点，无需信用卡。

点击各端点旁的**文档**链接，查看详细参数表、响应结构，并进行交互式测试。也可通过 [API Playground](https://api.sorsa.io/playground) 无代码测试任意端点。

***

## 用户数据

获取用户资料、粉丝和关注列表，以及账号元数据。

| 端点                    | 方法  | 说明                                                              | 文档                                                                              |
| :-------------------- | :-- | :-------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| `/info`               | GET | 单个账号的完整资料（简介、计数、认证状态、头像）。支持 `username`、`user_id` 或 `user_link`。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/users-data/user-profile)       |
| `/info-batch`         | GET | 一次获取最多 100 个账号的资料。支持 `usernames[]` 或 `user_ids[]`。              | [文档](https://docs.sorsa.io/zh-Hans/api-reference/users-data/user-profile-batch) |
| `/about`              | GET | 账号元数据：国家、用户名变更次数和日期、X Premium（Blue）状态及开始日期、账号来源和关联账号。           | [文档](https://docs.sorsa.io/zh-Hans/api-reference/users-data/account-about-info) |
| `/followers`          | GET | 分页粉丝列表，包含完整资料。每页最多 200 位用户。                                     | [文档](https://docs.sorsa.io/zh-Hans/api-reference/users-data/followers)          |
| `/follows`            | GET | 分页关注列表，包含完整资料。每页最多 200 位用户。                                     | [文档](https://docs.sorsa.io/zh-Hans/api-reference/users-data/following)          |
| `/verified-followers` | GET | 仅包含认证粉丝的分页列表。                                                   | [文档](https://docs.sorsa.io/zh-Hans/api-reference/users-data/verified-followers) |

**相关指南：**[粉丝与关注](https://docs.sorsa.io/zh-Hans/followers-and-following) | [受众地理分布](https://docs.sorsa.io/zh-Hans/Audience-Geography) | [竞品分析](https://docs.sorsa.io/zh-Hans/Competitor-Analysis)

***

## 推文

获取推文内容、互动指标、回复、引用、转推用户、长文章和热门话题。

| 端点                 | 方法   | 说明                                                                      | 文档                                                                        |
| :----------------- | :--- | :---------------------------------------------------------------------- | :------------------------------------------------------------------------ |
| `/tweet-info`      | POST | 单条推文的完整数据（正文、指标、作者资料）。请求体：`tweet_link`。                                 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/tweet-data)       |
| `/tweet-info-bulk` | POST | 一次获取最多 100 条推文的完整数据。请求体：`tweet_links[]`。                                | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/tweet-data-batch) |
| `/user-tweets`     | POST | 用户推文的分页时间线。请求体：`user_link`、`username` 或 `user_id`。                      | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/user-tweets)      |
| `/comments`        | POST | 指定推文下的回复。请求体：`tweet_link`（可选 `order_by`：`Relevance`、`Recency`、`Likes`）。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/tweet-comments)   |
| `/quotes`          | POST | 指定推文的引用推文。请求体：`tweet_link`。                                             | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/quote-tweets)     |
| `/retweeters`      | POST | 转推某条推文的用户（返回用户资料，而非推文）。请求体：`tweet_link`。                                | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/retweeters-list)  |
| `/article`         | POST | X 文章（长文章）的完整内容。请求体：`tweet_link`。                                        | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/article-data)     |
| `/trends`          | GET  | 某地区的热门话题。查询参数：`woeid`（Where On Earth IDentifier）。                       | [文档](https://docs.sorsa.io/zh-Hans/api-reference/tweets/trends-list)      |

**相关指南：**[搜索推文](https://docs.sorsa.io/zh-Hans/search-tweets) | [推文互动](https://docs.sorsa.io/zh-Hans/tweet-engagement) | [X 文章](https://docs.sorsa.io/zh-Hans/x-articles) | [历史数据](https://docs.sorsa.io/zh-Hans/historical-data)

***

## 搜索

搜索推文、提及和用户资料，以及查询 X Spaces。

| 端点               | 方法   | 说明                                                                                                           | 文档                                                                          |
| :--------------- | :--- | :----------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| `/search-tweets` | POST | 按关键词搜索推文，完整支持 X 搜索运算符。请求体：`query`、`order`、`next_cursor`。                                                     | [文档](https://docs.sorsa.io/zh-Hans/api-reference/search/search-tweets)      |
| `/mentions`      | POST | 提及特定用户名的推文，支持互动和日期筛选。请求体：`query`、`order`、`min_likes`、`min_retweets`、`min_replies`、`since_date`、`until_date`。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/search/search-mentions)    |
| `/search-users`  | POST | 按关键词搜索用户资料（匹配简介、显示名称、用户名）。请求体：`query`。                                                                       | [文档](https://docs.sorsa.io/zh-Hans/api-reference/search/search-users)       |
| `/spaces`        | GET  | X Space 的完整数据：元数据、创建者资料、参与者、设置和统计。查询参数：`id` 或 `link`。                                                        | [文档](https://docs.sorsa.io/zh-Hans/api-reference/search/spaces-information) |

**相关指南：**[搜索推文](https://docs.sorsa.io/zh-Hans/search-tweets) | [追踪提及](https://docs.sorsa.io/zh-Hans/search-mentions) | [搜索运算符](https://docs.sorsa.io/zh-Hans/search-operators) | [发现目标受众](https://docs.sorsa.io/zh-Hans/target-audiences-Discovery)

***

## 行为验证

检查用户是否完成了特定行为，包括关注、转推、评论、引用和加入社群，专为活动与抽奖验证而设计。

| 端点                        | 方法   | 说明                                                                                                                                                      | 文档                                                                                        |
| :------------------------ | :--- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------- |
| `/check-follow`           | POST | 检查 `user_2` 是否关注 `user_1`（user\_1 为被关注账号，user\_2 为可能的粉丝）。请求体：双方各一个标识符（`username_1`/`user_id_1`/`user_link_1` 和 `username_2`/`user_id_2`/`user_link_2`）。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/verification/check-follow)               |
| `/check-comment`          | GET  | 用户是否评论了指定推文？找到时返回评论推文。查询参数：`tweet_link` + `username`/`user_id`/`user_link`。                                                                             | [文档](https://docs.sorsa.io/zh-Hans/api-reference/verification/check-comment)              |
| `/check-retweet`          | POST | 用户是否转推了指定推文？每次最多检查 100 次转推。请求体：`tweet_link` + 用户标识符。                                                                                                    | [文档](https://docs.sorsa.io/zh-Hans/api-reference/verification/check-retweet)              |
| `/check-quoted`           | POST | 用户是否引用或转推了指定推文？返回 `status`：`quoted`、`retweet` 或 `not_found`。请求体：`tweet_link` + 用户标识符。                                                                   | [文档](https://docs.sorsa.io/zh-Hans/api-reference/verification/check-quote-or-retweet)     |
| `/check-community-member` | POST | 用户是否属于指定 X 社群？请求体：`community_id` + 用户标识符。                                                                                                               | [文档](https://docs.sorsa.io/zh-Hans/api-reference/verification/check-community-membership) |
| `/check-shadowban`        | GET  | 检查可见性，结果为 `clean`、`banned` 或 `unknown`。查询参数：`username`。通过 `checked_at` 查看缓存数据的时间。                                                                       | [文档](https://docs.sorsa.io/zh-Hans/api-reference/verification/check-shadowban)            |

**相关指南：**[营销活动验证](https://docs.sorsa.io/zh-Hans/Marketing-Campaign-Verification)

***

## 社群

访问 X 社群数据，包括成员列表、推文流和社群内搜索。

| 端点                         | 方法   | 说明                                                      | 文档                                                                                  |
| :------------------------- | :--- | :------------------------------------------------------ | :---------------------------------------------------------------------------------- |
| `/community-tweets`        | POST | 社群推文流。请求体：`community_id`、`order`（`popular` 或 `latest`）。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/community/community-tweets)        |
| `/community-search-tweets` | POST | 在社群内按关键词搜索推文。请求体：`community_link`、`query`、`order`。      | [文档](https://docs.sorsa.io/zh-Hans/api-reference/community/search-community-tweets) |
| `/community-members`       | POST | 社群成员列表及资料。请求体：`community_link`。                         | [文档](https://docs.sorsa.io/zh-Hans/api-reference/community/community-members)       |

**相关指南：**[列表与社群](https://docs.sorsa.io/zh-Hans/lists-and-communities)

***

## 列表

访问 X 列表数据，包括成员资料、订阅者和汇总推文流。

| 端点                | 方法  | 说明                           | 文档                                                                     |
| :---------------- | :-- | :--------------------------- | :--------------------------------------------------------------------- |
| `/list-members`   | GET | 列表内账号的资料。查询参数：`list_id`。     | [文档](https://docs.sorsa.io/zh-Hans/api-reference/lists/list-members)   |
| `/list-followers` | GET | 订阅该列表的用户资料。查询参数：`list_link`。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/lists/list-followers) |
| `/list-tweets`    | GET | 全部列表成员的最新推文。查询参数：`list_id`。  | [文档](https://docs.sorsa.io/zh-Hans/api-reference/lists/list-tweets)    |

**相关指南：**[列表与社群](https://docs.sorsa.io/zh-Hans/lists-and-communities) | [实时监测](https://docs.sorsa.io/zh-Hans/real-time-monitoring)

***

## Sorsa Score（加密货币分析）

面向加密货币领域的分析端点：影响力评分、粉丝分类，以及 Sorsa 数据库中加密货币账号最近的关注活动。支持 `username`、`user_id` 或 `user_link`。

| 端点                  | 方法  | 说明                                     | 文档                                                                                                    |
| :------------------ | :-- | :------------------------------------- | :---------------------------------------------------------------------------------------------------- |
| `/score`            | GET | 当前 Sorsa Score（加密货币领域影响力指标）。           | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/sorsa-score)               |
| `/score-changes`    | GET | 最近一周和一个月的分数变化量。                        | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/sorsa-score-changes)       |
| `/followers-stats`  | GET | 粉丝类别分布：意见领袖、项目、VC。                     | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/follower-category-stats)   |
| `/top-followers`    | GET | 按 Sorsa Score 排名的前 20 位粉丝（每项包含该粉丝的分数）。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/top-20-followers-by-score) |
| `/top-following`    | GET | 按分数排名的前 20 个关注对象。                      | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/top-20-following-by-score) |
| `/new-followers-7d` | GET | 最近 7 天新增的加密货币账号粉丝。                     | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/new-followers-7-days)      |
| `/new-following-7d` | GET | 用户最近 7 天新关注的加密货币账号。                    | [文档](https://docs.sorsa.io/zh-Hans/api-reference/sorsa-info-crypto-related/new-following-7-days)      |

**相关指南：**[Sorsa Score 与加密货币分析](https://docs.sorsa.io/zh-Hans/sorsa-score-and-crypto-analytics)

***

## 技术工具

用于 ID 转换和 API 密钥用量监控。

| 端点                              | 方法  | 说明                             | 文档                                                                                                    |
| :------------------------------ | :-- | :----------------------------- | :---------------------------------------------------------------------------------------------------- |
| `/username-to-id/{user_handle}` | GET | 将用户名转换为永久用户 ID。                | [文档](https://docs.sorsa.io/zh-Hans/api-reference/technical-endpoints/convert-username-to-user-id)     |
| `/id-to-username/{user_id}`     | GET | 将用户 ID 转换为当前用户名。               | [文档](https://docs.sorsa.io/zh-Hans/api-reference/technical-endpoints/convert-user-id-to-username)     |
| `/link-to-id`                   | GET | 从个人资料 URL 提取用户 ID。查询参数：`link`。 | [文档](https://docs.sorsa.io/zh-Hans/api-reference/technical-endpoints/convert-profile-link-to-user-id) |
| `/key-usage-info`               | GET | 当前请求用量、剩余配额和余额到期日期。无需参数。       | [文档](https://docs.sorsa.io/zh-Hans/api-reference/technical-endpoints/api-key-usage)                   |

**相关指南：**[ID 转换](https://docs.sorsa.io/zh-Hans/ID-Conversion) | [价格](https://docs.sorsa.io/zh-Hans/pricing)

***

## 数据模型

大多数端点使用两个核心对象。所有变体、字段类型和边界情况请参阅[响应格式](https://docs.sorsa.io/zh-Hans/response-format)。

### User 对象

由 `/info`、`/info-batch`，以及粉丝、关注和用户搜索端点返回，也会通过 `user` 字段嵌入每条推文响应。部分加密货币分析端点会添加 `followerDate`；普通 `/followers` 和 `/follows` 响应使用标准 User 模型。这些变体见[响应格式](https://docs.sorsa.io/zh-Hans/response-format)。

| 字段                             | 类型        | 说明                 |
| :----------------------------- | :-------- | :----------------- |
| `id`                           | string    | 永久用户 ID（Snowflake） |
| `username`                     | string    | 当前用户名              |
| `display_name`                 | string    | 显示名称               |
| `description`                  | string    | 简介文本               |
| `location`                     | string    | 用户自行填写的所在地         |
| `created_at`                   | string    | 账号创建日期（ISO 8601）   |
| `followers_count`              | integer   | 粉丝数                |
| `followings_count`             | integer   | 关注数                |
| `favourites_count`             | integer   | 累计点赞次数             |
| `tweets_count`                 | integer   | 累计发布推文数            |
| `media_count`                  | integer   | 媒体帖子数              |
| `verified`                     | boolean   | 认证状态               |
| `protected`                    | boolean   | 受保护（私有）账号          |
| `can_dm`                       | boolean   | 是否开放私信             |
| `possibly_sensitive`           | boolean   | 敏感内容标记             |
| `profile_image_url`            | string    | 头像 URL             |
| `profile_background_image_url` | string    | 横幅图片 URL           |
| `bio_urls`                     | string\[] | 从简介提取的 URL         |
| `pinned_tweet_ids`             | string\[] | 置顶推文 ID            |

### Tweet 对象

由 `/tweet-info`、`/search-tweets`、`/user-tweets`、`/comments`、`/quotes`、`/mentions`、`/list-tweets` 和社群推文端点返回。

| 字段                     | 类型             | 说明               |
| :--------------------- | :------------- | :--------------- |
| `id`                   | string         | 推文 ID（Snowflake） |
| `full_text`            | string         | 完整推文正文           |
| `created_at`           | string         | 发布时间戳（ISO 8601）  |
| `lang`                 | string         | 语言代码             |
| `likes_count`          | integer        | 点赞数              |
| `retweet_count`        | integer        | 转推数              |
| `reply_count`          | integer        | 回复数              |
| `quote_count`          | integer        | 引用数              |
| `bookmark_count`       | integer        | 收藏数              |
| `view_count`           | integer        | 浏览数              |
| `conversation_id_str`  | string         | 对话串/会话 ID        |
| `in_reply_to_tweet_id` | string         | 父推文 ID（若为回复）     |
| `in_reply_to_username` | string         | 父推文作者（若为回复）      |
| `is_reply`             | boolean        | 是否为回复            |
| `is_quote_status`      | boolean        | 是否为引用推文          |
| `is_replies_limited`   | boolean        | 作者是否限制回复         |
| `made_with_ai`         | boolean        | 是否标记为 AI 生成      |
| `paid_partnership`     | boolean        | 付费合作（品牌内容）       |
| `user`                 | User           | 完整作者资料           |
| `entities`             | TweetEntity\[] | 附带的媒体和链接实体       |
| `quoted_status`        | Tweet          | 嵌套的被引用推文（若为引用）   |
| `retweeted_status`     | Tweet          | 嵌套的被转推推文（若为转推）   |

### TweetEntity 对象

| 字段        | 类型     | 说明                           |
| :-------- | :----- | :--------------------------- |
| `type`    | string | 实体类型：`photo`、`video` 或 `url` |
| `link`    | string | 直接链接（t.co URL）               |
| `preview` | string | 预览/缩略图 URL                   |

***

## 通用方式

**身份验证：** 所有请求都需要 `ApiKey` 请求头。参阅[身份验证](https://docs.sorsa.io/zh-Hans/authentication)。

**分页：** 支持分页的端点使用游标分页。批量查询和 `/top-followers` 等加密货币分析列表无需游标即可返回结果。传入上一响应的 `next_cursor` 获取下一页；游标缺失或为 null 时表示已到末尾。参阅[分页](https://docs.sorsa.io/zh-Hans/pagination)。

**错误格式：** 所有端点发生 `400`、`401`、`403`、`404`、`429`、`500` 错误时，都返回 `{ "message": "..." }`。参阅[错误码](https://docs.sorsa.io/zh-Hans/error-codes)。

**速率限制：** 所有标准套餐均为每秒 20 次请求。参阅[速率限制](https://docs.sorsa.io/zh-Hans/rate-limits)。

**灵活的输入：** 大多数用户相关端点支持 `username`、`user_id` 或 `user_link`（个人资料 URL）三种输入格式。每次只提供其中一种。

***

## 后续步骤

* [快速入门](https://docs.sorsa.io/zh-Hans/quickstart)：不到一分钟即可完成首次 API 调用
* [响应格式](https://docs.sorsa.io/zh-Hans/response-format)：详细字段类型、null 处理和对象结构
* [搜索运算符](https://docs.sorsa.io/zh-Hans/search-operators)：为 `/search-tweets` 构建高级查询
* [优化 API 使用](https://docs.sorsa.io/zh-Hans/optimizing-api-usage)：通过批量、去重和缓存减少请求次数
