v6

latestOpenAPI 3.0.0raw.githubusercontent.com2025-03-123918105.6 KB
Data API

Get User Profile by Username

Retrieve detailed user information by their Twitter username.

get/twitter/user/{username}

Path parameters

usernamestring required

The username of the target user profile without @.

Response

Request succeeded

id_strstring required

The string representation of the unique identifier for this User. Implementations should use this rather than the large, possibly un-consumable integer in id.

namestring required

The name of the user, as they've defined it. Not necessarily a person's name. Typically capped at 50 characters, but subject to change.

screen_namestring required

The screen name, handle, or alias that this user identifies themselves with. screen_names are unique but subject to change. Use id_str as a user identifier whenever possible. Typically a maximum of 15 characters long, but some historical accounts may exist with longer names.

locationstring required

The user-defined location for this account's profile. Not necessarily a location, nor machine-parseable. This field will occasionally be fuzzily interpreted by the Search service.

urlstring nullable

A URL provided by the user in association with their profile.

descriptionstring required

The user-defined UTF-8 string describing their account.

protectedboolean required

When true, indicates that this user has chosen to protect their Tweets.

verifiedboolean required

When true, indicates that the user has a verified account with a blue checkmark.

followers_countinteger required

The number of followers this account currently has. Under certain conditions of duress, this field will temporarily indicate "0".

friends_countinteger required

The number of users this account is following (AKA their "followings"). Under certain conditions of duress, this field will temporarily indicate "0".

listed_countinteger required

The number of public lists that this user is a member of.

favourites_countinteger required

The number of Tweets this user has liked in the account's lifetime. British spelling used in the field name for historical reasons.

statuses_countinteger required

The number of Tweets (including retweets) issued by the user.

created_atstring required

The UTC datetime that the user account was created on Twitter.

profile_banner_urlstring required

The HTTPS-based URL pointing to the standard web representation of the user's uploaded profile banner. By adding a final path element of the URL, it is possible to obtain different image sizes optimized for specific displays.

profile_image_url_httpsstring required

A HTTPS-based URL pointing to the user's profile image.

can_dmboolean required

Indicates whether the authenticated user can send a direct message to this user.

Example response

{
  "id_str": "6253282",
  "name": "Twitter API",
  "screen_name": "twitterapi",
  "location": "San Francisco, CA",
  "url": "https://developer.twitter.com",
  "description": "The Real Twitter API.",
  "protected": true,
  "followers_count": 21,
  "friends_count": 32,
  "listed_count": 9274,
  "favourites_count": 13,
  "statuses_count": 42,
  "created_at": "2009-06-02T20:12:29.000000Z",
  "profile_banner_url": "https://si0.twimg.com/profile_banners/819797/1348102824",
  "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png"
}