restIdstring必填
The unique numeric identifier (Rest ID) for the X user.
https://api.sandbase.ai/v1/api/twitter/user-detailGet an X (Twitter) user profile identified by its numeric Rest ID. Use it to review a known account before monitoring its posts or conducting creator and account research.
您的输出将显示在这里
完成输入,然后点击运行。
Returns the public profile of one X (Twitter) account, including its handle, display name, follower count, post count and verification flags. It needs the account's numeric Rest ID in restId.
curl -X POST "https://api.sandbase.ai/v1/api/twitter/user-detail" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"restId": "44196397"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
restId | string | Yes | The unique numeric identifier (Rest ID) for the X user. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"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,
"business_account": null,
"created_at": "Tue Jun 02 20:12:29 +0000 2009",
"desc": "https://t.co/ZdBx5WABYx",
"friends": 1421,
"header_image": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
"id": "44196397",
"location": "",
"media_count": 4756,
"name": "Elon Musk"
}
| Field | Meaning |
|---|---|
rest_id / id | The numeric Rest ID of the account, returned as a string. Both fields hold the same value as the restId you sent. |
profile | The account's handle, without the @ sign (for example elonmusk). |
name | The display name shown on the profile. |
sub_count | The follower count of the account. |
friends | The number of accounts this user follows. |
statuses_count / media_count | Total posts by the account, and the number of posts with media. |
created_at | When the account was created, as a text timestamp such as Tue Jun 02 20:12:29 +0000 2009. |
blue_verified / verification_type | blue_verified is a displayed verification flag, not independent proof of payment or identity. verification_type is null when no other verification type is set. |
protected / status | protected shows whether the account's posts are private. status shows the account state, such as active. |
pinned_tweet_ids_str[] | IDs of the posts pinned to the profile. |
avatar / header_image | URLs of the profile picture and the banner image. |
affiliates.label.description | Name of the business or organization label shown on the profile, such as X. |
restId, for example 44196397. The API does not accept a handle.pinned_tweet_ids_str[] with Twitter Tweets by IDs to load the pinned posts.desc field can hold a shortened t.co link instead of the full bio text.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Send the numeric account ID as the string restId, preserving the capital I. This route does not accept screen_name and does not use the web route's integer rest_id key. Keep an exact decimal string from a trusted selected record; do not use a handle, URL, float or a rounded JavaScript Number as a substitute. Selecting this route is a separate pricing decision, not an automatic fallback.
The selected page has no saved full example. Its shortened README describes a flat profile with string rest_id and id. Treat that as a reference shape, not a new account read. Compare usable returned identity with the requested string; stop on a mismatch or conflicting returned IDs. If the result reports notfound or lacks identity, do not report a completed profile merely because the SandBase envelope completed.
The reference distinguishes profile as the handle and name as display name. Preserve sub_count, friends, statuses_count and media_count with their field names and retrieval time; null is not zero. created_at is a textual account-creation timestamp, not the observation date. The desc field can contain a shortened link rather than the complete bio; this first task does not open it automatically.
Protected and verification fields are public profile signals, not access to protected posts or independent identity proof. An organization badge is not your verified partnership assessment. The shown affiliates object and null business_account differ from the other route's example; optional fields need route-aware handling instead of a single forced nested format.
Pinned post IDs and image URLs are references, not already retrieved content. This task stops after the selected profile response. For a handle-first task, choose Web User Profile independently; do not send both request formats or switch routes automatically after an error.
Choose a handle lookup or an exact-ID lookup before running. A connected agent needs that identifier, the selected endpoint and the result you want. For a new integration, share the setup Skill, Markdown quickstart and chosen task. Keep SANDBASE_API_KEY locally and use POST /v1/api/ with Bearer authentication.
Validate completed SandBase status and an object at outputs[0].data, then check the business result. The selected references describe flat profile fields, not a nested user or data.data wrapper. An explicit status notfound or missing usable identity is not a successful empty profile. Do not invent a universal code/message success flag; preserve unknown optional fields rather than coercing them into zero or false.
Pricing checked on 2026-11-08: Web User Profile lists $0.001 per call; User Detail lists $0.014286 per call. Both show eligibility for 100 daily calls shared across eligible data APIs in the organization, resetting at 00:00 UTC. Eligibility is not remaining allowance. Check current pricing and do not silently retry against the other, differently priced route. No new business request was made for this revision. The X/Twitter Python profile guide distinguishes historical illustrations, public references and offline validation.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/twitter/user-detail" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"restId": "44196397"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
restIdstring必填The unique numeric identifier (Rest ID) for the X user.
这是该 API 保存的示例响应;查看时不会发起实时请求。
尚未发布已保存的响应。请在 Playground 中运行 API 以查看其响应。
探索更多
| API | 价格 | 响应 |
|---|---|---|
Twitter User Profile此 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
问题
向 https://api.sandbase.ai/v1/api/twitter/user-detail 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.014286,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。
必填:restId (string)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Twitter User Profile 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Twitter API 访问权限。
请使用首字母大写 I 的 restId,并传入十进制字符串值。这与网页个人主页路由的整数 rest_id 不同。handle、URL 或已四舍五入的数字都不是精确选定的 ID。入库前请先比较返回的字符串身份。
不要自动切换。11 月 8 日列出的价格是 User Detail $0.014286、Web User Profile $0.001,共享符合条件的每日配额。请明确选择路由和当前价格;配额资格不表示剩余额度。
所选的 User Detail 页面没有保存的完整示例;简短的 README 只是参考结构。可选的 affiliates 和 business_account 字段与网页示例不同。请保留未知值,拒绝缺失或不匹配的身份,不要基于这些参考声称这是一次新的实时读取。