nba v0.1.2 Nba

Elixir implementation of bttmly/nba-client-template

stats.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.

Examples

See what endpoints you can hit:

Nba.endpoints()
#=> ["assist_tracker", "box_score", "box_score_summary", ...]

Each endpoint has two corresponding functions, one with an arity of 0 and one with an arity of 1. The 0-arity functions return a list of the available query parameters for its endpoint.

Nba.player_info()
#=> ["PlayerID", "SeasonType", "LeagueID"]

Now that you know what query params you can pass, let’s make a call to the endpoint by passing in a map of query param key/values.

Nba.player_info(%{"PlayerID" => "1627742"})

If you need example values for a query param, use Nba.param_values_for/1.

Nba.param_values_for("AheadBehind")
#=> ["Ahead or Behind", "Ahead or Tied", "Behind or Tied", ""]

Link to this section Summary

Link to this section Functions

Link to this function assist_tracker()
assist_tracker() :: [String.t()]
Link to this function assist_tracker(user_input)
assist_tracker(map()) :: map()
Link to this function box_score()
box_score() :: [String.t()]
Link to this function box_score(user_input)
box_score(map()) :: map()
Link to this function box_score_summary()
box_score_summary() :: [String.t()]
Link to this function box_score_summary(user_input)
box_score_summary(map()) :: map()
Link to this function common_team_roster()
common_team_roster() :: [String.t()]
Link to this function common_team_roster(user_input)
common_team_roster(map()) :: map()
Link to this function endpoints()
endpoints() :: [atom()]
Link to this function homepage_v2()
homepage_v2() :: [String.t()]
Link to this function homepage_v2(user_input)
homepage_v2(map()) :: map()
Link to this function league_game_log()
league_game_log() :: [String.t()]
Link to this function league_game_log(user_input)
league_game_log(map()) :: map()
Link to this function league_leaders()
league_leaders() :: [String.t()]
Link to this function league_leaders(user_input)
league_leaders(map()) :: map()
Link to this function league_standings()
league_standings() :: [String.t()]
Link to this function league_standings(user_input)
league_standings(map()) :: map()
Link to this function lineups()
lineups() :: [String.t()]
Link to this function lineups(user_input)
lineups(map()) :: map()
Link to this function param_values_for(param_name)
param_values_for(String.t()) :: [String.t()]
Link to this function play_by_play()
play_by_play() :: [String.t()]
Link to this function play_by_play(user_input)
play_by_play(map()) :: map()
Link to this function player_clutch()
player_clutch() :: [String.t()]
Link to this function player_clutch(user_input)
player_clutch(map()) :: map()
Link to this function player_hustle()
player_hustle() :: [String.t()]
Link to this function player_hustle(user_input)
player_hustle(map()) :: map()
Link to this function player_hustle_leaders()
player_hustle_leaders() :: [String.t()]
Link to this function player_hustle_leaders(user_input)
player_hustle_leaders(map()) :: map()
Link to this function player_info()
player_info() :: [String.t()]
Link to this function player_info(user_input)
player_info(map()) :: map()
Link to this function player_profile()
player_profile() :: [String.t()]
Link to this function player_profile(user_input)
player_profile(map()) :: map()
Link to this function player_shooting()
player_shooting() :: [String.t()]
Link to this function player_shooting(user_input)
player_shooting(map()) :: map()
Link to this function player_splits()
player_splits() :: [String.t()]
Link to this function player_splits(user_input)
player_splits(map()) :: map()
Link to this function player_stats()
player_stats() :: [String.t()]
Link to this function player_stats(user_input)
player_stats(map()) :: map()
Link to this function player_tracking()
player_tracking() :: [String.t()]
Link to this function player_tracking(user_input)
player_tracking(map()) :: map()
Link to this function players_info()
players_info() :: [String.t()]
Link to this function players_info(user_input)
players_info(map()) :: map()
Link to this function scoreboard()
scoreboard() :: [String.t()]
Link to this function scoreboard(user_input)
scoreboard(map()) :: map()
Link to this function shots()
shots() :: [String.t()]
Link to this function shots(user_input)
shots(map()) :: map()
Link to this function team_clutch()
team_clutch() :: [String.t()]
Link to this function team_clutch(user_input)
team_clutch(map()) :: map()
Link to this function team_historical_leaders()
team_historical_leaders() :: [String.t()]
Link to this function team_historical_leaders(user_input)
team_historical_leaders(map()) :: map()
Link to this function team_hustle()
team_hustle() :: [String.t()]
Link to this function team_hustle(user_input)
team_hustle(map()) :: map()
Link to this function team_hustle_leaders()
team_hustle_leaders() :: [String.t()]
Link to this function team_hustle_leaders(user_input)
team_hustle_leaders(map()) :: map()
Link to this function team_info_common()
team_info_common() :: [String.t()]
Link to this function team_info_common(user_input)
team_info_common(map()) :: map()
Link to this function team_player_dashboard()
team_player_dashboard() :: [String.t()]
Link to this function team_player_dashboard(user_input)
team_player_dashboard(map()) :: map()
Link to this function team_shooting()
team_shooting() :: [String.t()]
Link to this function team_shooting(user_input)
team_shooting(map()) :: map()
Link to this function team_splits()
team_splits() :: [String.t()]
Link to this function team_splits(user_input)
team_splits(map()) :: map()
Link to this function team_stats()
team_stats() :: [String.t()]
Link to this function team_stats(user_input)
team_stats(map()) :: map()
Link to this function team_years()
team_years() :: [String.t()]
Link to this function team_years(user_input)
team_years(map()) :: map()