swar / nba_api

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

[Bug]: BoxScoreMiscV3 and related classes and Start_Period and End_Period #436

Open rupink opened 7 months ago

rupink commented 7 months ago

NBA API Version

V1.4.7

Issue

The StartPeriod and EndPeriod parameters (which just return a string that contains the numbers 1-4) are being used with the boxscoremiscv3 and related classes. However, these calls do not return information based on the quarters, regardless of what information you place into the parameters. The provided code is an example where the call does not return the specified data between the second and third quarter of the game_id = '0021701171'. I wonder if I am implementing this wrong. Or if this is truly is a bug. I am running the script locally.

Code

from nba_api.stats.endpoints import boxscoremiscv3 from nba_api.stats.library.parameters import Period, StartPeriod, EndPeriod box_scores = boxscoremiscv3.BoxScoreMiscV3(game_id = '0021701171' , start_period = StartPeriod.second, end_period = EndPeriod.third)

shufinskiy commented 5 months ago

@rupink if you want to get data about a quarter, in addition to specifying restrictions in the start_period and end_period parameters, the range_type parameter must be equal to 1. Otherwise, regardless of the start_period and end_period parameters, endpoint will return information about full game.

from nba_api.stats.endpoints import boxscoremiscv3
from nba_api.stats.library.parameters import Period, StartPeriod, EndPeriod
box_scores = boxscoremiscv3.BoxScoreMiscV3(game_id = '0021701171', start_period = StartPeriod.second, end_period = EndPeriod.third, range_type=1)