Twitter (X) Search
https://api.sandbase.ai/v1/api/twitter/web/search-timelineSearch Twitter / X posts by keyword and get tweets with text, author, time and engagement counts (likes, retweets, replies, views). Supports Top, Latest, Media, People and Lists results.
- Price
- $0.0015USD / callFirst 100 calls per day free (shared per organization)
- Method
- POST
- Response
- JSON
- Parameters
- 1 required · 2 optional
Try the model
Playground
[
{
"data": {
"next_cursor": "DAACCgACHPupFnOAJxAKAAMc-6kWc3_Y8AgABAAAAAILAAUAAADwRW1QQzZ3QUFBZlEvZ0dKTjB2R3AvQUFBQUJRYyt5VGswMWVSWUJ6N0FkUE5sNEE5SE83L3pYb1dJZVVjK1lSeVpGZFFjUno3QlR1QTFrRFpIUGdHdXJWYndhOGN0cWZicWxxd3F4ejZOcnlqbDdDcEhQczZxN3pYWVcwYyt3TjFkaGRoNXh6Qk5haDdscEZESFB0WGUvM1hZVHNjK3hXSHBwY0JCeHpnMFVBZUc2SHdIUHNvTTZ5VzhCb2MrdnVTZnRhQWpoejZwNVlnRmtIbUhQdDFnakJYZ0FnYyt4bVhOZFpSUGh6NXdwVFpWZ0VKCAAGAAAAAAgABwAAAAAMAAgKAAEctqfbqlqwqwAAAA",
"prev_cursor": "DAACCgACHPupFnOAJxAKAAMc-6kWc3_Y8AgABAAAAAELAAUAAADwRW1QQzZ3QUFBZlEvZ0dKTjB2R3AvQUFBQUJRYyt5VGswMWVSWUJ6N0FkUE5sNEE5SE83L3pYb1dJZVVjK1lSeVpGZFFjUno3QlR1QTFrRFpIUGdHdXJWYndhOGN0cWZicWxxd3F4ejZOcnlqbDdDcEhQczZxN3pYWVcwYyt3TjFkaGRoNXh6Qk5haDdscEZESFB0WGUvM1hZVHNjK3hXSHBwY0JCeHpnMFVBZUc2SHdIUHNvTTZ5VzhCb2MrdnVTZnRhQWpoejZwNVlnRmtIbUhQdDFnakJYZ0FnYyt4bVhOZFpSUGh6NXdwVFpWZ0VKCAAGAAAAAAgABwAAAAAMAAgKAAEctqfbqlqwqwAAAA",
"status": "ok",
"timeline": [
{
"bookmarks": 9,
"conversation_id": "2088359042267701563",
"created_at": "Fri Aug 14 20:16:10 +0000 2026",
"display_text_range": [
0,
274
],
"entities": {
"hashtags": [],
"symbols": [],
"timestamps": [],
"urls": [],
"user_mentions": []
},
"favorites": 13,
"lang": "en",
"media": {
"video": [
{
"aspect_ratio": [
605,
444
],
"duration": 10000,
"id": "2088359010785267712",
"media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2088359010785267712/img/YLGMg7axzgDRWwJb.jpg",
"original_info": {
"focus_rects": [],
"height": 888,
"width": 1210
},
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "https://video.twimg.com/amplify_video/2088359010785267712/pl/Wguc3tWwCnSOW_df.m3u8?tag=29"
},
{
"bitrate": 256000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088359010785267712/vid/avc1/366x270/IuYtPfWzB7659P0s.mp4?tag=29"
},
{
"bitrate": 832000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088359010785267712/vid/avc1/490x360/KkZeDVF9b4U25xAT.mp4?tag=29"
},
{
"bitrate": 2176000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088359010785267712/vid/avc1/980x720/mACTSkIHH-Pkse5Y.mp4?tag=29"
},
{
"bitrate": 10368000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088359010785267712/vid/avc1/1210x888/UOB3zNeCL5Ejvbcv.mp4?tag=29"
}
]
}
]
},
"quoted": {
"author": {
"avatar": "https://pbs.twimg.com/profile_images/1906408525556846592/Tbise2Rw_normal.jpg",
"blue_verified": true,
"created_at": "Thu Jun 06 18:58:34 +0000 2024",
"name": "broke boy",
"rest_id": "1798791551272812544",
"screen_name": "0xfuckpoverty"
},
"bookmarks": 17,
"conversation_id": "2088018606734946793",
"created_at": "Thu Aug 13 21:43:24 +0000 2026",
"favorites": 13,
"lang": "zxx",
"media": [],
"quotes": 1,
"replies": 2,
"retweets": 4,
"sensitive": false,
"text": "https://t.co/26bultGJRL",
"tweet_id": "2088018606734946793",
"views": "2397"
},
"quotes": 0,
"replies": 2,
"retweets": 0,
"screen_name": "0xfuckpoverty",
"sensitive": false,
"source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
"text": "Most AI agents can answer once.\n\nProduction systems need to do much more: branch, run work in parallel, validate, recover from failures, and know when to stop.\n\nThat's why the missing layer isn't a bigger model.\n\nIt's a graph.\n\nNew request → classify → plan → fan-out → join → validate → approve/execute.\n\nThe key shift:\n\nAgents generate decisions.\nGraphs govern execution.\nA prompt chain becomes a system when every transition is explicit, bounded, and recoverable.\n\nFull breakdown below.",
"tweet_id": "2088359042267701563",
"type": "tweet",
"user_info": {
"avatar": "https://pbs.twimg.com/profile_images/1906408525556846592/Tbise2Rw_normal.jpg",
"cover_image": null,
"created_at": "Thu Jun 06 18:58:34 +0000 2024",
"description": null,
"favorites_count": 957,
"followers_count": 242,
"friends_count": null,
"location": "",
"name": "broke boy",
"rest_id": "1798791551272812544",
"screen_name": "0xfuckpoverty",
"url": null,
"verified": true,
"verified_type": null
},
"views": "536"
},
{
"bookmarks": 13,
"conversation_id": "2088286524576039175",
"created_at": "Fri Aug 14 15:28:00 +0000 2026",
"display_text_range": [
0,
273
],
"entities": {
"hashtags": [],
"symbols": [],
"timestamps": [],
"urls": [],
"user_mentions": []
},
"favorites": 43,
"lang": "en",
"media": {
"video": [
{
"aspect_ratio": [
9,
16
],
"duration": 65201,
"id": "2088271480790384640",
"media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2088271480790384640/img/rLVmP4b_dwR6gEbZ.jpg",
"original_info": {
"focus_rects": [],
"height": 1920,
"width": 1080
},
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "https://video.twimg.com/amplify_video/2088271480790384640/pl/7DgBXSDfLVOKdAJ0.m3u8?tag=29&v=7b2"
},
{
"bitrate": 632000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088271480790384640/vid/avc1/320x568/DiLGdMt44N-n8eS-.mp4?tag=29"
},
{
"bitrate": 950000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088271480790384640/vid/avc1/480x852/1apFgmlGn4dSy5LH.mp4?tag=29"
},
{
"bitrate": 2176000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088271480790384640/vid/avc1/720x1280/PsuAmAWkljpt_J6-.mp4?tag=29"
},
{
"bitrate": 10368000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088271480790384640/vid/avc1/1080x1920/F0fup18rrBIcLxMO.mp4?tag=29"
}
]
}
]
},
"quoted": {
"author": {
"avatar": "https://pbs.twimg.com/profile_images/2049557081502752768/gymBLMZ8_normal.jpg",
"blue_verified": true,
"created_at": "Sun Feb 24 07:45:36 +0000 2013",
"name": "kiosa",
"rest_id": "1214810521",
"screen_name": "thegreatest_sv"
},
"bookmarks": 86,
"conversation_id": "2077035062952915243",
"created_at": "Tue Jul 14 14:18:43 +0000 2026",
"favorites": 49,
"lang": "zxx",
"media": [],
"quotes": 14,
"replies": 5,
"retweets": 6,
"sensitive": false,
"text": "https://t.co/6okVeHBq7p",
"tweet_id": "2077035062952915243",
"views": "105481"
},
"quotes": 0,
"replies": 4,
"retweets": 3,
"screen_name": "thegreatest_sv",
"sensitive": false,
"source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
"text": "UBER BURNED THROUGH ITS ENTIRE 2026 AI BUDGET IN LESS THAN 4 MONTHS.\n\nThe problem wasn’t that engineers weren’t using AI.\n\nIt was the opposite.\n\nAI coding tools were consuming so many tokens that Uber blew through a full-year budget before May.\n\nThe company started putting spending limits on agentic coding tools.\n\nAnd Uber isn’t some startup that forgot to watch its API bill.\n\nThis is what happens when thousands of engineers start running AI agents that constantly read files, execute commands, run tests and feed context back into the model.\n\nAI coding got cheap enough to use everywhere - but expensive enough to waste everywhere.\n\nI found a free tool that cuts Claude Code token consumption by up to 90%.\n\nHere’s how it works",
"tweet_id": "2088286524576039175",
"type": "tweet",
"user_info": {
"avatar": "https://pbs.twimg.com/profile_images/2049557081502752768/gymBLMZ8_normal.jpg",
"cover_image": null,
"created_at": "Sun Feb 24 07:45:36 +0000 2013",
"description": null,
"favorites_count": 7255,
"followers_count": 2977,
"friends_count": null,
"location": "",
"name": "kiosa",
"rest_id": "1214810521",
"screen_name": "thegreatest_sv",
"url": null,
"verified": true,
"verified_type": null
},
"views": "6617"
},
{
"bookmarks": 12,
"conversation_id": "2088327361498407277",
"created_at": "Fri Aug 14 18:10:16 +0000 2026",
"display_text_range": [
0,
280
],
"entities": {
"hashtags": [],
"symbols": [],
"timestamps": [],
"urls": [],
"user_mentions": []
},
"favorites": 19,
"lang": "en",
"media": {
"video": [
{
"aspect_ratio": [
9,
16
],
"duration": 50300,
"id": "2088321900673912832",
"media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2088321900673912832/img/h99q4lQjFPuQyBL5.jpg",
"original_info": {
"focus_rects": [],
"height": 1024,
"width": 576
},
"variants": [
{
"content_type": "application/x-mpegURL",
"url": "https://video.twimg.com/amplify_video/2088321900673912832/pl/GfOH199ha1C2_ott.m3u8?tag=29"
},
{
"bitrate": 632000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088321900673912832/vid/avc1/320x568/ZqDvoDTflWXPD7Cq.mp4?tag=29"
},
{
"bitrate": 950000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088321900673912832/vid/avc1/480x852/smYgChHVOMhVHPgV.mp4?tag=29"
},
{
"bitrate": 2176000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/amplify_video/2088321900673912832/vid/avc1/576x1024/bOb_CfFHFtfZeAAV.mp4?tag=29"
}
]
}
]
},
"quoted": {
"author": {
"avatar": "https://pbs.twimg.com/profile_images/2086050467717455872/JO4ZK2B6_normal.jpg",
"blue_verified": true,
"created_at": "Wed Dec 17 20:01:18 +0000 2025",
"name": "Yumzlef",
"rest_id": "2001382152387407872",
"screen_name": "Yumzlef"
},
"bookmarks": 28,
"conversation_id": "2087911408973312403",
"created_at": "Thu Aug 13 14:37:26 +0000 2026",
"favorites": 22,
"lang": "zxx",
"media": [],Examples
Select an example to load its inputs and result into the playground.
Model card
Specifications
Pricing
- Base price
- $0.0015 / run
- Daily free calls
- First 100 calls per day free (shared per organization)
Request & response
- Method
- POST
- Request body
- application/json
- Response
- application/json
- Execution
- sync
Parameters
- keyword
- string · required
- cursor
- string · optional
- search_type
- string · optional
Access
- Provider
- API
- Platform API
- Base URL
- https://api.sandbase.ai
- Endpoint
- /v1/api/twitter/web/search-timeline
- Authentication
- Bearer API key
API README
Twitter (X) Search API
Search X (Twitter) for a keyword or query and get matching tweets with author, text, timestamps and engagement metrics. Switch between Top, Latest, Media, People and Lists tabs.
Use cases
- Monitor brand, product or competitor mentions on X.
- Collect the latest tweets about an event with
search_type=Latest. - Find influential accounts discussing a topic.
Request
curl -X POST "https://api.sandbase.ai/v1/api/twitter/web/search-timeline" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword": "OpenAI"}'
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Search keyword |
cursor | string | No | Cursor, default is None, used for paging, obtained from the last request |
search_type | string | No | Search type, default is Top, other optional values are Latest, Media, People, Lists |
Example response
Real response for the request above, trimmed to the main fields. User names and long IDs are masked.
{
"status": "ok",
"next_cursor": "<cursor>",
"timeline": [
{
"tweet_id": "2104987422308335828",
"screen_name": "OpenAI",
"created_at": "Tue Sep 29 17:31:24 +0000 2026",
"lang": "en",
"favorites": 4456,
"retweets": 315,
"replies": 256,
"quotes": 131,
"bookmarks": 1224,
"views": "570812",
"text": "Codex Security Cloud is getting a major upgrade, with access to cyber-capable models thro…"
}
]
}
Notes
- Paginate with
cursorfrom the previous response (next_cursor).
Related APIs
- Get the latest tweet comments: Get the latest tweet comments.
- Get comments: Get comments under the tweet.
- ReTweet User list: Get ReTweet User list.
Start building
Send your first request
Platform API endpoint with unified authentication and usage tracking.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/api/twitter/web/search-timeline" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"keyword": "AI agents",
"search_type": "Top"
}
SANDBASE_JSON
)
printf '%s\n' "$result"Explore more
Related APIs
| API | Price | Response | Released |
|---|---|---|---|
Twitter (X) SearchThis API Twitter | $0.0015 per call | JSON | Jul 31, 2026 |
Twitter | $0.0015 per call | JSON | Jul 31, 2026 |
Twitter | $0.0015 per call | JSON | Jul 31, 2026 |
Twitter | $0.0015 per call | JSON | Jul 31, 2026 |
Twitter | $0.0015 per call | JSON | Jul 31, 2026 |
Twitter | $0.0015 per call | JSON | Jul 31, 2026 |
Questions
FAQ
How do I use the Twitter (X) Search API?
Send a POST request to https://api.sandbase.ai/v1/api/twitter/web/search-timeline with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.
How much does the Twitter (X) Search API cost?
$0.0015 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.
What parameters does the Twitter (X) Search API accept?
Required: keyword (string). Optional: cursor (string) and search_type (string). The Parameters table and the Playground on this page list every field.
What does the Twitter (X) Search API return?
A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.
Do I need a Twitter developer account or API key?
No. Twitter (X) Search runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Twitter API access separately.
