Get a user's latest tweets
GET
/twitter/user/last_tweets
const url = 'https://api.relayxapi.com/twitter/user/last_tweets';const options = { method: 'GET', headers: { 'X-API-Key': '<api-key>' },};
try { const res = await fetch(url, options); const data = await res.json(); console.log(data);} catch (err) { console.error(err);}curl --request GET \ --url 'https://api.relayxapi.com/twitter/user/last_tweets' \ --header 'X-API-Key: <api-key>'import requests
res = requests.get( "https://api.relayxapi.com/twitter/user/last_tweets", headers={"X-API-Key": "<api-key>"},)print(res.json())Return a user’s most recent posts and reposts, newest first.
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”userName
Username
string
userId
Userid
string
cursor
Cursor
string
includeReplies
Includereplies
boolean
Header Parameters
Section titled “Header Parameters”x-api-key
X-Api-Key
string
Responses
Section titled “ Responses ”Successful Response
Media typeapplication/json
Example
{ "tweets": [ { "type": "tweet", "id": "2103243305685225779", "url": "https://x.com/i/status/2103243305685225779", "text": "Welcome to the Artemis Accords, Côte d'Ivoire 🇨🇮\n \nCôte d'Ivoire is the 75th country to sign the Artemis Accords. In doing so, they commit to a common set of principles for a safe, peaceful, and prosperous future in space. https://t.co/lT9f9Kooo2 https://t.co/9Wf1T1ndGz", "retweetCount": 281, "replyCount": 109, "likeCount": 2490, "quoteCount": 24, "viewCount": "665904", "bookmarkCount": 190, "createdAt": "Thu Sep 24 22:00:55 +0000 2026", "lang": "en", "isReply": false, "inReplyToId": null, "conversationId": null, "displayTextRange": [ 0, 246 ], "entities": { "hashtags": [], "symbols": [], "urls": [ { "display_url": "go.nasa.gov/3V1mgyS", "expanded_url": "https://go.nasa.gov/3V1mgyS", "indices": [ 223, 246 ], "url": "https://t.co/lT9f9Kooo2" } ], "user_mentions": [], "media": [ { "display_url": "pic.x.com/9Wf1T1ndGz", "expanded_url": "https://x.com/NASA/status/2103243305685225779/photo/1", "features": {}, "id_str": "2103243297779003393", "indices": [ 247, 270 ], "media_results": { "id": "QXBpTWVkaWFSZXN1bHRzOgwAAQoAAR0wOKLIVrABCgACHTA4pJ+WETMAAA==", "result": { "__typename": "ApiMedia", "id": "QXBpTWVkaWE6DAABCgABHTA4oshWsAEKAAIdMDikn5YRMwAA", "media_availability_v2": { "status": "Available" }, "media_id": "2103243297779003393", "media_info": { "__typename": "ApiImage", "alt_text": "A graphic featuring the names and flags of the countries which have signed the Artemis Accords. \"ARTEMIS ACCORDS\" is written at the top.", "color_info": { "palette": [ { "percentage": 71.19, "rgb": { "blue": 22, "green": 11, "red": 4 } }, { "percentage": 3.19, "rgb": { "blue": 215, "green": 209, "red": 211 } } ] }, "original_img_height": 3375, "original_img_url": "https://pbs.twimg.com/media/HTA4oshWsAEdzZL.jpg", "original_img_width": 6000 } } }, "url": "https://t.co/9Wf1T1ndGz" } ] }, "quoted_tweet": null, "author": { "type": "user", "userName": "NASA", "url": "https://x.com/NASA", "id": "11348282", "name": "NASA", "isBlueVerified": true, "description": "Making the seemingly impossible, possible. ✨", "location": null, "followers": 92374422, "following": 117, "statusesCount": null, "createdAt": "Wed Dec 19 20:20:32 +0000 2007", "profilePicture": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/11348282/1788992290", "canDm": false, "pinnedTweetIds": [], "profile_bio": { "description": "Making the seemingly impossible, possible. ✨", "entities": { "description": {} } } } }, { "type": "tweet", "id": "2103238811165524053", "url": "https://x.com/i/status/2103238811165524053", "text": "Meet Crew-14!\n\nNASA astronauts Kayla Barron and Chris Birch, JAXA (Japan Aerospace Exploration Agency) astronaut Makoto Suwa, and Roscosmos cosmonaut Arutyun Kiviryan will lift off to the @example_user no earlier than March 2027. https://t.co/lxGnP5SJKP https://t.co/9NxfvVrlct", "retweetCount": 412, "replyCount": 97, "likeCount": 2726, "quoteCount": 57, "viewCount": "718335", "bookmarkCount": 95, "createdAt": "Thu Sep 24 21:43:03 +0000 2026", "lang": "en", "isReply": false, "inReplyToId": null, "conversationId": null, "displayTextRange": [ 0, 254 ], "entities": { "hashtags": [], "symbols": [], "urls": [ { "display_url": "go.nasa.gov/4rylBkH", "expanded_url": "https://go.nasa.gov/4rylBkH", "indices": [ 231, 254 ], "url": "https://t.co/lxGnP5SJKP" } ], "user_mentions": [ { "id_str": "1900000001", "indices": [ 188, 202 ], "name": "Example User", "screen_name": "example_user" } ], "media": [ { "display_url": "pic.x.com/9NxfvVrlct", "expanded_url": "https://x.com/NASA/status/2103238811165524053/photo/1", "features": {}, "id_str": "2103238807902367744", "indices": [ 255, 278 ], "media_results": { "id": "QXBpTWVkaWFSZXN1bHRzOgwAAQoAAR0wNI1m1jAACgACHTA0jilWAFUAAA==", "result": { "__typename": "ApiMedia", "id": "QXBpTWVkaWE6DAABCgABHTA0jWbWMAAKAAIdMDSOKVYAVQAA", "media_availability_v2": { "status": "Available" }, "media_id": "2103238807902367744", "media_info": { "__typename": "ApiImage", "alt_text": "The four members of NASA's SpaceX Crew-14 mission stand in their flight suits, white with black trim, and smile at the camera. Credit: SpaceX", "color_info": { "palette": [ { "percentage": 78.12, "rgb": { "blue": 228, "green": 227, "red": 225 } }, { "percentage": 12.82, "rgb": { "blue": 115, "green": 113, "red": 109 } } ] }, "original_img_height": 1287, "original_img_url": "https://pbs.twimg.com/media/HTA0jWbWMAAAaDf.jpg", "original_img_width": 2000 } } }, "url": "https://t.co/9NxfvVrlct" } ] }, "quoted_tweet": null, "author": { "type": "user", "userName": "NASA", "url": "https://x.com/NASA", "id": "11348282", "name": "NASA", "isBlueVerified": true, "description": "Making the seemingly impossible, possible. ✨", "location": null, "followers": 92374422, "following": 117, "statusesCount": null, "createdAt": "Wed Dec 19 20:20:32 +0000 2007", "profilePicture": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_normal.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/11348282/1788992290", "canDm": false, "pinnedTweetIds": [], "profile_bio": { "description": "Making the seemingly impossible, possible. ✨", "entities": { "description": {} } } } } ], "status": "success", "message": "", "has_next_page": true, "next_cursor": "DAAHCgABHTER3Eg__-kLAAIAAAATMjA5ODUyMDcwOTA1NjA2NTk4OQgAAwAAAAIAAA"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}