swar / nba_api

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

[Bug]: BoxScoreTraditionalV3 seems to be broken #480

Open hackerDEpandas opened 1 week ago

hackerDEpandas commented 1 week ago

NBA API Version

V1.6.1

Issue

Im getting list index out of range error when trying to call the box score v3 endpoint. I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sims/Projects/nba-fanduel/venv/lib/python3.9/site-packages/nba_api/stats/endpoints/boxscoretraditionalv3.py", line 141, in __init__
    self.get_request()
  File "/Users/sims/Projects/nba-fanduel/venv/lib/python3.9/site-packages/nba_api/stats/endpoints/boxscoretraditionalv3.py", line 151, in get_request
    self.load_response()
  File "/Users/sims/Projects/nba-fanduel/venv/lib/python3.9/site-packages/nba_api/stats/endpoints/boxscoretraditionalv3.py", line 154, in load_response
    data_sets = self.nba_response.get_data_sets(self.endpoint)
  File "/Users/sims/Projects/nba-fanduel/venv/lib/python3.9/site-packages/nba_api/stats/library/http.py", line 150, in get_data_sets
    return endpoint_parser.get_data_sets()
  File "/Users/sims/Projects/nba-fanduel/venv/lib/python3.9/site-packages/nba_api/stats/library/parserv3.py", line 185, in get_data_sets
    x for x in self.get_team_headers() if x not in ("starters", "bench")
  File "/Users/sims/Projects/nba-fanduel/venv/lib/python3.9/site-packages/nba_api/stats/library/parserv3.py", line 7, in get_team_headers
    tmp = self.nba_dict[list(self.nba_dict.keys())[1]]
IndexError: list index out of range

any ideas?

Code

from nba_api.stats.endpoints import boxscoretraditionalv3
data = boxscoretraditionalv3.BoxScoreTraditionalV3(game_id='42300404')
print(data)