nba v0.4.0 Nba.Stats
Provides a function for each stats.nba.com endpoint.
Examples
See what endpoints you can hit:
Nba.Stats.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.Stats.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.Stats.player_info(%{"PlayerID" => "1627742"})
If you need example values for a query param, use
Nba.Stats.param_values_for/1
.
Nba.Stats.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
team_historical_leaders(user_input_map)