Get Latest Tweet
GET
Get the latest tweet posted by a specific username
GET /api/v1/twitter/users/latest_tweet/:username
Authorization
X-API-Key
stringrequired
Parameters
Name | Type | Required | Description |
---|---|---|---|
username | string | required | The Twitter username |
Example Request
curl -X GET \
"https://api.xscraper.xyz/api/v1/twitter/users/latest_tweet/elonmusk" \
-H "X-API-Key: "
Response
Latest Tweet
application/json
{
"data": {
"id": "1722715025402413077",
"text": "This is the latest tweet from this user",
"username": "elonmusk",
"name": "Elon Musk",
"userId": "44196397",
"likes": 75000,
"replies": 8000,
"retweets": 15000,
"views": 3000000,
"timeParsed": "2025-04-19T10:30:00.000Z",
"hashtags": ["latest", "tweet"],
"mentions": [],
"photos": [],
"videos": [],
"urls": [],
"isReply": false,
"isRetweet": false,
"isQuoted": false
},
"meta": {
"statusCode": 200,
"timestamp": "2025-04-19T15:49:28.824Z"
}
}
Error Responses
401 Unauthorized
{
"statusCode": 401,
"timestamp": "2025-04-19T15:49:28.824Z",
"path": "/api/v1/twitter/users/latest_tweet/elonmusk",
"method": "GET",
"message": "Invalid or expired API key"
}
404 Not Found
{
"statusCode": 404,
"timestamp": "2025-04-19T15:49:28.824Z",
"path": "/api/v1/twitter/users/latest_tweet/nonexistentuser",
"method": "GET",
"message": "User not found or has no tweets"
}