NBA.Stats.PlayerIndex (nba_api_ex v0.1.0)
View SourceProvides functions to interact with the NBA stats API for PlayerIndex.
See get/2 for parameter and usage details.
Summary
Functions
Fetches PlayerIndex data.
Parameters
params: A keyword list of parameters to filter the data.LeagueID: (Required) The league ID.- Type(s):
String - Example:
LeagueID: "00" - Default:
"00" - Pattern:
^\d{2}$
- Type(s):
Season: (Required) The season.- Type(s):
String - Example:
Season: "2024-25" - Default:
nil - Pattern:
^(\d{4}-\d{2})$
- Type(s):
Active: Whether the player is active.- Type(s):
Integer - Example:
Active: 1 - Default:
nil
- Type(s):
AllStar: Whether the player is an all-star.- Type(s):
Integer - Example:
AllStar: 1 - Default:
nil
- Type(s):
College: The college attended.- Type(s):
String - Example:
College: "Duke" - Default:
nil
- Type(s):
Country: The country of origin.- Type(s):
String - Example:
Country: "USA" - Default:
nil
- Type(s):
DraftPick: The draft pick.- Type(s):
String - Example:
DraftPick: "1" - Default:
nil
- Type(s):
DraftRound: The draft round.- Type(s):
String - Example:
DraftRound: "1" - Default:
nil
- Type(s):
DraftYear: The draft year.- Type(s):
String - Example:
DraftYear: "2003" - Default:
nil
- Type(s):
Height: The height.- Type(s):
String - Example:
Height: "6-8" - Default:
nil
- Type(s):
Historical: Whether the player is historical.- Type(s):
Integer - Example:
Historical: 1 - Default:
nil
- Type(s):
TeamID: The team ID.Weight: The weight.- Type(s):
Integer - Example:
Weight: 250 - Default:
nil
- Type(s):
opts: A keyword list of additional options for the request, such as headers or timeout settings.- For a full list of options, see the Req documentation.
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.PlayerIndex.get(LeagueID: "00", Season: "2024-25")
{:ok, %{"PlayerIndex" => [%{...}, ...]}}