Twitter Media API
List the tweets with photos or videos an X account has posted, using its numeric user ID. Each tweet includes direct media links, the text, timestamp and engagement counts. Load older tweets with `cursor`.
- Endpoint
- POST /x/get-user-media
- Price
- 1 credit per result
- SDK
- client.x.getUserMedia()
- MCP tool
- x_get_user_media
curl -X POST "https://api.bridgly.app/x/get-user-media" \ -H "Authorization: Bearer $BRIDGLY_KEY" \ -H "Content-Type: application/json" \ -d '{ "userId": "44196397", "count": 10}'import osimport requestsresponse = requests.post( "https://api.bridgly.app/x/get-user-media", headers={"Authorization": f"Bearer {os.environ['BRIDGLY_KEY']}"}, json={ "userId": "44196397", "count": 10, },)data = response.json()const response = await fetch("https://api.bridgly.app/x/get-user-media", { method: "POST", headers: { Authorization: `Bearer ${process.env.BRIDGLY_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "userId": "44196397", "count": 10 }),});const data = await response.json();import { Bridgly } from "@bridgly/sdk";const client = new Bridgly({ apiKey: "bgly_YOUR_KEY" });const res = await client.x.getUserMedia({ userId: "44196397", count: 10});if (res.type === "success") { console.log(res.data);}What does the Twitter Media API return?
Twitter media API: list an X (Twitter) account’s tweets with photos or videos, with direct media URLs, text, time and engagement counts, as JSON. Every response has the same envelope: the result in data, plus timeMs and the creditsCost of the call.
Request body
userIdstringrequired- Numeric user ID (rest_id) whose tweets to list, e.g. "44196397". Look it up from a handle with get-user.
cursorstring- The previous response's `nextCursor`, to fetch the next page. Omit it for the first page.
countinteger · 1–100 · default 10- Number of results to return (1–100). Defaults to 10.
Example response
{ "timeMs": 1840, "creditsCost": 1, "data": { "nextCursor": "string", "tweets": [ { "id": "string", "url": "string", "text": "string", "author": { "userId": "string", "username": "string", "profileUrl": "string", "displayName": "string", "bio": "string", "avatarUrl": "string", "bannerUrl": "string", "location": "string", "followerCount": 0, "followingCount": 0, "tweetCount": 0, "mediaCount": 0, "likeCount": 0, "listedCount": 0, "pinnedTweetId": "string", "pinnedTweetUrl": "string", "createdAt": "2026-01-15T09:30:00.000Z", "createdAtEpochMs": 0, "isVerified": true, "isBlueVerified": true }, "createdAt": "2026-01-15T09:30:00.000Z", "createdAtEpochMs": 0, "source": "string", "conversationId": "string", "replyCount": 0, "retweetCount": 0, "likeCount": 0, "quoteCount": 0, "bookmarkCount": 0, "viewCount": 0, "replyToTweetId": "string", "replyToUserId": "string", "replyToUsername": "string", "replyToTweetUrl": "string", "isQuote": true, "quotedTweetId": "string", "quotedTweetUrl": "string", "quotedTweetAuthorId": "string", "quotedTweetAuthorUsername": "string", "retweetedTweetId": "string", "retweetedTweetUrl": "string", "retweetedTweetAuthorId": "string", "retweetedTweetAuthorUsername": "string", "lang": "string", "isSensitive": true, "hashtags": [ "string" ], "mentions": [ { "userId": "string", "username": "string", "displayName": "string", "profileUrl": "string" } ], "urls": [ { "shortUrl": "string", "expandedUrl": "string", "displayUrl": "string" } ], "media": [ { "type": "photo", "url": "string", "mediaKey": "string", "mediaId": "string", "width": 0, "height": 0, "expandedUrl": "string", "videoUrl": "string", "durationMs": 0 } ] } ] }}What can you build with the Twitter Media API?
Collect visuals
Gather the images and videos an account has shared.
Study creative
Compare how media tweets perform against text-only ones.
Archive media
Save media URLs from accounts you track.
Twitter Media API questions
How do I get the images and videos from a Twitter account?
Get the account’s numeric user ID from the Twitter User API and send it as userId. Each tweet comes back with direct links to its photos and videos, plus the text and engagement counts; send the cursor for older ones.
Can I download the media files?
The response has direct media URLs, so your code can download the files. Make sure you have the right to use them.
How do I get all of a user’s photos and videos?
Set count to how many media tweets you want per call, up to 100 (10 by default). A page can hold fewer, so keep sending the nextCursor back as cursor until it is null.
How do I use the Twitter Media API?
Send a POST request to https://api.bridgly.app/x/get-user-media with userId in the JSON body and your API key in the Authorization header. In the TypeScript SDK, call client.x.getUserMedia(). AI agents connected to Bridgly over MCP can call the x_get_user_media tool.
How much does the Twitter Media API cost?
Costs 1 credit per result returned, with a minimum of 1 credit per request. Credits cost $2.00 per 1,000 on pay-as-you-go and as low as $1.00 per 1,000 at volume. New accounts on a business email start with 100 free credits, and failed requests are never charged.
More X (Twitter) endpoints
The same API key works on every endpoint. See all X (Twitter) API endpoints.
- Twitter Followers API→Twitter followers API: export the followers of any X (Twitter) account, each with handle, name, bio, location and follower and following counts, as JSON.
- Twitter Following API→Twitter following API: list the accounts any X (Twitter) user follows, each with handle, name, bio, location and follower and following counts, as JSON.
- Twitter User Search API→Twitter user search API: find X (Twitter) accounts by name or keyword, with handle, name, bio, location, website and follower, following and tweet counts.
- Twitter User API→Twitter profile API: get any X (Twitter) profile by handle with bio, location, website, follower and following counts, verification, join date and user ID.
Try the Twitter Media API
100 free credits on business email, no card. Your first call takes a minute.