NBA.Stats.DraftCombine (nba_api_ex v0.1.0)

View Source

Provides functions to interact with the NBA stats API for draft combine data.

Summary

Functions

get(type, params \\ [LeagueID: "00"], opts \\ [])

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

Fetches specified type of draft combine data for a given year.

Parameters

  • type: The type of data to fetch (e.g., "Advanced").
    • anthro: Fetches player anthropometric data.
    • drills: Fetches player drill results.
    • spot: Fetches player spot shooting data.
    • stats: Fetches player stats.
    • nonstationary: Fetches player movement shooting data.
  • params: A keyword list of parameters for the request.
    • LeagueID: The league ID.
      • Type(s): Numeric String.
      • Default: "00" (NBA).
      • Example: LeagueID: "10" (for WNBA).
      • Valueset:
        • "00" (NBA)
        • "01" (ABA)
        • "10" (WNBA)
        • "20" (G-League)
    • SeasonYear: (Required) The season year for the draft combine data.
      • Type(s): Numeric String.
      • Example: SeasonYear: "2023" (for the 2023 draft combine).
    • opts: A keyword list of additional options for the request, such as headers or timeout settings.

Returns

  • {:ok, response}: A map containing the box score data.
  • {:error, reason}: An error tuple with the reason for failure.

Example

iex> NBA.Stats.DraftCombine.get(:anthro, SeasonYear: "2023") {:ok, %{data: [%{"PLAYER_ID" => 12345, "Height" => "6-7", "Weight" => 210}]}}

get!(type, params \\ [LeagueID: "00"], opts \\ [])

(since 0.1.0)