User object

User object

The User object contains Twitter User account metadata that describes the Twitter User referenced. Users can author Tweets, Retweet, quote other Users Tweets, reply to Tweets, follow Users, be @mentioned in Tweets and can be grouped into lists.

The Tweet object will also contain User objects of the Users involved within a Tweet.  In case of Retweets and Quoted Tweets, the top-level user object represents what account took that action, and the JSON payload will include a second user within the retweeted_status for the account that created the original Tweet.  User objects can be retireved using the id or screen_name.

In general these user metadata values are relatively constant. Some fields never change, such as the user's id (provided as a string id_str) and when the account was created. Other metadata can occasionally change, such as the screen_name, displayname, description, location, and other profile details. Some metadata frequently changes, such as the number of Tweets the account has posted statuses_count and its number of followers followers_count.
 

User Data Dictionary

AttributeTypeDescription
idInt64

The integer representation of the unique identifier for this User. This number is greater than 53 bits and some programming languages may have difficulty/silent defects in interpreting it. Using a signed 64 bit integer for storing this identifier is safe. Use id_str to fetch the identifier to be safe. See Twitter IDs for more information. Example:

"id": 6253282 
id_strString

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

"id_str": "6253282" 
nameString

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. Example:

"name": "Twitter API" 
screen_nameString

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. Example:

"screen_name": "twitterapi" 
locationString

Nullable . 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. Example:

"location": "San Francisco, CA" 
derivedArrays of Enrichment Objects

Enterprise APIs only Collection of Enrichment metadata derived for user. Provides the Profile Geo Enrichment metadata. See referenced documentation for more information, including JSON data dictionaries. Example:

"derived":{"locations": [{"country":"United States","country_code":"US","locality":"Denver"}]} 
urlString

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

"url": "https://developer.twitter.com" 
descriptionString

Nullable . The user-defined UTF-8 string describing their account. Example:

"description": "The Real Twitter API." 
protectedBoolean

When true, indicates that this user has chosen to protect their Tweets. See About Public and Protected Tweets . Example:

"protected": true 
verifiedBoolean

When true, indicates that the user has a verified account. See Verified Accounts . Example:

"verified": false 
followers_countInt

The number of followers this account currently has. Under certain conditions of duress, this field will temporarily indicate “0”. Example:

"followers_count": 21 
friends_countInt

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

"friends_count": 32 
listed_countInt

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

"listed_count": 9274 
favourites_countInt

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

"favourites_count": 13 
statuses_countInt

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

"statuses_count": 42 
created_atString

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

"created_at": "Mon Nov 29 21:18:15 +0000 2010" 
profile_banner_urlString

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. For size variants, please see User Profile Images and Banners .

Example:

"profile_banner_url": "https://si0.twimg.com/profile_banners/819797/1348102824" 
profile_image_url_httpsString

A HTTPS-based URL pointing to the user’s profile image. Example:

"profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png" 
default_profileBoolean

When true, indicates that the user has not altered the theme or background of their user profile. Example:

"default_profile": false 
default_profile_imageBoolean

When true, indicates that the user has not uploaded their own profile image and a default image is used instead. Example:

"default_profile_image": false 
withheld_in_countriesArray of String

When present, indicates a list of uppercase two-letter country codes this content is withheld from. Twitter supports the following non-country values for this field:

“XX” - Content is withheld in all countries “XY” - Content is withheld due to a DMCA request.

Example:

 "withheld_in_countries": ["GR", "HK", "MY"] 
withheld_scopeString

When present, indicates that the content being withheld is a “user.”

Example:

 "withheld_scope": "user" 


No longer supported (deprecated) attributes

FieldTypeDescription
utc_offsetnullValue will be set to null. Still available via GET account/settings
time_zonenullValue will be set to null. Still available via GET account/settings as tzinfo_name
langnullValue will be set to null. Still available via GET account/settings as language
geo_enablednullValue will be set to null.  Still available via GET account/settings. This field must be true for the current user to attach geographic data when using POST statuses / update
followingnullValue will be set to null. Still available via GET friendships/lookup
follow_request_sentnullValue will be set to null. Still available via GET friendships/lookup
has_extended_profilenullDeprecated. Value will be set to null.
notificationsnullDeprecated. Value will be set to null.
profile_locationnullDeprecated. Value will be set to null.
contributors_enablednullDeprecated. Value will be set to null.
profile_image_urlnullDeprecated. Value will be set to null. NOTE: Profile images are only available using the profile_image_url_https field.
profile_background_colornullDeprecated. Value will be set to null.
profile_background_image_urlnullDeprecated. Value will be set to null.
profile_background_image_url_httpsnullDeprecated. Value will be set to null.
profile_background_tilenullDeprecated. Value will be set to null.
profile_link_colornullDeprecated. Value will be set to null.
profile_sidebar_border_colornullDeprecated. Value will be set to null.
profile_sidebar_fill_colornullDeprecated. Value will be set to null.
profile_text_colornullDeprecated. Value will be set to null.
profile_use_background_imagenullDeprecated. Value will be set to null.
is_translatornull

Deprecated. Value will be set to null.

is_translation_enablednullDeprecated. Value will be set to null.
translator_typenullDeprecated. Value will be set to null.


Example user object:

{ "id": 6253282, "id_str": "6253282", "name": "Twitter API", "screen_name": "TwitterAPI", "location": "San Francisco, CA", "profile_location": null, "description": "The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.", "url": "https:\/\/t.co\/8IkCzCDr19", "entities": { "url": { "urls": [{ "url": "https:\/\/t.co\/8IkCzCDr19", "expanded_url": "https:\/\/developer.twitter.com", "display_url": "developer.twitter.com", "indices": [ 0, 23 ] }] }, "description": { "urls": [] } }, "protected": false, "followers_count": 6133636, "friends_count": 12, "listed_count": 12936, "created_at": "Wed May 23 06:01:13 +0000 2007", "favourites_count": 31, "utc_offset": null, "time_zone": null, "geo_enabled": null, "verified": true, "statuses_count": 3656, "lang": null, "contributors_enabled": null, "is_translator": null, "is_translation_enabled": null, "profile_background_color": null, "profile_background_image_url": null, "profile_background_image_url_https": null, "profile_background_tile": null, "profile_image_url": null, "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/942858479592554497\/BbazLO9L_normal.jpg", "profile_banner_url": null, "profile_link_color": null, "profile_sidebar_border_color": null, "profile_sidebar_fill_color": null, "profile_text_color": null, "profile_use_background_image": null, "has_extended_profile": null, "default_profile": false, "default_profile_image": false, "following": null, "follow_request_sent": null, "notifications": null, "translator_type": null }