By User Id

GET/tw-v2/user/by-id

Description

Retrieve comprehensive user profile information using a Twitter/X user ID. Returns detailed user data including statistics, verification status, and profile metadata.

Parameters

ParameterTypeRequiredDescription
userIdstringrequiredUnique Twitter/X user ID (e.g., '44196397')

Code Examples

const params = new URLSearchParams({
  userId: '44196397'
});

const response = await fetch(`https://api.tweetapi.com/tw-v2/user/by-id?${params}`, {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_API_KEY'
  }
});

const data = await response.json();
console.log(data);

Response

Success Response (200 OK)

200
{
  "data": {
    "id": "44196397",
    "username": "elonmusk",
    "name": "Elon Musk",
    "bio": "https://t.co/9qhgzJ69UQ",
    "location": null,
    "website": null,
    "pinnedTweetIds": [
      "1973288477988143277"
    ],
    "avatar": "https://pbs.twimg.com/profile_images/1936002956333080576/kqqe2iWO_400x400.jpg",
    "banner": "https://pbs.twimg.com/profile_banners/44196397/1739948056/1500x500",
    "profileImageShape": "Circle",
    "verified": false,
    "isBlueVerified": true,
    "verifiedType": null,
    "verifiedSince": null,
    "isIdentityVerified": false,
    "isProtected": false,
    "possiblySensitive": false,
    "profileInterstitialType": null,
    "withheldInCountries": [],
    "professional": {
      "type": "Creator",
      "category": [],
      "restId": "1679729435447275522"
    },
    "businessAccount": {
      "affiliatesCount": 0
    },
    "creatorSubscriptionsCount": 225,
    "hasHiddenSubscriptions": false,
    "highlightsInfo": {
      "canHighlight": true,
      "highlightedTweetsCount": "758"
    },
    "hasGraduatedAccess": true,
    "isProfileTranslatable": false,
    "hasCustomTimelines": true,
    "isTranslator": false,
    "affiliatesHighlightedLabel": {
      "label": {
        "url": {
          "url": "https://twitter.com/X",
          "urlType": "DeepLink"
        },
        "badge": {
          "url": "https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg"
        },
        "description": "X",
        "userLabelType": "BusinessLabel",
        "userLabelDisplayType": "Badge"
      }
    },
    "defaultProfile": false,
    "defaultProfileImage": false,
    "followerCount": 226995890,
    "followingCount": 1218,
    "tweetCount": 86745,
    "listedCount": 164447,
    "mediaCount": 4162,
    "favoritesCount": 174837,
    "createdAt": "2009-06-02T20:12:29.000Z"
  }
}

API Playground

GET/tw-v2/user/by-id

Press ⌘ + Enter to execute

curl -X GET "https://api.tweetapi.com/tw-v2/user/by-id" \
  -H "X-API-Key: YOUR_API_KEY"
Response

Click "Try It!" to see the response