Get User Tweets

GET

Get tweets posted by a specific username

GET /api/v1/twitter/users/tweets/:username

Authorization

X-API-Key
string
required

Parameters

NameTypeRequiredDescription
usernamestring
required
The Twitter username
maxTweetsnumber
optional
Number of tweets to fetch (default: 20, max: 200)
Default: 20

Example Request

curl -X GET \
  "https://api.xscraper.xyz/api/v1/twitter/users/tweets/elonmusk?maxTweets=20" \
  -H "X-API-Key: "

Response

User Tweets
application/json
{
  "data": [
    {
      "id": "1722715025402413077",
      "text": "This is a sample tweet",
      "username": "elonmusk",
      "name": "Elon Musk",
      "userId": "44196397",
      "likes": 50000,
      "replies": 5000,
      "retweets": 10000,
      "views": 2000000,
      "timeParsed": "2025-04-18T15:30:00.000Z",
      "hashtags": ["sample", "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/tweets/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/tweets/nonexistentuser",
  "method": "GET",
  "message": "User not found"
}