NBA.Stats.LeagueDashTeamPtShot (nba_api_ex v0.1.0)

View Source

Provides access to team and opponent player tracking shot data from the NBA stats API.

Summary

Functions

get(type, params \\ [PerMode: "Totals", LeagueID: "00", SeasonType: "Regular Season", PORound: 0, GeneralRange: "Overall", TeamID: 0, Month: 0, OpponentTeamID: 0, Period: 0, LastNGames: 0], opts \\ [])

(since 0.1.0)
@spec get(atom(), keyword(), keyword()) :: {:ok, map()} | {:error, String.t()}

Fetches team or opponent player tracking shot data.

Parameters

  • type: The type of data to fetch.

    • :team for team data.
    • :opp for opponent data.
  • 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
    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "Totals"
      • Default: "Totals"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
        • "PerPossession"
        • "PerPlay"
        • "Per100Possessions"
        • "Per100Plays"
    • LeagueID: The league ID.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
      • Valueset:
        • "00"
        • "10"
        • "20"
    • SeasonType: The type of season.

      • Type(s): String
      • Example: SeasonType: "Playoffs"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Playoffs"
        • "Pre Season"
        • "All Star"
        • "Play In"
    • VsDivision: The division of the opponent.

      • Type(s): String
      • Example: VsDivision: "Central"
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Southeast"
        • "Northwest"
        • "Pacific"
        • "Southwest"
    • VsConference: The conference of the opponent.

      • Type(s): String
      • Example: VsConference: "East"
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • TouchTimeRange: The touch time range for filtering.

      • Type(s): String
      • Example: TouchTimeRange: "Touch < 2 Seconds"
      • Default: nil
      • Valueset:
        • "Touch < 2 Seconds"
        • "Touch 2-6 Seconds"
        • "Touch 6+ Seconds"
    • TeamID: The NBA team ID (use 0 for league-wide).

    • ShotDistRange: The shot distance range.

      • Type(s): String
      • Example: ShotDistRange: "8-16 ft."
      • Default: nil
      • Valueset:
        • "Less Than 8 ft."
        • "8-16 ft."
        • "16-24 ft."
        • "24+ ft."
        • "Backcourt"
    • ShotClockRange: The range of the shot clock.

      • Type(s): String
      • Example: ShotClockRange: "24+"
      • Default: nil
      • Valueset:
        • "24+"
        • "22-18"
        • "15-7"
        • "4-0"
        • "NA"
    • SeasonSegment: The segment of the season.

      • Type(s): String
      • Example: SeasonSegment: "Post All Star"
      • Default: nil
      • Valueset:
        • "Pre All Star"
        • "Post All Star"
    • Period: The period of the game.

      • Type(s): Integer
      • Example: Period: 1
      • Default: 0
    • PORound: The playoff round.

      • Type(s): Integer
      • Example: PORound: 1
      • Default: 0
    • Outcome: The outcome of the game.

      • Type(s): String
      • Example: Outcome: "W"
      • Default: nil
      • Valueset:
        • "W"
        • "L"
    • OpponentTeamID: The ID of the opponent team.

      • Type(s): Integer | String

      • Example: OpponentTeamID: 1610612739
      • Default: 0
    • Month: The month of the season.

      • Type(s): Integer
      • Example: Month: 1
      • Default: 0
    • Location: The location of the game.

      • Type(s): String
      • Example: Location: "Home"
      • Default: nil
      • Valueset:
        • "Home"
        • "Away"
    • LastNGames: The number of last games to consider.

      • Type(s): Integer
      • Example: LastNGames: 5
      • Default: 0
    • ISTRound: The round of the In-Season Tournament.

      • Type(s): String
      • Example: ISTRound: "All IST"
      • Default: nil
    • GeneralRange: The general range for filtering.

      • Type(s): String
      • Example: GeneralRange: "Overall"
      • Default: "Overall"
      • Valueset:
        • "Overall"
        • "Catch and Shoot"
        • "Pull Up"
        • "Less Than 10 ft."
        • "10-16 ft."
        • "16-24 ft."
        • "24+ ft."
    • GameSegment: The segment of the game.

      • Type(s): String
      • Example: GameSegment: "First Half"
      • Default: nil
      • Valueset:
        • "First Half"
        • "Second Half"
        • "Overtime"
    • DribbleRange: The dribble range for filtering.

      • Type(s): String
      • Example: DribbleRange: "0 Dribbles"
      • Default: nil
      • Valueset:
        • "0 Dribbles"
        • "1 Dribble"
        • "2 Dribbles"
        • "3-6 Dribbles"
        • "7+ Dribbles"
    • Division: The division of the team.

      • Type(s): String
      • Example: Division: "Pacific"
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Southeast"
        • "Northwest"
        • "Pacific"
        • "Southwest"
    • DateTo: The end date for filtering.

      • Type(s): String
      • Example: DateTo: "2024-04-15"
      • Default: nil
    • DateFrom: The start date for filtering.

      • Type(s): String
      • Example: DateFrom: "2023-10-01"
      • Default: nil
    • Conference: The conference of the team.

      • Type(s): String
      • Example: Conference: "West"
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • CloseDefDistRange: The defender distance range.

      • Type(s): String
      • Example: CloseDefDistRange: "0-2 Feet"
      • Default: nil
      • Valueset:
        • "0-2 Feet"
        • "2-4 Feet"
        • "4-6 Feet"
        • "6+ Feet"
  • 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.LeagueDashTeamPtShot.get(:team, Season: "2024-25")
{:ok, %{"LeagueDashTeamPtShot" => [%{...}, ...]}}

get!(type, params \\ [PerMode: "Totals", LeagueID: "00", SeasonType: "Regular Season", PORound: 0, GeneralRange: "Overall", TeamID: 0, Month: 0, OpponentTeamID: 0, Period: 0, LastNGames: 0], opts \\ [])

(since 0.1.0)