By Username

GET/tw-v2/user/by-username

Description

Retrieve comprehensive user profile information using a platform username. Returns detailed user data including statistics, verification status, and profile metadata.

Parameters

Need one account ID without writing code? Try the Twitter user ID finder.

ParameterTypeRequiredDescription
usernamestringrequiredplatform username without @ symbol (e.g., 'sample_user_96991')

Code Examples

const params = new URLSearchParams({
  username: 'sample_user_96991'
});

const response = await fetch(`https://api.tweetapi.com/tw-v2/user/by-username?${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": "10017528",
    "username": "sample_user_96991",
    "name": "Sample User 96991",
    "bio": "Sample profile bio for Sample User 96991.",
    "location": null,
    "website": null,
    "pinnedTweetIds": [
      "2001738170940982678"
    ],
    "avatar": "https://example.com/images/sample-avatar-96991.jpg",
    "banner": "https://example.com/images/sample-banner-96991.jpg",
    "profileImageShape": "Circle",
    "verified": false,
    "isBlueVerified": true,
    "verifiedType": null,
    "verifiedSince": null,
    "isIdentityVerified": false,
    "isProtected": false,
    "possiblySensitive": false,
    "profileInterstitialType": null,
    "withheldInCountries": [],
    "professional": {
      "type": "Creator",
      "category": [],
      "restId": "9001630152611040706"
    },
    "businessAccount": {
      "affiliatesCount": 0
    },
    "creatorSubscriptionsCount": 225,
    "hasHiddenSubscriptions": true,
    "highlightsInfo": {
      "canHighlight": true,
      "highlightedTweetsCount": "758"
    },
    "hasGraduatedAccess": true,
    "isProfileTranslatable": false,
    "hasCustomTimelines": true,
    "isTranslator": false,
    "affiliatesHighlightedLabel": {
      "label": {
        "url": {
          "url": "https://example.com/link-94089/profile-41921/X",
          "urlType": "DeepLink"
        },
        "badge": {
          "url": "https://example.com/link-94089/profile-29900/media/sample-media-25883.jpg"
        },
        "description": "Sample description for documentation 53418.",
        "userLabelType": "BusinessLabel",
        "userLabelDisplayType": "Badge"
      }
    },
    "defaultProfile": false,
    "defaultProfileImage": false,
    "followerCount": 226995885,
    "followingCount": 1218,
    "tweetCount": 86745,
    "listedCount": 164447,
    "mediaCount": 4162,
    "favoritesCount": 174837,
    "createdAt": "2009-06-02T20:12:29.000Z"
  }
}