nba_ex v0.1.1 NbaEx View Source
Wrapper API for data.nba.net
Link to this section Summary
Functions
Returns the boxscore for a given date(YYYYMMDD) and game id
Returns all of the coaches in the league
Returns individual plays for a specific period in a game
Returns statistics and game information for the specified player’s last three games
Returns a list of all active players
Returns the scoreboard for the current date in PST
Returns the scoreboard for a given date
Returns team leaders for each statistic
Returns list of players of specified team
Returns the schedule for a specified team
Returns all of teams in the league
Returns team colors, team id, tricode, etc
Link to this section Functions
Returns the boxscore for a given date(YYYYMMDD) and game id.
iex> NbaEx.boxscore("20180316", "0021701032")
%Boxscore{
game: %Game{},
home_team_stats: %TeamStat{},
away_team_stats: %TeamStat{},
player_stats: [%PlayerStat{}]
}
Returns all of the coaches in the league.
iex> NbaEx.coaches()
[
%NbaEx.Coach{
college: "Oklahoma",
firstName: "Terry",
isAssistant: true,
lastName: "Stotts",
personId: "1337",
sortSequence: "25",
teamId: "1610612757"
},
%NbaEx.Coach{
college: "St. Bonaventure",
firstName: "David",
isAssistant: false,
lastName: "Vanterpool",
personId: "203150",
sortSequence: "204",
teamId: "1610612757"
},
....
]
Returns individual plays for a specific period in a game.
iex> NbaEx.play_by_play("20180317", "0021701044", 3)
%NbaEx.PlayByPlay{
plays: [
%NbaEx.Play{
clock: "12:00",
description: "Start Period",
eventMsgType: "12",
hTeamScore: "60",
isScoreChange: false,
isVideoAvailable: false,
personId: "",
teamId: "",
vTeamScore: "52"
},
....
]
}
Returns statistics and game information for the specified player’s last three games.
iex> NbaEx.player_game_log("1628432")
[
%NbaEx.PlayerGameLog{
gameDateUTC: "2018-03-15",
gameId: "0021701027",
gameUrlCode: "20180315/PHXUTA",
hTeam: %NbaEx.TeamScore{
isWinner: true,
score: "116",
teamId: "1610612762",
triCode: nil
},
isHomeGame: false,
stats: %NbaEx.PlayerStat{
assists: "0",
blocks: nil,
defReb: "2",
...
}
]
players() :: [ %NbaEx.Player{ collegeName: term(), country: term(), dateOfBirthUTC: term(), firstName: term(), heightFeet: term(), heightInches: term(), isActive: term(), jersey: term(), lastName: term(), nbaDebutYear: term(), personId: term(), pos: term(), teamId: term(), teams: term(), weightPounds: term(), yearsPro: term() } ]
Returns a list of all active players.
iex> NbaEx.players()
[
%NbaEx.Player{
collegeName: "Texas",
country: "USA",
dateOfBirthUTC: "1985-07-19",
firstName: "LaMarcus",
heightFeet: "6",
...
},
...
]
Returns the scoreboard for the current date in PST.
iex> NbaEx.scoreboard()
%NbaEx.Scoreboard{
games: [
%NbaEx.Game{
arena: %NbaEx.Arena{
city: "Milwaukee",
country: "USA",
name: "BMO Harris Bradley Center",
stateAbbr: "WI"
},
clock: "",
endTimeUTC: "2018-03-17T23:34:00.000Z",
...
},
...
]
}
Returns the scoreboard for a given date.
iex> NbaEx.scoreboard_for("20180317")
%NbaEx.Scoreboard{
games: [
%NbaEx.Game{
arena: %NbaEx.Arena{
city: "Milwaukee",
country: "USA",
name: "BMO Harris Bradley Center",
stateAbbr: "WI"
},
clock: "",
endTimeUTC: "2018-03-17T23:34:00.000Z",
...
},
...
]
}
Returns team leaders for each statistic.
iex> NbaEx.team_leaders("warriors")
%NbaEx.TeamLeaders{
apg: [%NbaEx.Leader{personId: "203110", value: "7.4"}],
bpg: [%NbaEx.Leader{personId: "201142", value: "1.9"}],
fgp: [%NbaEx.Leader{personId: "1628395", value: "0.657"}],
...
}
team_roster(String.t()) :: [ %NbaEx.Player{ collegeName: term(), country: term(), dateOfBirthUTC: term(), firstName: term(), heightFeet: term(), heightInches: term(), isActive: term(), jersey: term(), lastName: term(), nbaDebutYear: term(), personId: term(), pos: term(), teamId: term(), teams: term(), weightPounds: term(), yearsPro: term() } ] | {:error, String.t()}
Returns list of players of specified team.
iex> NbaEx.team_roster("warriors")
[
%NbaEx.Player{
personId: "1628395"
},
...
]
Returns the schedule for a specified team.
iex> NbaEx.team_schedule("warriors")
[
%NbaEx.Game{
arena: %NbaEx.Arena{city: nil, country: nil, name: nil, stateAbbr: nil},
clock: "",
endTimeUTC: "",
gameId: "0011700001",
...
},
...
]
Returns all of teams in the league.
iex> NbaEx.teams()
[
%NbaEx.Team{
city: "Atlanta",
confName: "East",
divName: "Southeast",
fullName: "Atlanta Hawks",
isNBAFranchise: true,
nickname: "Hawks",
teamId: "1610612737",
tricode: "ATL"
},
...
]
Returns team colors, team id, tricode, etc..
iex> NbaEx.teams_config()
[
%NbaEx.TeamConfig{
primaryColor: "#e21a37",
secondaryColor: "#e21a37",
teamId: "1610612737",
tricode: "ATL",
ttsName: "Atlanta Hawks"
},
...
]