X (TWITTER) API

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
Terminal
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
}'
[ REQUEST AND RESPONSE ]

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

200 OK · application/json
{
"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
}
]
}
]
}
}
[ USE CASES ]

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.

[ FAQ ]

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.

Try the Twitter Media API

100 free credits on business email, no card. Your first call takes a minute.

APIMCPSDKCLI
free credits

On business email signup. No credit card required.

Start free with 100 credits