tweet_idsstringจำเป็น
Comma-separated list of tweet IDs.
https://api.sandbase.ai/v1/api/twitter/tweets-by-idsLook up several tweets at once by a comma-separated list of tweet IDs, with text, author and engagement counts.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Returns details for several tweets in one call. You pass a comma-separated list of tweet IDs in tweet_ids, and the response has one entry per ID in tweets with the text, author, engagement counts and links.
curl -X POST "https://api.sandbase.ai/v1/api/twitter/tweets-by-ids" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tweet_ids": "1585341984679469056,1846987139428634858"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
tweet_ids | string | Yes | Comma-separated list of tweet IDs. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"code": 0,
"msg": "success",
"status": "success",
"tweets": [
{
"author": {
"affiliatesHighlightedLabel": {
"label": {
"badge": {
"url": "https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg"
},
"description": "X",
"url": {
"url": "https://twitter.com/X",
"url_type": "DeepLink"
},
"user_label_display_type": "Badge",
"user_label_type": "BusinessLabel"
}
},
"automatedBy": null,
"canDm": false,
"canMediaTag": false,
"coverPicture": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
"createdAt": "Tue Jun 02 20:12:29 +0000 2009",
"description": "https://t.co/ZdBx5WABYx",
"entities": {
"description": {
"urls": [
{
"display_url": "Terafab.AI",
"expanded_url": "http://Terafab.AI",
"indices": [
0
],
"url": "https://t.co/ZdBx5WABYx"
}
]
}
}
},
"bookmarkCount": 14034,
"card": null,
"communityInfo": null,
"conversationId": "1585341984679469056",
"createdAt": "Wed Oct 26 18:45:58 +0000 2022",
"displayTextRange": [
0
],
"entities": {},
"extendedEntities": {
"media": [
{
"additional_media_info": {
"monetizable": false
},
"display_url": "pic.x.com/D68z4K2wq7",
"expanded_url": "https://x.com/elonmusk/status/1585341984679469056/video/1",
"ext_master_playlist_only": [],
"ext_media_availability": {
"status": "Available"
},
"ext_playlists": [],
"id_str": "1585341912877146112",
"indices": [
40
]
}
]
},
"id": "1585341984679469056",
"inReplyToId": "",
"inReplyToUserId": ""
}
]
}
| Field | Meaning |
|---|---|
tweets[] | One entry per requested tweet ID. An entry with an empty id and empty text has no data. |
tweets[].id / tweets[].url / tweets[].twitterUrl | The tweet ID and its links on x.com and twitter.com. |
tweets[].text | The tweet text. Media links appear as short t.co URLs. |
tweets[].createdAt | Posting time as a string such as Wed Oct 26 18:45:58 +0000 2022. |
tweets[].likeCount / tweets[].retweetCount / tweets[].replyCount / tweets[].quoteCount / tweets[].bookmarkCount | Engagement counts for the tweet. |
tweets[].viewCount | View count. The sample tweet shows 0, so treat that value with care. |
tweets[].isReply / tweets[].isQuote / tweets[].isRetweet | Flags that show what kind of tweet it is. |
tweets[].conversationId | ID of the conversation the tweet belongs to. |
tweets[].author.createdAt / tweets[].author.description / tweets[].author.coverPicture | When the author account was created, its bio text and its banner image URL. |
tweets[].extendedEntities.media[] | Attached media items, with expanded_url, display_url and id_str. |
1585341984679469056,1846987139428634858.Billed at the actual cost of each call, about $0.0075 for the request above. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/twitter/tweets-by-ids" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tweet_ids": "1585341984679469056,1846987139428634858"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
tweet_idsstringจำเป็นComma-separated list of tweet IDs.
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
X (Twitter) Tweets by IDsAPI นี้ X (Twitter) | เริ่มต้นที่ $0.0075 ต่อครั้ง | JSON |
X (Twitter) | เริ่มต้นที่ $0.00054 ต่อครั้ง | JSON |
Twitter | เริ่มต้นที่ $0.0006 ต่อครั้ง | Async 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 ไปที่ https://api.sandbase.ai/v1/api/twitter/tweets-by-ids โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
เริ่มต้นที่ $0.0075 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: tweet_ids (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น X (Twitter) Tweets by IDs ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง X (Twitter) API แยกต่างหาก