X
X Works API
获取 X 账号或频道的作品列表。
接口说明
X Works API 获取 X 账号或频道的作品列表。
使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。
请求URL
请求头
| 参数名 | 参数值 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | application/json | string | 数据格式 |
| Authorization | Bearer xxx | string | 认证凭证 |
采集最长约75秒,客户端超时建议设为90秒。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| target | Yes | string | 主页链接,也可直接传用户名(可带 @) |
| options | No | object | 仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。 |
options 参数说明
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| cursor | No | string | 续取时间线: 上次输出的 pagination.cursor |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
每次只取一页,用返回游标续取。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| type | string | Type 可用值: [“works”] |
| works | object[] | 时间线帖子 (含转推) |
| pagination | object | Pagination |
data.works[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| id | string | null | 帖子 id |
| url | string | null | 帖子链接 |
| content | string | 正文 (t.co 短链已展开) |
| rawText | string | null | 原始正文 (含 t.co 短链) |
| publishedAt | object | null | 发布时间 (text 为 ISO) |
| likes | number | null | 点赞数 |
| commentsCount | number | null | 回复数 |
| reposts | number | null | 转发数 |
| quotes | number | null | 引用数 |
| bookmarks | number | null | 书签数 |
| views | number | null | 浏览数; 老帖子没有为 null |
| lang | string | null | 语言代码 |
| possiblySensitive | boolean | 是否可能含敏感内容 |
| isNoteTweet | boolean | 是否长文 (Note Tweet) |
| communityNote | any | 社区注释 (上游原样); 没有为 null |
| replyingTo | string | null | 回复的用户名; 不是回复为 null |
| replyingToStatus | string | null | 回复的帖子 id |
| source | string | null | 发布来源客户端; 通常为 null |
| media | object[] | 媒体 |
| mentions | object[] | 正文里的 @ 提及 |
| hashtags | string | null[] | 正文里的话题 (不含 #) |
| urls | object[] | 正文里的链接 |
| repostedBy | object | null | 时间线里的转推: 转发者; 原创为 null |
| quote | object | null | 引用的帖子 (字段同本帖, 另带 poster); 没有为 null |
| poster | object | 作者 (转推时为原帖作者) |
data.works[].publishedAt 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | null | 上游原始时间文本 |
| value | number | null | 解析后的毫秒时间戳; 解析失败为 null |
data.works[].media[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| type | string | null | 媒体类型: photo / video / gif |
| id | string | null | 媒体 id |
| url | string | null | 图片 / 视频链接 |
| thumbnailUrl | string | null | 视频封面; 图片为 null |
| width | number | null | 宽 (px) |
| height | number | null | 高 (px) |
| durationSec | number | null | 视频时长 (秒); 图片为 null |
| format | string | null | 视频格式, 如 video/mp4; 图片为 null |
| variants | object[] | 视频各清晰度; 图片为空 |
data.works[].mentions[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| username | string | null | 被提及用户名 |
| id | string | null | 被提及用户 id |
data.works[].urls[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| url | string | null | 完整链接 |
| display | string | null | 显示文本 |
data.works[].repostedBy 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| nickname | string | null | 显示名, 没有时用用户名 |
| username | string | null | 用户名 (@ 后面那段) |
| avatar | string | null | 头像 |
| profileUrl | string | null | 主页链接 |
| id | string | null | 用户 id |
| verified | boolean | 是否认证 (蓝标 / 金标 / 灰标) |
| verificationType | string | null | 认证类型: individual / business / government; 未认证为 null |
| followersCount | number | null | 粉丝数; 转发者信息里为 null |
| followingCount | number | null | 关注数; 转发者信息里为 null |
| protected | boolean | 是否锁推 (私密) |
data.works[].quote 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| id | string | null | 帖子 id |
| url | string | null | 帖子链接 |
| content | string | 正文 (t.co 短链已展开) |
| rawText | string | null | 原始正文 (含 t.co 短链) |
| publishedAt | object | null | 发布时间 (text 为 ISO) |
| likes | number | null | 点赞数 |
| commentsCount | number | null | 回复数 |
| reposts | number | null | 转发数 |
| quotes | number | null | 引用数 |
| bookmarks | number | null | 书签数 |
| views | number | null | 浏览数; 老帖子没有为 null |
| lang | string | null | 语言代码 |
| possiblySensitive | boolean | 是否可能含敏感内容 |
| isNoteTweet | boolean | 是否长文 (Note Tweet) |
| communityNote | any | 社区注释 (上游原样); 没有为 null |
| replyingTo | string | null | 回复的用户名; 不是回复为 null |
| replyingToStatus | string | null | 回复的帖子 id |
| source | string | null | 发布来源客户端; 通常为 null |
| media | object[] | 媒体 |
| mentions | object[] | 正文里的 @ 提及 |
| hashtags | string | null[] | 正文里的话题 (不含 #) |
| urls | object[] | 正文里的链接 |
| repostedBy | object | null | 时间线里的转推: 转发者; 原创为 null |
| quote | any | 引用帖里的引用 (同形) |
| poster | object | Poster |
data.works[].poster 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| nickname | string | null | 显示名, 没有时用用户名 |
| username | string | null | 用户名 (@ 后面那段) |
| avatar | string | null | 头像 |
| profileUrl | string | null | 主页链接 |
| id | string | null | 用户 id |
| verified | boolean | 是否认证 (蓝标 / 金标 / 灰标) |
| verificationType | string | null | 认证类型: individual / business / government; 未认证为 null |
| followersCount | number | null | 粉丝数; 转发者信息里为 null |
| followingCount | number | null | 关注数; 转发者信息里为 null |
| protected | boolean | 是否锁推 (私密) |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| cursor | string | null | 下一页游标, 传回 options.cursor 续取 |
| hasMore | boolean | 是否还有更多 |
请求示例
返回示例
下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。
积点消耗说明
每条主体结果消耗 0.8 积点。
空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

