NBA.Stats.LeagueHustleStatsPlayer (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for league hustle stats (player).

See get/2 for parameter and usage details.

Summary

Functions

get(params \\ [PerMode: "PerGame", Season: nil, SeasonType: "Regular Season", Weight: nil, VsDivision: nil, VsConference: nil, TeamID: nil, SeasonSegment: nil, PlayerPosition: nil, PlayerExperience: nil, PORound: nil, Outcome: nil, OpponentTeamID: nil, Month: nil, Location: nil, LeagueID: nil, Height: nil, DraftYear: nil, DraftPick: nil, Division: nil, DateTo: nil, DateFrom: nil, Country: nil, Conference: nil, College: nil], opts \\ [])

(since 0.1.0)

Fetches league hustle stats (player) data.

Parameters

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

    • PerMode: How stats are aggregated.

      • Type(s): String
      • Example: PerMode: "PerGame"
      • Default: "PerGame"
      • Valueset:
        • "Totals"
        • "PerGame"
        • "Per48"
        • "Per40"
        • "Per36"
        • "PerMinute"
    • Season: (Required) The season for which to fetch data.

      • Type(s): String
      • Example: Season: "2024-25"
      • Default: nil
    • SeasonType: The type of season.

      • Type(s): String
      • Example: SeasonType: "Regular Season"
      • Default: "Regular Season"
      • Valueset:
        • "Regular Season"
        • "Pre Season"
        • "Playoffs"
        • "All Star"
    • Weight: Player weight filter.

      • Type(s): String
      • Example: Weight: "220"
      • Default: nil
    • VsDivision: Opponent division filter.

      • Type(s): String
      • Example: VsDivision: "Pacific"
      • Default: nil
    • VsConference: Opponent conference filter.

      • Type(s): String
      • Example: VsConference: "West"
      • Default: nil
    • TeamID: Team ID filter.

    • SeasonSegment: Season segment filter.

      • Type(s): String
      • Example: SeasonSegment: "Post All-Star"
      • Default: nil
    • PlayerPosition: Player position filter.

      • Type(s): String
      • Example: PlayerPosition: "G"
      • Default: nil
    • PlayerExperience: Player experience filter.

      • Type(s): String
      • Example: PlayerExperience: "Rookie"
      • Default: nil
    • PORound: Playoff round filter.

      • Type(s): Integer
      • Example: PORound: 1
      • Default: nil
    • Outcome: Game outcome filter.

      • Type(s): String
      • Example: Outcome: "W"
      • Default: nil
    • OpponentTeamID: Opponent team ID filter.

      • Type(s): Integer | String

      • Example: OpponentTeamID: 1610612747
      • Default: nil
    • Month: Month filter.

      • Type(s): Integer
      • Example: Month: 1
      • Default: nil
    • Location: Game location filter.

      • Type(s): String
      • Example: Location: "Home"
      • Default: nil
    • LeagueID: League ID filter.

      • Type(s): String
      • Example: LeagueID: "00"
      • Default: nil
    • Height: Player height filter.

      • Type(s): String
      • Example: Height: "6-7"
      • Default: nil
    • DraftYear: Player draft year filter.

      • Type(s): String
      • Example: DraftYear: "2015"
      • Default: nil
    • DraftPick: Player draft pick filter.

      • Type(s): String
      • Example: DraftPick: "1"
      • Default: nil
    • Division: Division filter.

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

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

      • Type(s): String
      • Example: DateFrom: "01/01/2024"
      • Default: nil
    • Country: Player country filter.

      • Type(s): String
      • Example: Country: "USA"
      • Default: nil
    • Conference: Conference filter.

      • Type(s): String
      • Example: Conference: "West"
      • Default: nil
    • College: Player college filter.

      • Type(s): String
      • Example: College: "Duke"
      • 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.LeagueHustleStatsPlayer.get(Season: "2024-25", PerMode: "PerGame", SeasonType: "Regular Season")
{:ok, %{"LeagueHustleStatsPlayer" => [%{...}, ...]}}

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

(since 0.1.0)