NBA.Stats.LeagueDashPlayerShotLocations (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for league dash player shot locations stats.

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [MeasureType: "Base", PerMode: "PerGame", PlusMinus: "N", PaceAdjust: "N", Rank: "N", SeasonType: "Regular Season", PORound: 0, Month: 0, OpponentTeamID: 0, TeamID: 0, Period: 0, LastNGames: 0, DistanceRange: "5ft Range"], opts \\ [])

(since 0.1.0)

Fetches league dash player shot locations stats data.

Parameters

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

    • College: The college of the player.

      • Type(s): String
      • Example: College: "Duke"
      • Default: nil
    • Conference: The conference of the team.

      • Type(s): String
      • Example: Conference: "West"
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • Country: The country of the player.

      • Type(s): String
      • Example: Country: "USA"
      • Default: nil
    • DateFrom: The start date for filtering.

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

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

      • Type(s): String
      • Example: Division: "Pacific"
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Southeast"
        • "Northwest"
        • "Pacific"
        • "Southwest"
    • DistanceRange: The distance range for shots.

      • Type(s): String
      • Example: DistanceRange: "By Zone"
      • Default: "By Zone"
      • Valueset:
        • "By Zone"
        • "Less Than 8 ft."
        • "8-16 ft."
        • "16-24 ft."
        • "24+ ft."
        • "Backcourt"
    • GameScope: The scope of games.

      • Type(s): String
      • Example: GameScope: "Last 10"
      • Default: nil
    • GameSegment: The segment of the game.

      • Type(s): String
      • Example: GameSegment: "First Half"
      • Default: nil
      • Valueset:
        • "First Half"
        • "Second Half"
        • "Overtime"
    • Height: The height of the player.

      • Type(s): String
      • Example: Height: "6-7"
      • Default: nil
    • 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
      • Default: 0
    • LeagueID: The league ID.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: "00"
      • Valueset:
        • "00"
        • "10"
        • "20"
    • Location: The location of the game.

      • Type(s): String
      • Example: Location: "Home"
      • Default: nil
      • Valueset:
        • "Home"
        • "Away"
    • Month: The month of the season.

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

      • Type(s): Integer | String

      • Example: OpponentTeamID: 1610612739
      • Default: 0
    • Outcome: The outcome of the game.

      • Type(s): String
      • Example: Outcome: "W"
      • Default: nil
      • Valueset:
        • "W"
        • "L"
    • PORound: The playoff round.

      • Type(s): Integer
      • Example: PORound: 1
      • Default: 0
    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "Totals"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
        • "PerPossession"
        • "PerPlay"
        • "Per100Possessions"
        • "Per100Plays"
    • Period: The period of the game.

      • Type(s): Integer
      • Example: Period: 1
      • Default: 0
    • PlayerExperience: The experience level of the player.

      • Type(s): String
      • Example: PlayerExperience: "Rookie"
      • Default: nil
      • Valueset:
        • "Rookie"
        • "Sophomore"
        • "Veteran"
    • PlayerPosition: The position of the player.

      • Type(s): String
      • Example: PlayerPosition: "F"
      • Default: nil
      • Valueset:
        • "F"
        • "C"
        • "G"
    • Season: (Required) The season for which to fetch data.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • SeasonSegment: The segment of the season.

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

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

      • Type(s): String
      • Example: ShotClockRange: "0-14" (shots taken with 0-14 seconds left)
      • Default: "0-14"
      • 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)
    • StarterBench: Whether the player is a starter or bench.

      • Type(s): String
      • Example: StarterBench: "Bench"
      • Default: nil
      • Valueset:
        • "Starter"
        • "Bench"
    • TeamID: The ID of the team.

    • VsConference: The conference of the opponent.

      • Type(s): String
      • Example: VsConference: "East"
      • Default: nil
      • Valueset:
        • "East"
        • "West"
    • VsDivision: The division of the opponent.

      • Type(s): String
      • Example: VsDivision: "Central"
      • Default: nil
      • Valueset:
        • "Atlantic"
        • "Central"
        • "Southeast"
        • "Northwest"
        • "Pacific"
        • "Southwest"
    • Weight: The weight of the player.

      • Type(s): String
      • Example: Weight: "220"
      • 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.LeagueDashPlayerShotLocations.get(Season: "2024-25")
{:ok, %{"LeagueDashPlayerShotLocations" => [%{...}, ...]}}

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

(since 0.1.0)