接口说明

X Post API 获取 X 帖子详情及附带的作者、媒体和评论等数据。

使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。

请求URL

POST https://scrapeapi.pangolinfo.com/api/v1/social/x-post

请求头

参数名参数值类型说明
Content-Typeapplication/jsonstring数据格式
AuthorizationBearer xxxstring认证凭证

采集最长约75秒,客户端超时建议设为90秒。

请求参数

参数必填类型说明
targetYesstring帖子链接,也可直接传帖子 id(纯数字,如 20)

仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。

附带评论限一页;需要继续获取评论时调用对应评论接口。

响应值

返回值类型说明
codeinteger状态码,0 表示成功
messagestring响应信息,成功时为 ok
pointCostnumber本次请求实际消耗的积点
dataobject返回数据,结构见下表
metaobject请求标识及耗时(毫秒)
billingobject计费条数、单价及规则版本

返回参数 data 说明

返回值类型说明
typestringType
可用值: [“post”]
posterobject作者
postobjectPost
threadobject[]作者自己的连续推文 (含本帖), 按时间顺序
commentsobject[]首屏回复
paginationobject评论分页 (只能看是否还有更多, 不能续取)

data.poster 字段说明

返回值类型说明
nicknamestring | null显示名, 没有时用用户名
usernamestring | null用户名 (@ 后面那段)
avatarstring | null头像
profileUrlstring | null主页链接
idstring | null用户 id
verifiedboolean是否认证 (蓝标 / 金标 / 灰标)
verificationTypestring | null认证类型: individual / business / government; 未认证为 null
followersCountnumber | null粉丝数; 转发者信息里为 null
followingCountnumber | null关注数; 转发者信息里为 null
protectedboolean是否锁推 (私密)

data.post 字段说明

返回值类型说明
idstring | null帖子 id
urlstring | null帖子链接
contentstring正文 (t.co 短链已展开)
rawTextstring | null原始正文 (含 t.co 短链)
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null点赞数
commentsCountnumber | null回复数
repostsnumber | null转发数
quotesnumber | null引用数
bookmarksnumber | null书签数
viewsnumber | null浏览数; 老帖子没有为 null
langstring | null语言代码
possiblySensitiveboolean是否可能含敏感内容
isNoteTweetboolean是否长文 (Note Tweet)
communityNoteany社区注释 (上游原样); 没有为 null
replyingTostring | null回复的用户名; 不是回复为 null
replyingToStatusstring | null回复的帖子 id
sourcestring | null发布来源客户端; 通常为 null
mediaobject[]媒体
mentionsobject[]正文里的 @ 提及
hashtagsstring | null[]正文里的话题 (不含 #)
urlsobject[]正文里的链接
repostedByobject | null时间线里的转推: 转发者; 原创为 null
quoteobject | null引用的帖子 (字段同本帖, 另带 poster); 没有为 null

data.post.publishedAt 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.post.media[] 字段说明

返回值类型说明
typestring | null媒体类型: photo / video / gif
idstring | null媒体 id
urlstring | null图片 / 视频链接
thumbnailUrlstring | null视频封面; 图片为 null
widthnumber | null宽 (px)
heightnumber | null高 (px)
durationSecnumber | null视频时长 (秒); 图片为 null
formatstring | null视频格式, 如 video/mp4; 图片为 null
variantsobject[]视频各清晰度; 图片为空

data.post.mentions[] 字段说明

返回值类型说明
usernamestring | null被提及用户名
idstring | null被提及用户 id

data.post.urls[] 字段说明

返回值类型说明
urlstring | null完整链接
displaystring | null显示文本

data.post.repostedBy 字段说明

返回值类型说明
nicknamestring | null显示名, 没有时用用户名
usernamestring | null用户名 (@ 后面那段)
avatarstring | null头像
profileUrlstring | null主页链接
idstring | null用户 id
verifiedboolean是否认证 (蓝标 / 金标 / 灰标)
verificationTypestring | null认证类型: individual / business / government; 未认证为 null
followersCountnumber | null粉丝数; 转发者信息里为 null
followingCountnumber | null关注数; 转发者信息里为 null
protectedboolean是否锁推 (私密)

data.post.quote 字段说明

返回值类型说明
idstring | null帖子 id
urlstring | null帖子链接
contentstring正文 (t.co 短链已展开)
rawTextstring | null原始正文 (含 t.co 短链)
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null点赞数
commentsCountnumber | null回复数
repostsnumber | null转发数
quotesnumber | null引用数
bookmarksnumber | null书签数
viewsnumber | null浏览数; 老帖子没有为 null
langstring | null语言代码
possiblySensitiveboolean是否可能含敏感内容
isNoteTweetboolean是否长文 (Note Tweet)
communityNoteany社区注释 (上游原样); 没有为 null
replyingTostring | null回复的用户名; 不是回复为 null
replyingToStatusstring | null回复的帖子 id
sourcestring | null发布来源客户端; 通常为 null
mediaobject[]媒体
mentionsobject[]正文里的 @ 提及
hashtagsstring | null[]正文里的话题 (不含 #)
urlsobject[]正文里的链接
repostedByobject | null时间线里的转推: 转发者; 原创为 null
quoteany引用帖里的引用 (同形)
posterobjectPoster

data.thread[] 字段说明

返回值类型说明
idstring | null帖子 id
urlstring | null帖子链接
contentstring正文 (t.co 短链已展开)
rawTextstring | null原始正文 (含 t.co 短链)
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null点赞数
commentsCountnumber | null回复数
repostsnumber | null转发数
quotesnumber | null引用数
bookmarksnumber | null书签数
viewsnumber | null浏览数; 老帖子没有为 null
langstring | null语言代码
possiblySensitiveboolean是否可能含敏感内容
isNoteTweetboolean是否长文 (Note Tweet)
communityNoteany社区注释 (上游原样); 没有为 null
replyingTostring | null回复的用户名; 不是回复为 null
replyingToStatusstring | null回复的帖子 id
sourcestring | null发布来源客户端; 通常为 null
mediaobject[]媒体
mentionsobject[]正文里的 @ 提及
hashtagsstring | null[]正文里的话题 (不含 #)
urlsobject[]正文里的链接
repostedByobject | null时间线里的转推: 转发者; 原创为 null
quoteobject | null引用的帖子 (字段同本帖, 另带 poster); 没有为 null

data.thread[].publishedAt 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.thread[].media[] 字段说明

返回值类型说明
typestring | null媒体类型: photo / video / gif
idstring | null媒体 id
urlstring | null图片 / 视频链接
thumbnailUrlstring | null视频封面; 图片为 null
widthnumber | null宽 (px)
heightnumber | null高 (px)
durationSecnumber | null视频时长 (秒); 图片为 null
formatstring | null视频格式, 如 video/mp4; 图片为 null
variantsobject[]视频各清晰度; 图片为空

data.thread[].mentions[] 字段说明

返回值类型说明
usernamestring | null被提及用户名
idstring | null被提及用户 id

data.thread[].urls[] 字段说明

返回值类型说明
urlstring | null完整链接
displaystring | null显示文本

data.thread[].repostedBy 字段说明

返回值类型说明
nicknamestring | null显示名, 没有时用用户名
usernamestring | null用户名 (@ 后面那段)
avatarstring | null头像
profileUrlstring | null主页链接
idstring | null用户 id
verifiedboolean是否认证 (蓝标 / 金标 / 灰标)
verificationTypestring | null认证类型: individual / business / government; 未认证为 null
followersCountnumber | null粉丝数; 转发者信息里为 null
followingCountnumber | null关注数; 转发者信息里为 null
protectedboolean是否锁推 (私密)

data.thread[].quote 字段说明

返回值类型说明
idstring | null帖子 id
urlstring | null帖子链接
contentstring正文 (t.co 短链已展开)
rawTextstring | null原始正文 (含 t.co 短链)
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null点赞数
commentsCountnumber | null回复数
repostsnumber | null转发数
quotesnumber | null引用数
bookmarksnumber | null书签数
viewsnumber | null浏览数; 老帖子没有为 null
langstring | null语言代码
possiblySensitiveboolean是否可能含敏感内容
isNoteTweetboolean是否长文 (Note Tweet)
communityNoteany社区注释 (上游原样); 没有为 null
replyingTostring | null回复的用户名; 不是回复为 null
replyingToStatusstring | null回复的帖子 id
sourcestring | null发布来源客户端; 通常为 null
mediaobject[]媒体
mentionsobject[]正文里的 @ 提及
hashtagsstring | null[]正文里的话题 (不含 #)
urlsobject[]正文里的链接
repostedByobject | null时间线里的转推: 转发者; 原创为 null
quoteany引用帖里的引用 (同形)
posterobjectPoster

data.comments[] 字段说明

返回值类型说明
idstring | null帖子 id
urlstring | null帖子链接
contentstring正文 (t.co 短链已展开)
rawTextstring | null原始正文 (含 t.co 短链)
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null点赞数
commentsCountnumber | null回复数
repostsnumber | null转发数
quotesnumber | null引用数
bookmarksnumber | null书签数
viewsnumber | null浏览数; 老帖子没有为 null
langstring | null语言代码
possiblySensitiveboolean是否可能含敏感内容
isNoteTweetboolean是否长文 (Note Tweet)
communityNoteany社区注释 (上游原样); 没有为 null
replyingTostring | null回复的用户名; 不是回复为 null
replyingToStatusstring | null回复的帖子 id
sourcestring | null发布来源客户端; 通常为 null
mediaobject[]媒体
mentionsobject[]正文里的 @ 提及
hashtagsstring | null[]正文里的话题 (不含 #)
urlsobject[]正文里的链接
repostedByobject | null时间线里的转推: 转发者; 原创为 null
quoteobject | null引用的帖子 (字段同本帖, 另带 poster); 没有为 null
timeobject | null回复时间 (同 publishedAt)
avatarstring | null回复者头像
nicknamestring | null回复者显示名
profileUrlstring | null回复者主页
replysany[]不展开楼中楼, 恒为空
replyCountnumber | null该回复的回复数 (同 commentsCount)
posterobject回复者

data.comments[].publishedAt 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.comments[].media[] 字段说明

返回值类型说明
typestring | null媒体类型: photo / video / gif
idstring | null媒体 id
urlstring | null图片 / 视频链接
thumbnailUrlstring | null视频封面; 图片为 null
widthnumber | null宽 (px)
heightnumber | null高 (px)
durationSecnumber | null视频时长 (秒); 图片为 null
formatstring | null视频格式, 如 video/mp4; 图片为 null
variantsobject[]视频各清晰度; 图片为空

data.comments[].mentions[] 字段说明

返回值类型说明
usernamestring | null被提及用户名
idstring | null被提及用户 id

data.comments[].urls[] 字段说明

返回值类型说明
urlstring | null完整链接
displaystring | null显示文本

data.comments[].repostedBy 字段说明

返回值类型说明
nicknamestring | null显示名, 没有时用用户名
usernamestring | null用户名 (@ 后面那段)
avatarstring | null头像
profileUrlstring | null主页链接
idstring | null用户 id
verifiedboolean是否认证 (蓝标 / 金标 / 灰标)
verificationTypestring | null认证类型: individual / business / government; 未认证为 null
followersCountnumber | null粉丝数; 转发者信息里为 null
followingCountnumber | null关注数; 转发者信息里为 null
protectedboolean是否锁推 (私密)

data.comments[].quote 字段说明

返回值类型说明
idstring | null帖子 id
urlstring | null帖子链接
contentstring正文 (t.co 短链已展开)
rawTextstring | null原始正文 (含 t.co 短链)
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null点赞数
commentsCountnumber | null回复数
repostsnumber | null转发数
quotesnumber | null引用数
bookmarksnumber | null书签数
viewsnumber | null浏览数; 老帖子没有为 null
langstring | null语言代码
possiblySensitiveboolean是否可能含敏感内容
isNoteTweetboolean是否长文 (Note Tweet)
communityNoteany社区注释 (上游原样); 没有为 null
replyingTostring | null回复的用户名; 不是回复为 null
replyingToStatusstring | null回复的帖子 id
sourcestring | null发布来源客户端; 通常为 null
mediaobject[]媒体
mentionsobject[]正文里的 @ 提及
hashtagsstring | null[]正文里的话题 (不含 #)
urlsobject[]正文里的链接
repostedByobject | null时间线里的转推: 转发者; 原创为 null
quoteany引用帖里的引用 (同形)
posterobjectPoster

data.comments[].time 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.comments[].poster 字段说明

返回值类型说明
nicknamestring | null显示名, 没有时用用户名
usernamestring | null用户名 (@ 后面那段)
avatarstring | null头像
profileUrlstring | null主页链接
idstring | null用户 id
verifiedboolean是否认证 (蓝标 / 金标 / 灰标)
verificationTypestring | null认证类型: individual / business / government; 未认证为 null
followersCountnumber | null粉丝数; 转发者信息里为 null
followingCountnumber | null关注数; 转发者信息里为 null
protectedboolean是否锁推 (私密)

data.pagination 字段说明

返回值类型说明
commentsobjectComments

data.pagination.comments 字段说明

返回值类型说明
cursornull恒为 null: FxTwitter 游客态回复续页不可用
hasMoreboolean是否还有更多回复

请求示例

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/x-post \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "https://x.com/jack/status/20"
}'

返回示例

下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。

{
  "code": 0,
  "message": "ok",
  "pointCost": 0.8,
  "data": {
    "type": "post",
    "poster": {
      "nickname": "jack",
      "username": "jack",
      "avatar": "https://pbs.twimg.com/profile_images/1661201415899951105/azNjKOSH_200x200.jpg",
      "profileUrl": "https://x.com/jack",
      "id": "12",
      "verified": true,
      "verificationType": "individual",
      "followersCount": 12483523,
      "followingCount": 3,
      "protected": false
    },
    "post": {
      "id": "20",
      "url": "https://x.com/jack/status/20",
      "content": "just setting up my twttr",
      "rawText": "just setting up my twttr",
      "publishedAt": {
        "text": "2006-03-21T20:50:14.000Z",
        "value": 1142974214000
      },
      "likes": 324792,
      "commentsCount": 19221,
      "reposts": 126418,
      "quotes": 7973,
      "bookmarks": 25519,
      "views": null,
      "lang": "en",
      "possiblySensitive": false,
      "isNoteTweet": false,
      "communityNote": null,
      "replyingTo": null,
      "replyingToStatus": null,
      "source": null,
      "media": [],
      "mentions": [],
      "hashtags": [],
      "urls": [],
      "quote": null,
      "repostedBy": null
    },
    "thread": [
      {
        "id": "20",
        "url": "https://x.com/jack/status/20",
        "content": "just setting up my twttr",
        "rawText": "just setting up my twttr",
        "publishedAt": {
          "text": "2006-03-21T20:50:14.000Z",
          "value": 1142974214000
        },
        "likes": 324792,
        "commentsCount": 19221,
        "reposts": 126418,
        "quotes": 7973,
        "bookmarks": 25519,
        "views": null,
        "lang": "en",
        "possiblySensitive": false,
        "isNoteTweet": false,
        "communityNote": null,
        "replyingTo": null,
        "replyingToStatus": null,
        "source": null,
        "media": [],
        "mentions": [],
        "hashtags": [],
        "urls": [],
        "quote": null,
        "repostedBy": null
      }
    ],
    "comments": [
      {
        "time": {
          "text": "2024-03-21T19:02:40.000Z",
          "value": 1711047760000
        },
        "avatar": "https://pbs.twimg.com/profile_images/2068802435938689025/Iqb-7nQc_200x200.jpg",
        "nickname": "𝕯𝖊𝖗𝖇𝖊𝖉𝖊𝖗",
        "profileUrl": "https://x.com/derbederdusler",
        "replys": [],
        "id": "1770888775830262034",
        "url": "https://x.com/derbederdusler/status/1770888775830262034",
        "content": "@jack",
        "rawText": "@jack https://t.co/j0vbZrENcJ",
        "publishedAt": {
          "text": "2024-03-21T19:02:40.000Z",
          "value": 1711047760000
        },
        "likes": 8067,
        "commentsCount": 22,
        "reposts": 140,
        "quotes": 7,
        "bookmarks": 94,
        "views": 468586,
        "lang": null,
        "possiblySensitive": false,
        "isNoteTweet": false,
        "communityNote": null,
        "replyingTo": "jack",
        "replyingToStatus": "20",
        "source": null,
        "media": [
          {
            "type": "photo",
            "id": "1770888772571316224",
            "url": "https://pbs.twimg.com/media/GJN19MHXQAAeNDq.jpg?name=orig",
            "thumbnailUrl": null,
            "width": 1080,
            "height": 786,
            "durationSec": null,
            "format": null,
            "variants": []
          }
        ],
        "mentions": [
          {
            "username": "jack",
            "id": "12"
          }
        ],
        "hashtags": [],
        "urls": [],
        "quote": null,
        "repostedBy": null,
        "replyCount": 22,
        "poster": {
          "nickname": "𝕯𝖊𝖗𝖇𝖊𝖉𝖊𝖗",
          "username": "derbederdusler",
          "avatar": "https://pbs.twimg.com/profile_images/2068802435938689025/Iqb-7nQc_200x200.jpg",
          "profileUrl": "https://x.com/derbederdusler",
          "id": "1420469290369789958",
          "verified": true,
          "verificationType": "individual",
          "followersCount": 3903,
          "followingCount": 7452,
          "protected": false
        }
      }
    ],
    "pagination": {
      "comments": {
        "cursor": null,
        "hasMore": true
      }
    }
  },
  "meta": {
    "requestId": "pg-audit-r1-x-post-1793954335367688500",
    "durationMs": 3319
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 1,
    "pointCost": 0.8
  }
}

积点消耗说明

每条帖子、视频或商家主体消耗 0.8 积点,附带评论、回复和作者资料免费。

空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

在线调试