Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Playernextngames Endpoint not working for star players #522

@AbrahamZak

Description

@AbrahamZak

NBA API Version

v1.8

Issue

I've tried the playernextngames endpoint with different players and it seems it is only working for some (e.g. Precious Achiuwa id 1630173) but not for others (Jalen Brunson id 1628973). I'm not sure why this is (most likely an issue with the source data).

I wanted to add, it seems like the endpoint specifically is not working for star players (jalen brunson, lebron james, damian lillard, etc.). Possibly all stars.

Code

try:
    next_game = playernextngames.PlayerNextNGames(
        player_id=player_id,
        number_of_games=1  # We only want the next game
    ).get_data_frames()[0]

    if not next_game.empty:
        return next_game.iloc[0].to_dict()
    else:
        return None  # No upcoming games found for this player.

except Exception as e:
    print(f"Error: {e}")
    raise HTTPException(status_code=500, detail=f"An error occurred: {e}")

Metadata

Metadata

Assignees

Labels

endpoint: third-party issueIssues, unrelated to the library, that exists within the 3rd-party's API service.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions