Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Twitter profile image url with Twitter user id

Tags:

twitter

Is there any way of building a profile image url with user id or screen name? I store user ids in database but i don't want to store profile image url.

edit:
I don't want to make a api call too. I want to put user_id inside a url like

<img src="https://twitter.com/users/profile_pic?user_id=123"> Is there a url to do this?

like image 599
mcan Avatar asked Aug 22 '13 13:08

mcan


People also ask

How do you get a Twitter URL for a picture?

1. Right-click an image you see on the Internet to display a menu. The menu will contain an option that allows you to copy the image's URL. The option's text may read “Copy Link Location,” “Copy Image URL” or “Copy Image Address.”

What is profile banner in Twitter?

Profile banners allow users to further customize the expressiveness of their profiles. Use POST account/update_profile_banner to upload a profile banner on behalf of a user. Profile banners come in a variety of display-enhanced sizes.


1 Answers

With API 1.1 you can achieve this using these URLs:

  • https://twitter.com/[screen_name]/profile_image?size=mini
  • https://twitter.com/[screen_name]/profile_image?size=normal
  • https://twitter.com/[screen_name]/profile_image?size=bigger
  • https://twitter.com/[screen_name]/profile_image?size=original

Official twitter documentation Profile Images and Banners

Example

https://twitter.com/TwitterEng/profile_image?size=original 

will redirect to

https://pbs.twimg.com/profile_images/875168599299637248/84CkAq6s.jpg 
like image 191
Cristiana Chavez Avatar answered Sep 26 '22 00:09

Cristiana Chavez