NBA.Stats.LeagueDashLineups (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for league dash lineups.

Summary

Functions

get(params \\ [MeasureType: "Base", PerMode: "Totals", PlusMinus: "N", PaceAdjust: "N", Rank: "N", LeagueID: "00", SeasonType: "Regular Season", PORound: 0, Month: 0, OpponentTeamID: 0, TeamID: 0, Period: 0, LastNGames: 0, GroupQuantity: 5], opts \\ [])

(since 0.1.0)

Fetches league lineup data.

Parameters

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

    • Conference: The conference of the team.

      • Type(s): String
      • Example: Conference: "West" (Western Conference)
      • Default: nil (no specific conference)
      • Valueset:
        • "East" (Eastern Conference)
        • "West" (Western Conference)
    • DateFrom: The start date for filtering.

      • Type(s): String
      • Example: DateFrom: "2023-10-01" (October 1, 2023)
      • Default: nil (no start date)
    • DateTo: The end date for filtering.

      • Type(s): String
      • Example: DateTo: "2024-04-15" (April 15, 2024)
      • Default: nil (no end date)
    • Division: The division of the team.

      • Type(s): String
      • Example: Division: "Pacific" (Pacific Division)
      • Default: nil (no specific division)
      • Valueset:
        • "Atlantic" (Atlantic Division)
        • "Central" (Central Division)
        • "Southeast" (Southeast Division)
        • "Northwest" (Northwest Division)
        • "Pacific" (Pacific Division)
        • "Southwest" (Southwest Division)
    • GameSegment: The segment of the game.

      • Type(s): String
      • Example: GameSegment: "First Half" (first half of the game)
      • Default: nil (no specific segment)
      • Valueset:
        • "First Half" (First half of the game)
        • "Second Half" (Second half of the game)
        • "Overtime" (Overtime periods)
    • GroupQuantity: The number of players in the lineup.

      • Type(s): Integer
      • Example: GroupQuantity: 5 (5-player lineups)
      • Default: 5 (default to 5-player lineups)
    • ISTRound: The round of the IST.

      • Type(s): String
      • Example: ISTRound: "All IST" (all IST rounds)
      • Default: nil (no specific round)
      • Valueset:
        • "All IST" (All IST rounds)
        • "Group Play" (Group stage)
        • "Knockout - All" (Knockout stage)
        • "Knockout Round - Quarter" (Quarterfinals of the knockout stage)
        • "Knockout Round - Semi" (Semifinals of the knockout stage)
        • "Knockout Round - Championship" (Finals of the knockout stage)
        • "Group Play - East Group A" (Group A of the Eastern Conference)
        • "Group Play - East Group B" (Group B of the Eastern Conference)
        • "Group Play - East Group C" (Group C of the Eastern Conference)
        • "Group Play - West Group A" (Group A of the Western Conference)
        • "Group Play - West Group B" (Group B of the Western Conference)
        • "Group Play - West Group C" (Group C of the Western Conference)
    • LastNGames: The number of last games to consider.

      • Type(s): Integer
      • Example: LastNGames: 5 (last 5 games)
      • Default: 0 (all games)
    • LeagueID: The league ID.

      • Type(s): String
      • Example: LeagueID: "10" (for WNBA)
      • Default: "00" (NBA)
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G-League)
    • Location: The location of the game.

      • Type(s): String
      • Example: Location: "Home" (home games only)
      • Default: nil (no specific location)
      • Valueset:
        • "Home" (Home games)
        • "Away" (Away games)
    • MeasureType: Type of measures.

      • Type(s): String
      • Example: MeasureType: "Advanced"
      • Default: "Base"
      • Valueset:
        • "Base" (Basic stats)
        • "Advanced" (Advanced stats)
        • "Scoring" (Scoring stats)
        • "Misc" (Miscellaneous stats)
        • "FourFactors" (Four factors stats)
        • "Defense" (Defensive stats)
        • "Usage" (Usage stats)
    • Month: The month of the season.

      • Type(s): Integer
      • Example: Month: 1 (January)
      • Default: 0 (all months)
    • OpponentTeamID: The ID of the opponent team.

      • Type(s): Integer | String

      • Example: OpponentTeamID: 1610612739 (Golden State Warriors)
      • Default: 0 (all teams)
    • Outcome: The outcome of the game.

      • Type(s): String
      • Example: Outcome: "W" (wins only)
      • Default: nil (no specific outcome)
      • Valueset:
        • "W" (Wins)
        • "L" (Losses)
        • "All" (All games)
    • PORound: The playoff round.

      • Type(s): Integer
      • Example: PORound: 1 (first round)
      • Default: 0 (not applicable)
    • PaceAdjust: Whether to adjust stats for pace.

      • Type(s): String
      • Example: PaceAdjust: "Y"
      • Default: "N"
      • Valueset:
        • "Y" (Adjust for pace)
        • "N" (Do not adjust for pace)
    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "Totals"
      • Valueset:
        • "Totals" (Total stats)
        • "PerGame" (Per game stats)
        • "MinutesPer" (Minutes per stats)
        • "Per48" (Per 48 minutes stats)
        • "Per40" (Per 40 minutes stats)
        • "Per36" (Per 36 minutes stats)
        • "PerMinute" (Per minute stats)
        • "PerPossession" (Per possession stats)
        • "PerPlay" (Per play stats)
        • "Per100Possessions" (Per 100 possessions stats)
        • "Per100Plays" (Per 100 plays stats)
    • Period: The period of the game.

      • Type(s): Integer
      • Example: Period: 1 (first period)
      • Default: 0 (all periods)
    • PlusMinus: Whether to include plus/minus stats.

      • Type(s): String
      • Example: PlusMinus: "Y"
      • Default: "N"
      • Valueset:
        • "Y" (Include plus/minus)
        • "N" (Exclude plus/minus)
    • Rank: Whether to include rank in stats.

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

      • Type(s): String
      • Example: Season: "2023-24"
      • Default: "2023-24" (current season)
    • SeasonSegment: The segment of the season.

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

      • Type(s): String
      • Example: SeasonType: "Playoffs"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season" (Regular season)
        • "Playoffs" (Playoffs)
        • "Pre Season" (Pre-season)
        • "All Star" (All-Star game)
        • "Play In" (Play-In tournament)
        • "NBA Cup" (NBA Cup)
    • ShotClockRange: The range of the shot clock.

      • Type(s): String
      • Example: ShotClockRange: "14-24" (shots taken with 14-24 seconds left)
      • Default: nil (no specific range)
      • Valueset:
        • "0-14" (Shots taken with 0-14 seconds left)
        • "14-24" (Shots taken with 14-24 seconds left)
        • "24+" (Shots taken with more than 24 seconds left)
    • TeamID: The ID of the team.

      • Type(s): Integer | String

      • Example: TeamID: 1610612756 (Los Angeles Lakers)
      • Default: 0 (all teams)
    • VsConference: The conference of the opponent.

      • Type(s): String
      • Example: VsConference: "East" (Eastern Conference)
      • Default: nil (no specific conference)
      • Valueset:
        • "East" (Eastern Conference)
        • "West" (Western Conference)
    • VsDivision: The division of the opponent.

      • Type(s): String
      • Example: VsDivision: "Central" (Central Division)
      • Default: nil (no specific division)
      • Valueset:
        • "Atlantic" (Atlantic Division)
        • "Central" (Central Division)
        • "Southeast" (Southeast Division)
        • "Northwest" (Northwest Division)
        • "Pacific" (Pacific Division)
        • "Southwest" (Southwest Division)
  • 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.LeagueDashLineups.get(Season: "2023-24")
{:ok, %{"Lineups" => [%{...}, ...]}}

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

(since 0.1.0)