NBA.Stats.CumeStatsPlayer (nba_api_ex v0.1.0)

View Source

Handles requests to the cumulative player stats endpoint.

Summary

Functions

get(params \\ [LeagueID: "00", SeasonType: "Regular Season"], opts \\ [])

(since 0.1.0)

Fetches cumulative player stats for a given player ID and season.

Parameters

  • params: A keyword list of parameters. Defaults to @default.
    • LeagueID: The league ID.
      • Type(s): Numeric String
      • Default: "00" (NBA).
      • Example: LeagueID: "10" (for WNBA).
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G-League)
    • PlayerID: (Required) Player identifier (can be an integer or string).
      • Type(s): Integer | String

      • Example: PlayerID: 1630169 (for Tyrese Haliburton).
    • Season: (Required) Season identifier (e.g., "2024").
      • Type(s): String
      • Example: Season: "2024".
    • SeasonType: Type of season (default is "Regular Season").
      • Type(s): String
      • Default: "Regular Season".
      • Example: SeasonType: "Playoffs".
      • Valueset:
        • "Regular Season"
        • "Playoffs"
        • "Pre Season"
        • "All Star"
    • GameIDs: (Required) String of game IDs to filter stats.
      • Type(s): Numeric String values, separated by |.
      • Example: GameIDs: "0022100001|0022100002".
  • opts: A keyword list of additional options for the request, such as headers or timeout settings.

Returns

  • {:ok, response}: A tuple containing the status and parsed response body.
  • {:error, reason}: An error tuple with the reason for failure.

Example

iex> NBA.Stats.CumeStatsPlayer.get(GameIDs: "0042400305|0042400306", PlayerID: 1630169, Season: "2024", SeasonType: "Playoffs")
{:ok, %{"GameByGameStats" => [...], "TotalPlayerStats" => [...]}}

get!(params \\ [], opts \\ [])

(since 0.1.0)