Zmalski / NHL-API-Reference

Unofficial reference for the NHL API endpoints.
MIT License
263 stars 20 forks source link

Team's Logo and Player's Avatar #12

Open KostyaLyapochkin opened 9 months ago

KostyaLyapochkin commented 9 months ago

Is it possible to get logo per each team with one request and load player's avatar? Or maybe there is another approach?

Zmalski commented 8 months ago

Unsure about logos, but I believe the official source for player headshots/avatars is "https://cms.nhl.bamgrid.com/images/headshots/current/168x168/${player.id}.jpg"

Zmalski commented 8 months ago

There's also "https://assets.nhle.com/mugs/nhl/[SEASON_ID}/[TEAM_CODE]/[PLAYER_ID}.png" for player mugshots

owen-duncan-snobel commented 8 months ago

You can get the team logos with the following:

Light version: https://assets.nhle.com/logos/nhl/svg/[teamAbbrev]_light.svg Dark version: https://assets.nhle.com/logos/nhl/svg/[teamAbbrev]_dark.svg

ex. https://assets.nhle.com/logos/nhl/svg/TOR_light.svg https://assets.nhle.com/logos/nhl/svg/TOR_dark.svg

You can find the abbreviations for each team: https://api.nhle.com/stats/rest/en/team