bttmly / nba

Node.js client for nba.com API endpoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API to fetch team logo

fzymek opened this issue · comments

Hello

It would be great if there was an API call that will return url to team logo. Something like eg:

var url = nba.getTeamLogo(teamId)

here you go, this will get the URLs of the SVGs used on http://stats.nba.com/teams/

const nba = require("nba");
function teamLogoUrl (teamId) {
  const team = nba.teams.find(t => t.teamId === teamId);
  if (team == null) return null;
  return `http://stats.nba.com/media/img/teams/logos/${team.abbreviation}_logo.svg`
}

(if they change their image URLs this will break, but should be easy enough to fix based on whatever scheme they are using)

Great, thanks!