bttmly / nba

Node.js client for nba.com API endpoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Team and Player Images

wkennedy8 opened this issue · comments

Is it possible to retrieve images for players and teams?

You can use this package to find the player id of a specific player. I noticed on the NBA's website, images include the player id in the URL – here's steph curry's: https://cdn.nba.com/headshots/nba/latest/1040x760/201939.png

and here's his entry in the players.json file:

  {    "firstName": "Stephen",    "lastName": "Curry",    "playerId": 201939,    "teamId": 1610612744  },

as you can see the player id matches, so I think you can take that URL and plug in any player id and get an image for the player.

not sure about team logos though – but there are only 30 of them and they rarely change so it seems less important to fetch them dynamically.