NBA.Stats.LeagueLineupViz (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for league lineup viz.

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [GroupQuantity: 5, LastNGames: 0, MeasureType: "Base", MinutesMin: 0, Month: 0, OpponentTeamID: 0, PaceAdjust: "Y", PerMode: "PerGame", Period: 0, PlusMinus: "Y", Rank: "Y", Season: nil, SeasonType: "Regular Season", VsDivision: nil, VsConference: nil, TeamID: nil, ShotClockRange: nil, SeasonSegment: nil, PORound: nil, Outcome: nil, Location: nil, LeagueID: nil, GameSegment: nil, Division: nil, DateTo: nil, DateFrom: nil, Conference: nil], opts \\ [])

(since 0.1.0)

Fetches league lineup viz data.

Parameters

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

    • Conference: Conference filter (e.g., "East", "West").

      • Type(s): String
      • Example: Conference: "West"
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • DateFrom: Start date filter (format: "MM/DD/YYYY").

      • Type(s): String
      • Example: DateFrom: "01/01/2024"
      • Default: nil
    • DateTo: End date filter (format: "MM/DD/YYYY").

      • Type(s): String
      • Example: DateTo: "01/31/2024"
      • Default: nil
    • Division: Division filter (e.g., "Atlantic", "Central", etc.).

      • Type(s): String
      • Example: Division: "Pacific"
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Northwest"
        • "Pacific"
        • "Southeast"
        • "Southwest"
    • GameSegment: Game segment filter (e.g., "First Half", "Second Half", "Overtime").

      • Type(s): String
      • Example: GameSegment: "First Half"
      • Default: nil
      • Valueset:
        • "First Half"
        • "Second Half"
        • "Overtime"
    • GroupQuantity: Number of players in the lineup.

      • Type(s): Integer
      • Example: GroupQuantity: 5
      • Default: 5
    • LastNGames: Number of most recent games to include.

      • Type(s): Integer
      • Example: LastNGames: 0
      • Default: 0
    • LeagueID: League ID filter.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: nil
    • Location: Game location filter ("Home", "Road").

      • Type(s): String
      • Example: Location: "Home"
      • Default: nil
      • Valueset:
        • "Home"
        • "Road"
    • MeasureType: The type of measure to return.

      • Type(s): String
      • Example: MeasureType: "Base"
      • Default: "Base"
      • Valueset:
        • "Base"
        • "Advanced"
        • "Misc"
        • "Four Factors"
        • "Scoring"
        • "Opponent"
        • "Usage"
        • "Defense"
    • MinutesMin: Minimum minutes played.

      • Type(s): Integer
      • Example: MinutesMin: 0
      • Default: 0
    • Month: Month filter.

      • Type(s): Integer
      • Example: Month: 0
      • Default: 0
    • OpponentTeamID: Opponent team ID filter.

    • Outcome: Game outcome filter ("W", "L").

      • Type(s): String
      • Example: Outcome: "W"
      • Default: nil
      • Valueset:
        • "W"
        • "L"
    • PaceAdjust: Whether to adjust stats for pace.

      • Type(s): String
      • Example: PaceAdjust: "N"
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "PerGame"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "MinutesPer"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
        • "PerPossession"
        • "PerPlay"
        • "Per100Possessions"
        • "Per100Plays"
    • Period: Period filter.

      • Type(s): Integer
      • Example: Period: 0
      • Default: 0
    • PlusMinus: Whether to include plus/minus splits.

      • Type(s): String
      • Example: PlusMinus: "N"
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • PORound: Playoff round filter.

      • Type(s): Integer
      • Example: PORound: 0
      • Default: nil
    • Rank: Whether to include team rank.

      • Type(s): String
      • Example: Rank: "N"
      • Default: "N"
      • Valueset:
        • "Y"
        • "N"
    • Season: (Required) The season for which to fetch data.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • SeasonSegment: Season segment filter ("Post All-Star", "Pre All-Star").

      • Type(s): String
      • Example: SeasonSegment: "Post All-Star"
      • Default: nil
      • Valueset:
        • "Post All-Star"
        • "Pre All-Star"
    • SeasonType: The type of season.

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All Star"
    • ShotClockRange: Shot clock range filter.

      • Type(s): String
      • Example: ShotClockRange: "24-22"
      • Default: nil
      • Valueset:
        • "24-22"
        • "22-18 Very Early"
        • "18-15 Early"
        • "15-7 Average"
        • "7-4 Late"
        • "4-0 Very Late"
        • "ShotClock Off"
    • TeamID: Team ID filter.

    • VsConference: Opponent conference filter ("East", "West").

      • Type(s): String
      • Example: VsConference: "West"
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • VsDivision: Opponent division filter (e.g., "Atlantic", "Central", etc.).

      • Type(s): String
      • Example: VsDivision: "Pacific"
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Northwest"
        • "Pacific"
        • "Southeast"
        • "Southwest"
        • "East"
        • "West"
  • 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.LeagueLineupViz.get(Season: "2024-25", GroupQuantity: 5, PerMode: "PerGame", SeasonType: "Regular Season")
{:ok, %{"LeagueLineupViz" => [%{...}, ...]}}

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

(since 0.1.0)