Skip to main content
GET
/
v1
/
twitter
/
fetch_user_media
cURL
curl --request GET \
  --url 'https://api.keyapi.ai/v1/twitter/fetch_user_media?screen_name=elonmusk' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
{
  "code": 0,
  "message": "success",
  "data": {
    "timeline": [
      {
        "tweet_id": "2031156544583381262",
        "bookmarks": 2454,
        "created_at": "Mon Mar 09 23:53:51 +0000 2026",
        "favorites": 99271,
        "text": "Real picture of @StarbaseTX https://t.co/u3YcQTHpbf",
        "lang": "en",
        "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
        "views": "7992351",
        "quotes": 333,
        "replies": 4735,
        "retweets": 6208,
        "conversation_id": "2031156544583381262",
        "media": {
          "photo": [
            {
              "media_url_https": "https://pbs.twimg.com/media/HDAeHKHa0AATyZ9.jpg",
              "id": "2031156540267483136"
            }
          ]
        },
        "author": {
          "rest_id": "44196397",
          "name": "Elon Musk",
          "screen_name": "elonmusk",
          "avatar": null,
          "blue_verified": true
        }
      },
      {
        "tweet_id": "2030856275505094711",
        "bookmarks": 13869,
        "created_at": "Mon Mar 09 04:00:42 +0000 2026",
        "favorites": 161835,
        "text": "I use this analogy a lot. \n\nThis is what a room full of computers looked like in old times: https://t.co/Y4a93z76lw",
        "lang": "en",
        "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
        "views": "31634315",
        "quotes": 447,
        "replies": 4074,
        "retweets": 13724,
        "conversation_id": "2030856275505094711",
        "media": {
          "photo": [
            {
              "media_url_https": "https://pbs.twimg.com/media/HC8NBUhaAAAJIiq.jpg",
              "id": "2030856273307238400"
            }
          ]
        },
        "author": {
          "rest_id": "44196397",
          "name": "Elon Musk",
          "screen_name": "elonmusk",
          "avatar": null,
          "blue_verified": true
        },
        "quoted": {
          "tweet_id": "2030850967059714473",
          "bookmarks": 3656,
          "created_at": "Mon Mar 09 03:39:36 +0000 2026",
          "favorites": 26152,
          "text": "A “computer” used to be a job title. \n\nThen a computer became a thing humans used. \n\nNow a computer is becoming a thing computers use.",
          "lang": "en",
          "views": "32606346",
          "quotes": 307,
          "replies": 1165,
          "retweets": 2470,
          "conversation_id": "2030850967059714473",
          "author": {
            "rest_id": "745273",
            "name": "Naval",
            "screen_name": "naval",
            "avatar": null,
            "blue_verified": true
          },
          "media": []
        }
      },
      {
        "tweet_id": "2030839639205118155",
        "bookmarks": 156,
        "created_at": "Mon Mar 09 02:54:35 +0000 2026",
        "favorites": 13612,
        "text": "https://t.co/FmoCBmoAlg",
        "lang": "zxx",
        "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
        "reply_to": "2030838811794833670",
        "views": "898257",
        "quotes": 45,
        "replies": 577,
        "retweets": 858,
        "conversation_id": "2030838811794833670",
        "media": {
          "photo": [
            {
              "media_url_https": "https://pbs.twimg.com/media/HC7941ta4AAhOy_.jpg",
              "id": "2030839634922758144"
            }
          ]
        },
        "author": {
          "rest_id": "44196397",
          "name": "Elon Musk",
          "screen_name": "elonmusk",
          "avatar": null,
          "blue_verified": true
        }
      },
      {
        "tweet_id": "2030814137811341589",
        "bookmarks": 6970,
        "created_at": "Mon Mar 09 01:13:15 +0000 2026",
        "favorites": 106234,
        "text": "Giving people agentic AI be like … https://t.co/rtWrWXr6QS",
        "lang": "en",
        "source": "<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
        "views": "45844642",
        "quotes": 842,
        "replies": 5618,
        "retweets": 9285,
        "conversation_id": "2030814137811341589",
        "media": {
          "video": [
            {
              "media_url_https": "https://pbs.twimg.com/amplify_video_thumb/2030814076126048256/img/g8Ielp8WAq6b6O-O.jpg",
              "variants": [
                {
                  "content_type": "application/x-mpegURL",
                  "url": "https://video.twimg.com/amplify_video/2030814076126048256/pl/m1-qli_yeI_tdKp7.m3u8?tag=24&v=cfc"
                },
                {
                  "bitrate": 800000,
                  "content_type": "video/mp4",
                  "url": "https://video.twimg.com/amplify_video/2030814076126048256/vid/avc1/400x270/HVWRuLyg-EogRiS8.mp4?tag=24"
                },
                {
                  "bitrate": 5184000,
                  "content_type": "video/mp4",
                  "url": "https://video.twimg.com/amplify_video/2030814076126048256/vid/avc1/688x464/JTSOiFPmuHiLV-Fo.mp4?tag=24"
                }
              ],
              "aspect_ratio": [
                43,
                29
              ],
              "duration": 16000,
              "original_info": {
                "focus_rects": [],
                "height": 464,
                "width": 688
              },
              "id": "2030814076126048256"
            }
          ]
        },
        "author": {
          "rest_id": "44196397",
          "name": "Elon Musk",
          "screen_name": "elonmusk",
          "avatar": null,
          "blue_verified": true
        }
      }
    ],
    "next_cursor": "DAABCgABHDBFH08___0KAAIcLuay2RYRFQgAAwAAAAIAAA",
    "status": "ok",
    "user": {
      "status": "active",
      "profile": null,
      "rest_id": "44196397",
      "blue_verified": true,
      "verification_type": null,
      "affiliates": {
        "label": {
          "badge": {
            "url": "https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg"
          },
          "description": "X",
          "url": {
            "url": "https://twitter.com/X",
            "urlType": "DeepLink"
          },
          "userLabelDisplayType": "Badge",
          "userLabelType": "BusinessLabel"
        }
      },
      "business_account": [],
      "avatar": "https://pbs.twimg.com/profile_images/2008546467615580160/57KcqsTA_normal.jpg",
      "header_image": "https://pbs.twimg.com/profile_banners/44196397/1739948056",
      "desc": "",
      "name": "Elon Musk",
      "protected": false,
      "location": "",
      "friends": 1292,
      "sub_count": 236275683,
      "statuses_count": 98779,
      "media_count": 4388,
      "created_at": "Tue Jun 02 20:12:29 +0000 2009",
      "pinned_tweet_ids_str": [
        "2030159267689632121"
      ],
      "id": "44196397"
    }
  },
  "requestId": "fb804466-7b0b-4070-9a82-cda7bdb6c10f"
}
🪙1 creditper request

Copy for AI

🤖 Why Code When AI Can Do It For You?

Stop writing code like it’s 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.

Authorizations

Authorization
string
header
required

API key for authentication. Format: sk_live_xxxxxxxxxxxxx Get your API key from the Dashboard.

Query Parameters

screen_name
string

Username, obtainable from the user profile URL For example: https://twitter.com/elonmusk — the username is elonmusk

Example:

"elonmusk"

cursor
string

Cursor, default is None, used for pagination, obtained from the next_cursor in the previous response

Response

The response is of type object.