ProfileImageSize

enum ProfileImageSize : Enum<ProfileImageSize>

Profile images (also known as avatars) are an important component of a Twitter account’s expression of identity. To upload a profile image on behalf of a user, use POST account / update_profile_image.

** Alternative image sizes for user profile images **

Obtain a user’s most recent profile image, along with the other components comprising their identity on Twitter, from GET users/show. The user object contains the profile_image_url and profile_image_url_https fields. These fields will contain the resized “normal” variant of the user’s uploaded image. This “normal” variant is typically 48px by 48px. By modifying the URL, it is possible to retrieve other variant sizings such as “bigger”, “mini”, and “original”. Consult the table below for more examples:

** Default profile images **

Some users may not have uploaded a profile image. Users who have not uploaded a profile image can be identified by the default_profile_image field of their user object having a true value. The profile_image_url and profile_image_url_https URLs provided for users in this case will indicate Twitter’s default profile photo, which is https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png. The table above can be used to determine how to retrieve different size variants of the default image.

** Outdated profile images ** If a 403 or 404 error is returned when trying to access a profile image, refresh the user object using GET users/show to retrieve the most recent profile_image_url or profile_image_url_https. The URL may have changed, which happens for instance when the user updates their profile image.

Twitter API reference

Entries

Link copied to clipboard

48x48.

Link copied to clipboard

73x73.

Link copied to clipboard

24x24.

Link copied to clipboard

Original.

Properties

Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int