Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Twitter User Published Posts

API 文档
https://api.sandbase.ai/v1/api/twitter/user-posts

Get posts published by an X (Twitter) user identified by Rest ID, with cursor pagination. Use it to browse a known account's timeline or continue through its public post history.

价格
$0.014286美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 1 个可选

Playground

输入
The unique numeric identifier (Rest ID) for the X user.
Pagination cursor for navigating through long timelines.
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

Twitter User Published Posts API

Returns recent posts published by an X (Twitter) account, plus the account's pinned post and basic profile data. It needs the numeric restId of the user and supports cursor pagination.

Use cases

  • Pull the latest posts from a known account to monitor what it publishes.
  • Track likes, retweets, replies and views on each post of a public figure over time.
  • Separate original posts from retweets and quote posts when you analyze an account's activity.
  • Page back through an account's public post history with next_cursor.

Request

curl -X POST "https://api.sandbase.ai/v1/api/twitter/user-posts" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"restId": "44196397"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
restIdstringYesThe unique numeric identifier (Rest ID) for the X user.
cursorstringNoPagination cursor for navigating through long timelines.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "next_cursor": "DAAHCgABHWL0Tx3__-oLAAIAAAATMjExNzI3MjgyNDgzMDIxMDM5MQgAAwAAAAIAAA",
  "pinned": {
    "author": {
      "avatar": "https://pbs.twimg.com/profile_images/2103567689515954176/aR-Kjpp4_normal.jpg",
      "blue_verified": true,
      "followers_count": 241472215,
      "name": "Elon Musk",
      "rest_id": "44196397",
      "screen_name": "elonmusk"
    },
    "bookmarks": 21300,
    "conversation_id": "2116039632743702637",
    "created_at": "Fri Oct 30 05:28:57 +0000 2026",
    "favorites": 366430,
    "lang": "en",
    "media": [],
    "quotes": 6905,
    "replies": 41562,
    "retweets": 69932,
    "sensitive": null,
    "source": null
  },
  "prev_cursor": "DAAHCgABHWL0Tx4AJxELAAIAAAATMjExNzQ4MjU3MDc1NzY1NjgzNggAAwAAAAEAAA",
  "status": "ok",
  "timeline": [
    {
      "author": {
        "avatar": "https://pbs.twimg.com/profile_images/2103567689515954176/aR-Kjpp4_normal.jpg",
        "blue_verified": true,
        "followers_count": 241472215,
        "name": "Elon Musk",
        "rest_id": "44196397",
        "screen_name": "elonmusk"
      },
      "bookmarks": 0,
      "conversation_id": "2117482570757656836",
      "created_at": "Tue Nov 03 05:02:40 +0000 2026",
      "entities": {
        "user_mentions": [
          {
            "id_str": "1082912120",
            "name": "Jerry Tworek",
            "screen_name": "MillionInt"
          }
        ]
      },
      "favorites": 0,
      "lang": "en",
      "media": [],
      "quotes": 0,
      "replies": 0,
      "retweeted": {
        "id": "2117465116858052725"
      },
      "retweeted_tweet": {
        "author": {
          "avatar": "https://pbs.twimg.com/profile_images/1184690787419734016/7ija9HDY_normal.jpg",
          "blue_verified": true,
          "name": "Jerry Tworek",
          "rest_id": "1082912120",
          "screen_name": "MillionInt"
        },
        "bookmarks": 109,
        "conversation_id": "2117465116858052725",
        "created_at": "Tue Nov 03 03:53:19 +0000 2026",
        "entities": [],
        "favorites": 1182,
        "lang": "en",
        "media": []
      }
    }
  ],
  "user": {
    "affiliates": {
      "label": {
        "badge": {
          "url": "https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg"
        },
        "description": "X",
        "url": {
          "url": "https://twitter.com/X",
          "urlType": "DeepLink"
        },
        "userLabelDisplayType": "Badge",
        "userLabelType": "BusinessLabel"
      }
    },
    "avatar": "https://pbs.twimg.com/profile_images/2103567689515954176/aR-Kjpp4_normal.jpg",
    "blue_verified": true,
    "created_at": "Tue Jun 02 20:12:29 +0000 2009",
    "desc": null,
    "friends": null,
    "header_image": null,
    "id": "44196397",
    "location": "",
    "media_count": null,
    "name": "Elon Musk",
    "profile": "elonmusk"
  }
}

Response fields

FieldMeaning
timeline[]List of posts on the account's timeline, newest first. Includes original posts, retweets and quote posts.
timeline[].tweet_id / timeline[].conversation_idID of the post and ID of the conversation it belongs to. Both are numeric strings.
timeline[].text / timeline[].created_at / timeline[].langPost text, creation time (for example Tue Nov 03 05:02:40 +0000 2026) and language code.
timeline[].favorites / timeline[].retweets / timeline[].replies / timeline[].quotes / timeline[].bookmarksEngagement counts for the post.
timeline[].viewsView count for the post, returned as a string.
timeline[].retweeted_tweet / timeline[].quotedOriginal post details when the item is a retweet (retweeted_tweet) or a quote post (quoted). Each has its own author, counts and media.
timeline[].author.screen_name / timeline[].author.rest_id / timeline[].author.followers_countHandle, Rest ID and follower count of the account that published the post.
pinnedThe account's pinned post, with the same fields as a timeline[] item.
user.name / user.profile / user.id / user.created_atDisplay name, handle, Rest ID and account creation time of the requested user.
next_cursor / prev_cursorCursor values for the next and previous page of the timeline.

Notes

  • restId is the numeric user ID, such as 44196397. Get it from the rest_id field of a profile call like Twitter User Profile.
  • To get the next page, send next_cursor from the response as cursor with the same restId.
  • Some fields in user, such as desc, friends and statuses_count, can be null. Use Twitter User Profile for full profile data.
  • To fetch full detail for one post, pass its tweet_id to Twitter Post Detail.

Pricing

$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
Twitter$0.014286 每次调用JSON
X (Twitter)每次调用从 $0.00054 起JSON
Twitter每次调用从 $0.0006 起异步 JSON
X (Twitter)每次调用从 $0.0001 起JSON
X (Twitter)每次调用从 $0.0036 起JSON
X (Twitter)每次调用从 $0.00045 起JSON

指南:X API alternative: pay per call, not per postBest Twitter API in 2026: X API Pricing Compared

问题

常见问题

如何使用 Twitter User Published Posts API?

向 https://api.sandbase.ai/v1/api/twitter/user-posts 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Twitter User Published Posts API 的价格是多少?

每次调用 $0.014286,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Twitter User Published Posts API 接受哪些参数?

必填:restId (string)。 可选:cursor (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Twitter User Published Posts API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Twitter 开发者账户或 API key 吗?

不需要。Twitter User Published Posts 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Twitter API 访问权限。