Twitter API 1.1 User Image and name

2019-05-07 17:33发布

Twitter provided a great 1.0 API. I could grab an user image just like this:

http://api.twitter.com/1/users/profile_image/twitter

Does the 1.1 update give anything like this away for free? Or does the 1.1 update require authentication for a user image and user name? I noticed there is no equivalent call in the docs.

and this does not work:

 http://api.twitter.com/1.1/users/profile_image/twitter

标签: rest twitter
2条回答
▲ chillily
2楼-- · 2019-05-07 17:42

You should find your answers in the Twitter API docs here:

https://dev.twitter.com/docs/user-profile-images-and-banners

e.g: https://api.twitter.com/1.1/users/show.json?screen_name=twitterapi

and it does requires Authentication to retrieve it:

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-05-07 17:58

You can only get the user image and user name with authentication. If you're trying to get the user profile image with Abraham's twitteroauth, then I guess this link will help you. You can get the user name similarly by calling the name object and display it.

查看更多
登录 后发表回答