NBA.Stats.CumeStatsTeam (nba_api_ex v0.1.0)

View Source

Handles requests to the cumulative team stats endpoint.

Summary

Functions

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

(since 0.1.0)

Fetches cumulative team stats for a given team 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)
    • TeamID: (Required) Team identifier (can be an integer or string).
      • Type(s): Integer | String

      • Example: TeamID: 1610612752 (for the New York Knicks).
    • 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.CumeStatsTeam.get(GameIDs: "0042400305|0042400306", Team: 1610612752, Season: "2024", SeasonType: "Playoffs")
{:ok, %{"GameByGameStats" => [...], "TotalTeamStats" => [...]}}

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

(since 0.1.0)