swar / nba_api

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

[Bug]: DefenseHub not working? #395

Open ToTheHoop2023 opened 10 months ago

ToTheHoop2023 commented 10 months ago

NBA API Version

1.3.1

Issue

Trying to access the available data from the DefenseHub endpoint and not having much success. The error I am getting is "Expecting Value". I am working in Python and have included my code below. Whether I explicitly pass through all the parameters or not the error is the same. Am I overlooking something simple or is this broken? I saw a post from a couple of years ago but it wasn't clear to me if it was adrdessed, fixed etc.

Code

from nba_api.stats.endpoints import DefenseHub

df=DefenseHub(game_scope_detailed='Season', league_id='00', player_or_team='Team', player_scope='All Players', season='2023-24', season_type_playoffs='Regular Season')

nathanzjin commented 10 months ago

I think instead of using the DefenseHub endpoint you can use LeagueDashTeamStats and change the MeasureType parameter to "Defense"