urlstring必填
Canonical x.com or twitter.com status URL with a numeric tweet ID, including /i/web/status and media-share variants.
https://api.sandbase.ai/v1/api/twitter/tweetFetch a single Twitter/X tweet by URL with its full text and engagement counts (likes, retweets, replies, quotes, bookmarks, views).
您的輸出會顯示在這裡
完成輸入後,點擊執行。
Returns one tweet from X (Twitter) as JSON: its text, author details, engagement counts, and attached media. It needs the tweet's url as input.
likes, retweets and views change by calling it on a schedule.curl -X POST "https://api.sandbase.ai/v1/api/twitter/tweet" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://x.com/SpaceX/status/1732824684683784516"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Canonical x.com or twitter.com status URL with a numeric tweet ID, including /i/web/status and media-share variants. |
requireFields | array | No | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example videoUrl or width, and it is served only by a source that returns |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"authorHandle": "SpaceX",
"authorId": "34743251",
"authorImage": "https://pbs.twimg.com/profile_images/1697749409851985920/HbrI04tM_normal.jpg",
"authorName": "SpaceX",
"authorVerified": true,
"bookmarks": 1877,
"conversationId": "1732824684683784516",
"createdUtc": 1701972573,
"id": "1732824684683784516",
"inReplyToId": null,
"lang": "en",
"likes": 33783
},
"found": true
}
| Field | Meaning |
|---|---|
data.text | Full text of the tweet. Links appear as shortened t.co URLs. |
data.authorHandle / data.authorName | Handle and display name of the account that posted the tweet. |
data.authorId | Numeric ID of the author's account, as a string. |
data.authorVerified | true if the author account is marked as verified. |
data.likes / data.retweets / data.replies / data.quotes / data.bookmarks | Engagement counts for the tweet. |
data.views | View count for the tweet. |
data.createdUtc | Time the tweet was posted, as a Unix timestamp in seconds. |
data.conversationId / data.inReplyToId | conversationId is the ID of the conversation the tweet belongs to. inReplyToId is null when the tweet is not a reply. |
data.media[].type / data.media[].url | Type of each attached media item, such as video, and its image URL. For a video, the URL points to a thumbnail image. |
data.media[].width / data.media[].height | Pixel size of the media item, as returned. |
url, for example https://x.com/SpaceX/status/1732824684683784516. The ID in the link matches data.id.requireFields with videoUrl, width or height if your code needs those fields. This can change which source serves the call and its price.found is false.Billed at the actual cost of each call, about $0.00022 for the request above. Failed calls are not charged.
開始建置
具備統一驗證與用量追蹤的平台 API 端點。
curl -X POST "https://api.sandbase.ai/v1/api/twitter/tweet" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://x.com/SpaceX/status/1732824684683784516"
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
urlstring必填Canonical x.com or twitter.com status URL with a numeric tweet ID, including /i/web/status and media-share variants.
requireFieldsarrayOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `videoUrl` or `width`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a tweet that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
尚未發布已儲存回應。請在 Playground 中執行 API 以檢視其回應。
探索更多
| API | 價格 | 回應 |
|---|---|---|
X (Twitter) | 每次呼叫 $0.00022 起 | 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
問題
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/twitter/tweet。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次起 $0.00022,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:url (string)。 選填:requireFields (array)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。X (Twitter) Twitter Tweet 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 X (Twitter) API 存取權。