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
As of February 20, 2020 it would appear this is impossible. Using the API seems like the only option at the moment. For more info see my question I've opened here: Twitter profile picture images now blocked on most domains
With version 1.1, use http://a0.twimg.com/profile_images/XXXXX/afpecvf41m8f0juql78p_normal.png where XXXXX is the User Id
With API 1.1 you can achieve this using these URLs:
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
Introducing the easiest way to get a Twitter Profile Image without using the Twitter API:
Using http://avatars.io/
As @AlexB, @jfred says, it doesn't work at all on mobile devices.
And it's quite a hard way to get a redirected URL using common frameworks like PHP or JavaScript in your single page.
Simply call http://avatars.io/twitter/ruucm
at your image tag, like
<img src="https://avatars.io/twitter/ruucm" alt="twt_profile" border="0" width="259"/>
I've tested it with Angular 2+ and it works without any problem.