Skip to content

Commit

Permalink
Add right-rail API endpoint for GameCenter
Browse files Browse the repository at this point in the history
This API endpoint is used for detailed stats such as:
- FaceOff Wins and percentages
- Shots on Goal
- PP %
- PIM
- Hits
- Blocked Shots
- Giveaways
- Takeaways

Along with the overall comparison for the season series between the two teams.
  • Loading branch information
willdeberry committed Nov 25, 2024
1 parent a600b0c commit 2f4460a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nhlpy/api/game_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ def shift_chart_data(self, game_id: str, excludes: List[str] = None) -> dict:
exclude_p: str = ",".join(excludes)
expr_p: str = f"gameId={game_id} and ((duration != '00:00' and typeCode = 517) or typeCode != 517 )"
return self.client.get_by_url(full_resource=f"{base_url}?cayenneExp={expr_p}&exclude={exclude_p}").json()

def right_rail(self, game_id: str) -> dict:
"""
Get the game stats and season series information for the game_id.
GameIds can be retrieved from the schedule endpoint.
:param game_id: The game_id for the game you want the stats for.
:return: dict
"""
return self.client.get(resource=f"gamecenter/{game_id}/right-rail").json()

0 comments on commit 2f4460a

Please sign in to comment.