nba v0.3.1 Nba

nba.com uses a large number of undocumented JSON endpoints to provide the statistics tables and charts displayed therein. This library provides an Elixir client for interacting with many of those API endpoints.

Link to this section Summary

Functions

Returns a single player that best matches the search, or nil if no match was found

Returns a list of players sorted by best match

Link to this section Functions

Link to this function find_player!(name)
find_player!([tuple()] | String.t()) :: map() | nil

Returns a single player that best matches the search, or nil if no match was found.

Nba.find_player!("J Holiday")
%{
  "first_name" => "Jrue",
  "last_name" => "Holiday",
  "player_id" => 201950,
  "team_id" => 1610612740
}
Link to this function find_player(name)
find_player([tuple()] | String.t()) :: [map()]

Returns a list of players sorted by best match.

You can pass in a single key-value pair for first name, last name, or full name.

Nba.find_player(first_name: "brandn")
Nba.find_player(last_name: "ingram")
Nba.find_player(full_name: "brandon ingram")

You may also pass in a string as an argument.

Nba.find_player("J Holiday")
[%{
  "first_name" => "Jrue",
  "last_name" => "Holiday",
  "player_id" => 201950,
  "team_id" => 1610612740
},
%{
  "first_name" => "Justin",
  "last_name" => "Holiday",
  "player_id" => 203200,
  "team_id" => 1610612741
}]