swar / nba_api

An API Client package to access the APIs for NBA.com
MIT License
2.49k stars 534 forks source link

How can I get player's current team and JERSEY_NUM? #24

Closed whichen closed 5 years ago

whichen commented 5 years ago

I want to get player's current team and his JERSER_NUM. I can only find JERSERY_NUM in infographicfanduelplayer, but I also need to provide a game_id to get it. Is there a easier way?

swar commented 5 years ago

https://github.com/swar/nba_api/blob/master/analysis_archive/stats/analysis.json

Ctrl+F will help locate the fields that you need in each endpoint that it exists in.

BoxScoreSummaryV2 -> InactivePlayers and Officials Datasets InfographicFanDuelPlayer -> FanDuelPlayer Dataset

However, it looks like there is a JERSEY field as well

CommonPlayerInfo -> CommonPlayerInfo Dataset TeamDetails -> TeamHof and TeamRetired Datasets

And it looks like there is a NUM field as well

CommonTeamRoster -> CommonTeamRoster Dataset.

I would refer to CommonTeamRoster and then cycle through all the Teams. That'll probably be the quickest approach as opposed to filter through all GameIDs or PlayerIDs.

whichen commented 5 years ago

https://github.com/swar/nba_api/blob/master/analysis_archive/stats/analysis.json

Ctrl+F will help locate the fields that you need in each endpoint that it exists in.

BoxScoreSummaryV2 -> InactivePlayers and Officials Datasets InfographicFanDuelPlayer -> FanDuelPlayer Dataset

However, it looks like there is a JERSEY field as well

CommonPlayerInfo -> CommonPlayerInfo Dataset TeamDetails -> TeamHof and TeamRetired Datasets

And it looks like there is a NUM field as well

CommonTeamRoster -> CommonTeamRoster Dataset.

I would refer to CommonTeamRoster and then cycle through all the Teams. That'll probably be the quickest approach as opposed to filter through all GameIDs or PlayerIDs.

Thank you, Swar.