NBA.Stats.LeagueSeasonMatchups (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for league season matchup.

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [LeagueID: "00", PerMode: "PerGame", Season: nil, SeasonType: "Regular Season", OffTeamID: nil, OffPlayerID: nil, DefTeamID: nil, DefPlayerID: nil], opts \\ [])

(since 0.1.0)

Fetches league season matchups data.

Parameters

  • params: A keyword list of parameters to filter the data.

    • Season: (Required) The season for which to fetch data.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
      • Pattern: ^(\d{4}-\d{2})$
    • LeagueID: The league ID (e.g., "00" for NBA).

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G League)
    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "PerGame"
      • Valueset:
        • "Totals"
        • "PerGame"
    • SeasonType: The type of season.

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "Pre-Season"
    • OffTeamID: Offensive team ID filter.

      • Type(s): Integer | String

      • Example: OffTeamID: 1610612747
      • Default: nil
    • OffPlayerID: Offensive player ID filter.

      • Type(s): Integer | String

      • Example: OffPlayerID: 201939
      • Default: nil
    • DefTeamID: Defensive team ID filter.

      • Type(s): Integer | String

      • Example: DefTeamID: 1610612747
      • Default: nil
    • DefPlayerID: Defensive player ID filter.

      • Type(s): Integer | String

      • Example: DefPlayerID: 201939
      • Default: nil
  • opts: A keyword list of additional options for the request, such as headers or timeout settings.

Returns

  • {:ok, data}: On success, returns the data from the API.
  • {:error, reason}: On failure, returns an error tuple with the reason.

Example

iex> NBA.Stats.LeagueSeasonMatchups.get(LeagueID: "00", PerMode: "PerGame", Season: "2024-25", SeasonType: "Regular Season")
{:ok, %{"LeagueSeasonMatchups" => [%{...}, ...]}}

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

(since 0.1.0)