Twitter (X) User Media

https://api.sandbase.ai/v1/api/twitter/web/user-media

Returns media posts and timeline items for a specified user profile, queried by screen name or user ID. Supports cursor-based pagination for browsing past media posts.

Price
$0.0015USD / callFirst 100 calls per day free (shared per organization)
Method
POST
Response
JSON
Parameters
1 required · 2 optional
Production route

Try the model

Playground

Open playground
Input
Cursor, default is None, used for paging, obtained from the `next_cursor` in the last request
User ID, for example: 44196397, if the user ID is used, the username will be ignored, only one of them can be selected.
Screen Name, for example: elonmusk, can be obtained from the user's homepage link, for example: elonmusk in https://twitter.com/elonmusk
OutputExample
Responseoutputs · 47.9 KB · 1,178 lines
[
  {
    "data": {
      "next_cursor": "DAABCgABHQJ8y31___0KAAIc8Q0yK1Zh1QgAAwAAAAIAAA",
      "status": "ok",
      "timeline": [
        {
          "author": {
            "avatar": null,
            "blue_verified": true,
            "name": "NASA",
            "rest_id": "11348282",
            "screen_name": "NASA"
          },
          "bookmarks": 136,
          "conversation_id": "2090197889947451524",
          "created_at": "Wed Aug 19 22:03:05 +0000 2026",
          "favorites": 2146,
          "lang": "en",
          "media": {
            "photo": [
              {
                "id": "2090197886822699009",
                "media_url_https": "https://pbs.twimg.com/media/HQHf51pW0AEIWOI.png"
              }
            ]
          },
          "quotes": 43,
          "replies": 99,
          "retweets": 335,
          "sensitive": false,
          "source": "<a href=\"https://www.sprinklr.com\" rel=\"nofollow\">Sprinklr</a>",
          "text": "Due to an ongoing commercial spacecraft attitude control issue, the LINK spacecraft will not capture or boost NASA’s Neil Gehrels Swift Observatory to a higher altitude as planned. Read more about next steps: https://t.co/TQKhV81Hir https://t.co/xF92SIdnXJ",
          "tweet_id": "2090197889947451524",
          "views": "632119"
        },
        {
          "author": {
            "avatar": null,
            "blue_verified": true,
            "name": "NASA",
            "rest_id": "11348282",
            "screen_name": "NASA"
          },
          "bookmarks": 12,
          "conversation_id": "2089668789218521591",
          "created_at": "Tue Aug 18 19:53:14 +0000 2026",
          "favorites": 274,
          "lang": "en",
          "media": {
            "video": [
              {
                "aspect_ratio": [
                  16,
                  9
                ],
                "duration": 45248,
                "id": "2089793857093263360",
                "media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2089793857093263360/img/rajNPpyafMoxBToJ.jpg",
                "original_info": {
                  "focus_rects": [],
                  "height": 2160,
                  "width": 3840
                },
                "variants": [
                  {
                    "content_type": "application/x-mpegURL",
                    "url": "https://video.twimg.com/amplify_video/2089793857093263360/pl/-PF6h_Z_PiLhbdO7.m3u8?tag=29&v=b22"
                  },
                  {
                    "bitrate": 256000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089793857093263360/vid/avc1/480x270/u9F9hSHT5t2SkQOO.mp4?tag=29"
                  },
                  {
                    "bitrate": 832000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089793857093263360/vid/avc1/640x360/0jjeusFrIr_aFAYF.mp4?tag=29"
                  },
                  {
                    "bitrate": 2176000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089793857093263360/vid/avc1/1280x720/5UMuHROj-2oMSyas.mp4?tag=29"
                  },
                  {
                    "bitrate": 10368000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089793857093263360/vid/avc1/1920x1080/UrFlr-_JvaJXYbnu.mp4?tag=29"
                  },
                  {
                    "bitrate": 25128000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089793857093263360/vid/avc1/3840x2160/OXD2h8ezehmYkN7p.mp4?tag=29"
                  }
                ]
              }
            ]
          },
          "quotes": 3,
          "replies": 9,
          "reply_to": "2089729699186409716",
          "retweets": 21,
          "sensitive": false,
          "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
          "text": "@esa @Space_Station During today's spacewalk, @astro_anil and @Soph_Astro removed a failed communications antenna.\n\nDue to timing constraints, the crew was unable to install the new communications antenna, which is expected to be installed during a future spacewalk. https://t.co/UgV9g2GwXL",
          "tweet_id": "2089802824678879526",
          "views": "125438"
        },
        {
          "author": {
            "avatar": null,
            "blue_verified": true,
            "name": "NASA",
            "rest_id": "11348282",
            "screen_name": "NASA"
          },
          "bookmarks": 37,
          "conversation_id": "2089668789218521591",
          "created_at": "Tue Aug 18 15:02:40 +0000 2026",
          "favorites": 994,
          "lang": "en",
          "media": {
            "video": [
              {
                "aspect_ratio": [
                  16,
                  9
                ],
                "duration": 23680,
                "id": "2089729443778453504",
                "media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2089729443778453504/img/k6ki0t1Ra0pYfo7-.jpg",
                "original_info": {
                  "focus_rects": [],
                  "height": 2160,
                  "width": 3840
                },
                "variants": [
                  {
                    "content_type": "application/x-mpegURL",
                    "url": "https://video.twimg.com/amplify_video/2089729443778453504/pl/Plv_wjakvSmqLDiw.m3u8?tag=29&v=1d3"
                  },
                  {
                    "bitrate": 256000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089729443778453504/vid/avc1/480x270/sWOWwffmr_In7lC4.mp4?tag=29"
                  },
                  {
                    "bitrate": 832000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089729443778453504/vid/avc1/640x360/R_Le1uJiTfipXLCd.mp4?tag=29"
                  },
                  {
                    "bitrate": 2176000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089729443778453504/vid/avc1/1280x720/ecDPbL4AhGp6xQ6F.mp4?tag=29"
                  },
                  {
                    "bitrate": 10368000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089729443778453504/vid/avc1/1920x1080/g0q8wF5zYNMVjUhh.mp4?tag=29"
                  },
                  {
                    "bitrate": 25128000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089729443778453504/vid/avc1/3840x2160/7vWqE42ttjnzWuPx.mp4?tag=29"
                  }
                ]
              }
            ]
          },
          "quotes": 15,
          "replies": 21,
          "reply_to": "2089692281053860096",
          "retweets": 128,
          "sensitive": false,
          "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Twitter Web App</a>",
          "text": "@esa @Space_Station Here, Menon and Adenot are working on a series of electrical and data connectors as today's spacewalk continues. Tune in to watch our live coverage. https://t.co/VHhUoNcNHQ",
          "tweet_id": "2089729699186409716",
          "views": "276575"
        },
        {
          "author": {
            "avatar": null,
            "blue_verified": true,
            "name": "NASA",
            "rest_id": "11348282",
            "screen_name": "NASA"
          },
          "bookmarks": 262,
          "conversation_id": "2089425053599289546",
          "created_at": "Mon Aug 17 18:52:07 +0000 2026",
          "favorites": 4445,
          "lang": "en",
          "media": {
            "video": [
              {
                "aspect_ratio": [
                  16,
                  9
                ],
                "duration": 88321,
                "id": "2089424963400818688",
                "media_url_https": "https://pbs.twimg.com/media/HP8hAu4WEAAJLH7.png",
                "original_info": {
                  "focus_rects": [],
                  "height": 405,
                  "width": 720
                },
                "variants": [
                  {
                    "content_type": "application/x-mpegURL",
                    "url": "https://video.twimg.com/amplify_video/2089424963400818688/pl/myb7w6d4RP7nNMGs.m3u8?tag=14&v=59c"
                  },
                  {
                    "bitrate": 288000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089424963400818688/vid/avc1/480x270/NGwKJUUjSlCtI6yO.mp4?tag=14"
                  },
                  {
                    "bitrate": 832000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089424963400818688/vid/avc1/640x360/qD8iWLv9FRXZauOH.mp4?tag=14"
                  },
                  {
                    "bitrate": 2176000,
                    "content_type": "video/mp4",
                    "url": "https://video.twimg.com/amplify_video/2089424963400818688/vid/avc1/1280x720/IBo79GnC5dV8QCTj.mp4?tag=14"
                  }
                ]
              }
            ]
          },
          "quotes": 47,
          "replies": 222,
          "retweets": 742,
          "sensitive": false,
          "source": "<a href=\"https://www.sprinklr.com\" rel=\"nofollow\">Sprinklr</a>",
          "text": "Our next space telescope is launching in just under two weeks!\n\nIn the first episode of our NASA's Curious Universe podcast series on @NASARoman, we get to know the telescope's namesake and what cosmic mysteries it will help us to unravel. https://t.co/xmyFaDlmUu https://t.co/YyUtVKC4Sz",
          "tweet_id": "2089425053599289546",
          "views": "1148137"
        },
        {
          "author": {
            "avatar": null,
            "blue_verified": true,
            "name": "NASA",
            "rest_id": "11348282",
            "screen_name": "NASA"
          },
          "bookmarks": 297,
          "conversation_id": "2089367348608225574",
          "created_at": "Mon Aug 17 15:02:49 +0000 2026",
          "favorites": 7845,
          "lang": "en",
          "media": {
            "photo": [
              {
                "id": "2089367344199905280",
                "media_url_https": "https://pbs.twimg.com/media/HP7sh5RWMAAVcuA.jpg"
              }
            ]
          },
          "quotes": 87,
          "replies": 172,
          "retweets": 1157,
          "sensitive": false,
          "source": "<a href=\"https://www.sprinklr.com\" rel=\"nofollow\">Sprinklr</a>",
          "text": "Tomorrow, two astronauts will be going on a spacewalk!\n\nBeginning at about 8:35am ET (1235 UTC), astronauts @Astro_Anil and @Soph_Astro will step outside the @Space_Station to replace a communications antenna. Tune in at 7am ET (1100 UTC): https://t.co/eAZp1LtgDB https://t.co/Vw7Dm387PA",
          "tweet_id": "2089367348608225574",
          "views": "1053120"
        },
        {
          "author": {
            "avatar": null,
            "blue_verified": true,
            "name": "NASA",
            "rest_id": "11348282",
            "screen_name": "NASA"
          },
          "bookmarks": 254,
          "conversation_id": "2088355206723477740",
          "created_at": "Fri Aug 14 20:00:55 +0000 2026",
          "favorites": 4302,
          "lang": "en",
          "media": {
            "video": [
              {
                "aspect_ratio": [
                  16,
                  9
                ],
                "duration": 76676,
                "id": "2088355099089219585",
                "media_url_https": "https://pbs.twimg.com/media/HPtT_cXWcAIrRwH.png",
                "original_info": {
                  "focus_rects": [],
                  "height": 405,
                  "width": 720
                },
                "variants": [

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

screen_name
string · required
cursor
string · optional
rest_id
integer · optional

Access

Provider
Twitter
API
Platform API
Base URL
https://api.sandbase.ai
Endpoint
/v1/api/twitter/web/user-media
Authentication
Bearer API key

API README

Twitter (X) User Media API

Retrieve a user's media timeline using their screen_name or rest_id. Page through additional media results with the cursor parameter.

Use cases

  • Browse photos and videos shared by a specific account.
  • Archive media posts from a public profile timeline.
  • Track recent multimedia assets shared by organizations or creators.

Request

curl -X POST "https://api.sandbase.ai/v1/api/twitter/web/user-media" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"screen_name": "NASA"}'

Parameters

NameTypeRequiredDescription
screen_namestringYesScreen Name, for example: elonmusk, can be obtained from the user's homepage link, for example: elonmusk in https://twitter.com/elonmusk
cursorstringNoCursor, default is None, used for paging, obtained from the next_cursor in the last request
rest_idintegerNoUser ID, for example: 44196397, if the user ID is used, the username will be ignored, only one of them can be selected.

Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

{
  "timeline": [
    {
      "conversation_id": "2107237881668313108",
      "text": "Time to bring them home 🌎  After nearly eight months aboard the @Space_Station, the four …",
      "tweet_id": "2107237881668313108",
      "views": "1979091",
      "author": {
        "blue_verified": true,
        "name": "NASA",
        "rest_id": "11348282",
        "screen_name": "<user>"
      }
    }
  ]
}

Notes

  • If rest_id is supplied, screen_name is ignored.
  • Pass cursor using the next cursor value from a previous response to page through results.

Related APIs

Start building

Send your first request

Platform API endpoint with unified authentication and usage tracking.

Production API
Platform API endpoint
https://api.sandbase.ai/v1/api/twitter/web/user-media
Authorization header
Authorization: Bearer $SANDBASE_API_KEY
# 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/user-media" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'SANDBASE_JSON'
{
  "screen_name": "NASA"
}
SANDBASE_JSON
)
printf '%s\n' "$result"

Explore more

Related APIs

All APIs
APIPriceResponseReleased
Twitter$0.0015 per callJSONJul 31, 2026
Twitter$0.0015 per callJSONJul 31, 2026
Twitter$0.0015 per callJSONJul 31, 2026
Twitter$0.0015 per callJSONJul 31, 2026
Twitter$0.0015 per callJSONJul 31, 2026
Twitter$0.0015 per callJSONJul 31, 2026

Questions

FAQ

How do I use the Twitter (X) User Media API?

Send a POST request to https://api.sandbase.ai/v1/api/twitter/web/user-media 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) User Media 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) User Media API accept?

Required: screen_name (string). Optional: cursor (string) and rest_id (integer). The Parameters table and the Playground on this page list every field.

What does the Twitter (X) User Media 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) User Media 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.