keywordstring必填
Search keyword.
https://api.sandbase.ai/v1/api/twitter/searchSearch X (Twitter) by keyword across top, latest, media, people, or list result modes with cursor pagination. Use it to find public conversations, accounts, media, or lists related to a topic.
您的輸出會顯示在這裡
完成輸入後,點擊執行。
This API searches X (Twitter) by keyword and returns a page of matching results in the timeline array. It needs a keyword. You can set searchType to TOP, LATEST, MEDIA, PEOPLE, or LISTS.
iphone.views, favorites, and retweets to find the ones that spread most.user_info.followers_count.curl -X POST "https://api.sandbase.ai/v1/api/twitter/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword": "iphone"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Search keyword. |
cursor | string | No | Pagination cursor returned by the previous response. |
searchType | string | No | Search result type. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"next_cursor": "DAACCgACHWL0SvpAJxAKAAMdYvRK-j_Y8AgABAAAAAILAAUAAADwRW1QQzZ3QUFBZlEvZ0dKTjB2R3Av…",
"prev_cursor": "DAACCgACHWL0SvpAJxAKAAMdYvRK-j_Y8AgABAAAAAELAAUAAADwRW1QQzZ3QUFBZlEvZ0dKTjB2R3Av…",
"status": "ok",
"timeline": [
{
"bookmarks": 254,
"conversation_id": "2115181704403165431",
"created_at": "Tue Oct 27 20:39:51 +0000 2026",
"display_text_range": [
0
],
"entities": {
"hashtags": [],
"media": [
{
"additional_media_info": {
"monetizable": false
},
"display_url": "pic.x.com/m7nyDKgKuU",
"expanded_url": "https://x.com/TecnonautaTV/status/2115181704403165431/video/1",
"ext_media_availability": {
"status": "Available"
},
"id_str": "2115181241813147648",
"indices": [
205
],
"media_key": "13_2115181241813147648",
"media_results": {
"result": {
"media_key": "13_2115181241813147648"
}
}
}
],
"symbols": [],
"timestamps": [],
"urls": [],
"user_mentions": []
},
"favorites": 1888,
"lang": "es",
"media": {
"video": [
{
"aspect_ratio": [
9
],
"duration": 69300,
"id": "2115181241813147648",
"media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2115181241813147648/img/Fi_52oJPz8Ji6Z…",
"original_info": {
"focus_rects": [],
"height": 1920,
"width": 1080
},
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "https://video.twimg.com/amplify_video/2115181241813147648/pl/_f3RJZ0z46BMZC3H.m3…"
}
]
}
]
},
"quotes": 16,
"replies": 72,
"retweets": 196,
"screen_name": "TecnonautaTV"
}
]
}
| Field | Meaning |
|---|---|
timeline[] | One search result per item. In this response each item is a post with type set to tweet. |
timeline[].tweet_id / timeline[].conversation_id | ID of the post and ID of the conversation it belongs to. Both are strings. |
timeline[].text | Text of the post. Long text may be cut. |
timeline[].created_at | Time the post was created, in a format like Tue Oct 27 20:39:51 +0000 2026. |
timeline[].screen_name | Handle of the account that wrote the post. |
timeline[].favorites / timeline[].retweets / timeline[].replies / timeline[].quotes / timeline[].bookmarks | Engagement counts for the post. |
timeline[].views | View count of the post, returned as a string. |
timeline[].user_info.followers_count | Follower count of the author. The user_info object also has avatar, location, and the account created_at. |
timeline[].media.video[].variants[] | Video files for the post. Each has a content_type and url. MP4 variants also have a bitrate. |
timeline[].quoted.author.screen_name | Handle of the author of a quoted post, present when the result quotes another post. |
next_cursor as cursor in the next request. The response also returns prev_cursor.keyword the same when you send a cursor.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
開始建置
具備統一驗證與用量追蹤的平台 API 端點。
curl -X POST "https://api.sandbase.ai/v1/api/twitter/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"keyword": "iphone"
}'請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
keywordstring必填Search keyword.
searchTypestringSearch result type.
可能值:TOP, LATEST, MEDIA, PEOPLE, LISTS
cursorstringPagination cursor returned by the previous response.
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
尚未發布已儲存回應。請在 Playground 中執行 API 以檢視其回應。
探索更多
| 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
問題
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/twitter/search。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
每次 $0.014286,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
必要:keyword (string)。 選填:searchType(TOP, LATEST, MEDIA, PEOPLE, LISTS 之一) 和 cursor (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
不需要。Twitter Search Timeline 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Twitter API 存取權。