User object

The User object contains public Twitter account metadata and describes the of the Tweet. Users can be anyone or anything. They Tweet, Retweet, add Quotes to Tweets, follow others, create lists, have a home timeline, can be mentioned, and can be looked up in bulk.

Example user web intent

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 for the account that created the original Tweet.

In general these user metadata values are relatively constant. Some fields never change, such as the account ID (provided as both a number and a string) and when the account was created. Other metadata can occasionally change, such as the account (display) name, 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

Attribute Type Description
id Int64

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 for fetching the identifier to stay on the safe side. See Twitter IDs, JSON and Snowflake . Example:

"id": 6253282
id_str String

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"
name String

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

"name": "Twitter API"
screen_name String

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"
location String

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"
url String

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

"url": "https://dev.twitter.com"
description String

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

"description": "The Real Twitter API."
derived Arrays of Enrichment Objects

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": [{}]
          }
protected Boolean

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

"protected": true
verified Boolean

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

"verified": false
followers_count Int

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

"followers_count": 21
friends_count Int

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_count Int

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

"listed_count": 9274
favourites_count Int

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_count Int

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

"statuses_count": 42
created_at String

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

"created_at": "Mon Nov 29 21:18:15 +0000 2010"
utc_offset null
Value will be set to null.
time_zone null
Value will be set to null.
geo_enabled Boolean

When true, indicates that the user has enabled the possibility of geotagging their Tweets. This field must be true for the current user to attach geographic data when using POST statuses / update . Example:

"geo_enabled": true
lang String

The BCP 47 code for the user’s self-declared user interface language. May or may not have anything to do with the content of their Tweets. Examples:

"lang": "en"
"lang": "msa"
"lang": "zh-cn"
contributors_enabled Boolean

Indicates that the user has an account with “contributor mode” enabled, allowing for Tweets issued by the user to be co-authored by another account. Rarely true (this is a legacy field) Example:

"contributors_enabled": false
profile_background_color String

The hexadecimal color chosen by the user for their background. Example:

"profile_background_color": "e8f2f7"
profile_background
_image_url
String

A HTTP-based URL pointing to the background image the user has uploaded for their profile. Example:

"profile_background_image_url":
"http://a2.twimg.com/profile_background_images/229557229/twitterapi-bg.png"
profile_background_
image_url_https
String

A HTTPS-based URL pointing to the background image the user has uploaded for their profile. Example:

"profile_background_image_url_https":
"https://si0.twimg.com/profile_background_images/229557229/twitterapi-bg.png"
profile_background_tile Boolean

When true, indicates that the user’s profile_background_image_url should be tiled when displayed. Example:

"profile_background_tile": false
profile_banner_url String

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 String

A HTTP-based URL pointing to the user’s profile image. See User Profile Images and Banners . Example:

"profile_image_url":
"http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png"
profile_image_url_https String

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"
profile_link_color String

The hexadecimal color the user has chosen to display links with in their Twitter UI. Example:

"profile_link_color": "0094C2"
profile_sidebar_border_color String

The hexadecimal color the user has chosen to display sidebar borders with in their Twitter UI. Example:

"profile_sidebar_border_color": "0094C2"
profile_sidebar_fill_color String

The hexadecimal color the user has chosen to display sidebar backgrounds with in their Twitter UI. Example:

"profile_sidebar_fill_color": "a9d9f1"
profile_text_color String

The hexadecimal color the user has chosen to display text with in their Twitter UI. Example:

"profile_text_color": "437792"
profile_use_background_image Boolean

When true, indicates the user wants their uploaded background image to be used. Example:

"profile_use_background_image": true
default_profile Boolean

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

"default_profile": false
default_profile_image Boolean

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_countries Array 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_scope String

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

Example:

"withheld_scope": "user"

Deprecated Attributes

Field Type Description
is_translator Boolean

Deprecated. When true, indicates that the user is a participant in Twitter’s translator community . Example:

"is_translator": false
following Type

Deprecated. Nullable . Perspectival . Deprecated. When true, indicates that the authenticating user is following this user. Some false negatives are possible when set to “false,” but these false negatives are increasingly being represented as “null” instead. Example:

"following": true
notifications Boolean Deprecated. Nullable .May incorrectly report “false” at times. Indicates whether the authenticated user has chosen to receive this user’s Tweets by SMS. 

Next Steps

Explore the other sub-objects that a Tweet contains: