nba_py icon indicating copy to clipboard operation
nba_py copied to clipboard

Player Profile Picture

Open emmanuelobo opened this issue 6 years ago • 3 comments

Does the api release the profile picture of the players?

emmanuelobo avatar Dec 28 '17 23:12 emmanuelobo

Yes. You can see on my site

http://namalliv.com/yearly/roster/1610612752/

noelvillaman avatar Feb 03 '18 14:02 noelvillaman

Noelvillaman, can you share what function you used in nba_py to pull the image?

BenikaH avatar Feb 19 '18 13:02 BenikaH

Hi BenikaH,

In fact, I just get the playerid from team.TeamCommonRoster(teamid, season='2017-18')['PLAYER_ID'] and I use the id to complete the url since it is formed by using the player id, like this

src="http://ak-static.cms.nba.com/wp-content/uploads/headshots/nba/latest/260x190/{{ player_id }}.png

This first part is copied from nba and player_id is what I add to get the image. As I said, it is just the id. I hope this is clear, if not let me know. But the function is

from nba_py import team, then use team.TeamCommonRoster(team_id,...)

Noel.

noelvillaman avatar Feb 19 '18 19:02 noelvillaman