11

I am using Twitter API version 1 and replacing them to v1.1.
Then I cannot find users/profile_image/:screen_name API on version 1.1.

https://api.twitter.com/1/users/profile_image/shonanshachu

Does anyone know which API can be the best practice for replacing users/profile_image?
What I want is list of profile images or simple url with parameter of Twitter ID or screen name.

4

2 回答 2

2

I haven't found a great solution to this yet. The closest thing I have found is the twitter API 1.1 docs for users/show, but that is an authenticated call (requiring a user context) which is rate-limited (180 requests per 15 minutes). They mention this about getting the profile image url on the page about uploading a new photo:

You can either update your local cache the next time you request the user's information, or, at least 5 seconds after uploading the image, ask for the updated URL using GET users/show.

I imagine once the 1.0 API is shut off in March 2013, this question will get a lot of votes. :)

There are some hints that twitter is adding methods to their API to aid in retrieving images. We'll have to wait and see.

于 2012-10-31T03:02:26.627 回答
2

Maybe this will be useful for you. Those calls return all the info you need, including the image link. If you need only one user's image for a given user_id or user_screen, then you can read more from here: https://dev.twitter.com/docs/user-profile-images-and-banners

https://api.twitter.com/1.1/followers/list.json (you can replace followers with friends)

于 2013-03-14T10:23:31.133 回答