-1

I want to be able to find all the nba games that happened on a given day, like 03/10/2021 for example, along with the score using the nba_api.

I've currently got some code like this:

from nba_api.stats.endpoints import LeagueGameFinder 

desired_date = '03/10/2021' 

game_finder = LeagueGameFinder(date_from_nullable=desired_date, date_to_nullable=desired_date) 

games = game_finder.get_data_frames()[0] 

print(games) 

When I do this, I get a nice table of all the games that happened on 03/10/2021, the score and a bunch of other info. However, it includes G-League games. This endpoint does not accept the league_id parameter. Are there any other ways that I can filter out G-League games? I couldn't seem to find any better endpoints but do I need to try another endpoint? Thanks!

Will
  • 22
  • 3
  • 1
    *"This endpoint does not accept the league_id parameter."* [Are you sure?](https://github.com/swar/nba_api/blob/v1.2.1/src/nba_api/stats/endpoints/leaguegamefinder.py#L69) – gre_gor Aug 14 '23 at 01:03
  • You're right. Thank you for giving me the link. I forgot about the nullable aspect. – Will Aug 14 '23 at 15:41

0 Answers0