In 1.0, I could retrieve the image via GET users/profile_image/:screen_name. I don’t see a 1.1 equivalent. Help?
How to get user image original size with API 1.1
Would love to know the answer to this query as well. Running into this myself and wondering if the 1.0 way of grabbing a user’s profile image (bigger/normal/etc.) will stop working once 1.1 is out and 1.0 is bye-bye.
See [node:10796] for information on determining different sizes for Twitter avatars in 1.1 (and v1 for that matter).
Is there a way to get it without making a whole new request, like Facebook and Google+:
https://graph.facebook.com/#{facebook_id}/picture
https://profiles.google.com/s2/photos/profile/#{google_id}
@jwerre - Hey man, in order to get the original image, take the address they give you from the API call, eg. statuses[0].user.profile_image_url, and strip off the “_normal” from the file name. In other words,
and that’s the full sized image. Hope that helps!
in php
code bad but funcional xD!, you can replace $size for bigger , mini etc
or
echo str_replace(’_normal’, ‘_bigger’,$tweet->user->profile_image_url)
In API v1.1, the Twitter docs now tell you to “modify the URL” rather than make another request to get the URL for a different image size. So basically, like @pete_klein said, take the profile_image_url from a previous API call (like get friends) and do a string replacement for “normal” to “bigger” or “normal” to “” to get larger profile images.
It feels a little sneaky, but so long as the conventions don’t change it’s one less API call for Twitter’s servers to respond to, and one less API call for your client to make.
Worth noting that you can also just use https://twitter.com/[screen_name]/profile_image?size=original. For instance, https://twitter.com/isaach/profile_image?size=original.
@issaach
Is that an officially supported endpoint? I can’t seem to find it in the docs.
It’s not in the docs because it’s not part of the API. It’s a supported part of the twitter.com site, though.