Type: | Package |
Title: | 'Euroleague basketball API' |
Version: | 0.2.0 |
Maintainer: | Flavio Leccese <flavioleccese92@gmail.com> |
Description: | Unofficial API wrapper for 'Euroleague' and 'Eurocup' basketball API (https://www.euroleaguebasketball.net/en/euroleague/), it allows to retrieve real-time and historical standard and advanced statistics about competitions, teams, players and games. |
License: | MIT + file LICENSE |
URL: | https://github.com/FlavioLeccese92/euroleaguer/ |
Imports: | cli, dplyr, glue, httr, jsonlite, lubridate, stringr, tibble, tidyr |
Suggests: | knitr, rmarkdown |
Config/Needs/website: | tidyr, dplyr, ggplot2, ggtext, showtext, ggimage, geomtextpath, hexbin, devtools |
Encoding: | UTF-8 |
Language: | en-US |
RoxygenNote: | 7.3.1 |
NeedsCompilation: | no |
Packaged: | 2024-02-22 22:44:38 UTC; flavi |
Author: | Flavio Leccese [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2024-02-23 19:20:11 UTC |
Api internal functions
Description
Primitive Api wrapper functions are not exported since they only allow for one call at a time. Instead, an equivalent functions is exposed allowing multiple parameters, making it easier to retrieve data for users.
Arguments
competition_code |
One or more competition codes. |
team_code |
One or more team codes as obtained from |
game_code |
One or more game codes as obtained from |
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
phase_type |
One or more phase type codes as obtained from |
subset |
One or more game subsets. |
statistic_mode |
One or more aggregation modes of statistics. |
Get competition ahead-behind standings
Description
Get competition ahead-behind standings
Usage
getCompetitionAheadBehind(season_code, round)
Arguments
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
Value
Returns a summary tibble of ahead-behind for chosen competition and round
Reference webpage: Ahead-behind standings
Examples
## Not run:
getCompetitionAheadBehind(season_code = c("E2023", "E2022"), round = 1)
## End(Not run)
Get competition calendar standings
Description
Get competition calendar standings
Usage
getCompetitionCalendar(season_code, round)
Arguments
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
Value
Returns a summary tibble of calendar standings for chosen competitions and rounds
Reference webpage: Calendar standings
Examples
if(interactive()) {
getCompetitionCalendar(season_code = c("E2023", "E2022"), round = 1)
}
Competition metadata
Description
Retrieve values of arguments for specific data collection functions across all package.
Usage
getCompetitionHistory(competition_code)
getCompetitionRounds(season_code)
getCompetitionPhases(season_code)
getCompetitionTeams(season_code)
getCompetitionGames(season_code, round, phase_type = "All")
Arguments
competition_code |
One or more competition codes. |
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
phase_type |
One or more phase type codes as obtained from |
Value
For each function, returns a tibble with information about history, rounds, phases, teams or games of chosen season and competition code.
Examples
## Not run:
getCompetitionHistory(competition_code = c("E", "U")) |> head(5)
getCompetitionRounds(season_code = c("E2023", "E2022")) |> head(5)
getCompetitionPhases(season_code = c("E2023", "U2023")) |> head(5)
getCompetitionTeams(season_code = c("E2023", "U2023")) |> head(5)
getCompetitionGames(season_code = "E2023", round = 1:5) |> head(5)
## End(Not run)
Get competition margins standings
Description
Get competition margins standings
Usage
getCompetitionMargins(season_code, round)
Arguments
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
Value
Returns a summary tibble of standing margins for chosen competition and round
Reference webpage: Margins standings
Examples
## Not run:
getCompetitionMargins(season_code = c("E2023", "E2022"), round = 1)
## End(Not run)
Get competition traditional standings
Description
Get competition traditional standings
Usage
getCompetitionStandings(season_code, round)
Arguments
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
Value
Returns a summary tibble of standings for chosen competitions and rounds
Reference webpage: Traditional standings
Examples
## Not run:
getCompetitionStandings(season_code = c("E2023", "E2022"), round = 1)
## End(Not run)
Get competition streaks standings
Description
Get competition streaks standings
Usage
getCompetitionStreaks(season_code, round)
Arguments
season_code |
One or more season codes as obtained from |
round |
One or more round codes as obtained from |
Value
Returns a summary tibble of streaks for chosen competitions and rounds
Reference webpage: Streaks standings
Examples
## Not run:
getCompetitionStreaks(season_code = c("E2023", "E2022"), round = 1)
## End(Not run)
Get game box-score
Description
Usage
getGameBoxScore(season_code, game_code)
Arguments
season_code |
One or more season codes as obtained from |
game_code |
One or more game codes as obtained from |
Value
Returns a list of elements for the chosen games and seasons
-
Team. Name of the teams
-
Coach. Name of the coaches
-
EndOfQuarter. Team accumulated points by quarter
-
ByQuarter. Team points for each quarter
-
PlayerStats. Statistics for each player in the game
-
TeamStats. Aggregated statistics for each team in the game
Glossary of columns:
Column name | Column extended name |
GP | Game player |
GS | Game started |
MIN | Minutes played |
PTS | Points scored |
2PM | Two-pointers made |
2PA | Two-pointers attempted |
2P% | Two-point % |
3PM | Three-pointers made |
3PA | Three-pointers attempted |
3P% | Three-point % |
FTM | Free throws made |
FTA | Free throws attempted |
FT% | Free-throw % |
OREB | Offensive rebounds |
DREB | Defensive rebounds |
TREB | Total rebounds |
AST | Assists |
STL | Steals |
TO | Turnovers |
BLK | Blocks |
BLKA | Blocks against |
FC | Personal fouls committed |
FD | Personal fouls drawn |
PIR | Performance Index Rating |
Reference webpage: BoxScore
Examples
## Not run:
getGameBoxScore(season_code = c("E2023", "U2023"), game_code = 1)
## End(Not run)
Get game evolution
Description
Usage
getGameEvolution(season_code, game_code)
Arguments
season_code |
One or more season codes as obtained from |
game_code |
One or more game codes as obtained from |
Value
Returns a list of two elements for the chosen games and seasons
-
EvolutionSummary. Overall information about minimum and maximum difference of scores between teams
-
Evolution. Minute by minute points of each team
Reference webpage: GraphicStats
Examples
## Not run:
getGameEvolution(season_code = c("E2023", "U2023"), game_code = 1)
## End(Not run)
Game metadata
Description
Retrieve contextual information about games.
Outputs may be required as arguments of other getGame*
functions
Usage
getGameHeader(season_code, game_code)
getGamePlayers(season_code, game_code, team_code)
getGameRound(season_code, game_code)
Arguments
season_code |
One or more season codes as obtained from |
game_code |
One or more game codes as obtained from |
team_code |
One or more team codes as obtained from |
Value
For each function, returns a tibble with information about header, player or round of chosen season and game code.
Examples
## Not run:
getGameHeader(season_code = c("E2023", "U2023"), game_code = 1)
getGamePlayers(season_code = c("E2023", "U2023"), team_code = "ASV", game_code = 1)
getGameRound(season_code = c("E2023", "U2023"), game_code = 1)
## End(Not run)
Get game play-by-play
Description
Usage
getGamePlayByPlay(season_code, game_code)
Arguments
season_code |
One or more season codes as obtained from |
game_code |
One or more game codes as obtained from |
Value
Returns a list of two elements for the chosen games and seasons
-
PlayByPlaySummary. Overall information about the games, teams involved and status (live or not)
-
PlayByPlay. Detailed information about the games, particularly NumberOfPlay and PlayType
Glossary of PlayType
:
PlayType | PlayInfo |
2PA | Missed Two Pointer |
2PM | Two Pointer |
3PA | Missed Three Pointer |
3PM | Three Pointer |
AG | Shot Rejected |
AS | Assist |
BP | Begin Period |
C | Coach Foul |
CCH | Coach Challenge |
CM | Foul |
CMT | Technical Foul |
CMTI | Throw-In Foul |
CMU | Unsportsmanlike Foul |
D | Def Rebound |
EG | End Game |
EP | End Period |
FTA | Missed Free Throw |
FTM | Free Throw In |
FV | Block |
IN | In |
O | Off Rebound |
OF | Offensive Foul |
OUT | Out |
RV | Foul Drawn |
ST | Steal |
TO | Turnover |
TOUT | Time Out |
TOUT_TV | TV Time Out |
Reference webpage: PlayByPlay
Examples
## Not run:
PlayByPlay = getGamePlayByPlay(season_code = c("E2023", "U2023"), game_code = 1)
PlayByPlay$PlayByPlaySummary |> head(5)
PlayByPlay$PlayByPlay |> head(5)
## End(Not run)
Get game points
Description
Usage
getGamePoints(season_code, game_code)
Arguments
season_code |
One or more season codes as obtained from |
game_code |
One or more game codes as obtained from |
Value
Returns scoring information of each player for the chosen games and seasons (subset of play-by-play data). In particular:
-
NumberOfPlay. Reference id of the action (useful for join with results of
getPlayByPlay
) -
CoordX and CoordY. Spatial coordinates of the shot
-
Zone. Area of the court of the shot
Reference webpage: PlayByPlay
Examples
## Not run:
getGamePoints(season_code = c("E2023", "U2023"), game_code = 1)
## End(Not run)
Get player advanced statistics
Description
Usage
getPlayerAdvanced(
season_code,
statistic_mode = c("perGame", "perMinute", "accumulated")
)
Arguments
season_code |
One or more season codes as obtained from |
statistic_mode |
One or more aggregation modes of statistics. |
Value
Returns a summary tibble of advanced players statistics for chosen seasons.
Glossary of columns:
Column name | Column extended name | Column description |
eFG% | Effective field goal % | Combined two- and three-point shooting effectiveness |
TS% | True shooting % | Percentage of points vs. points attempted |
OREB% | Offensive rebound % | Estimated % of available offensive rebounds obtained while on court |
DREB% | Defensive rebound % | Estimated % of available defensive rebounds obtained while on court |
REB% | Rebound % | Estimated % of available rebounds obtained while on court |
AST/TO | Assist to turnover ratio | Ratio of assists made to turnovers committed |
AST-R | Assist ratio | Estimated % of assists per player's offensive possessions |
TO-R | Turnover ratio | Estimated % of turnovers per player's offensive possessions |
2PTA-R | Two-point attempts ratio | Estimated % of two-point attempts per player's offensive possessions |
3PTA-R | Three-point attempts ratio | Estimated % of three-point attempts per player's offensive possessions |
FT-RT | Free Throw rate | Measure of free throw attempts vs. field goal attempts |
Reference webpage: Stats
Examples
## Not run:
getPlayerAdvanced(season_code = "E2023", statistic_mode = "perGame")
## End(Not run)
Get player miscellaneous statistics
Description
Usage
getPlayerMisc(season_code)
Arguments
season_code |
One or more season codes as obtained from |
Value
Returns a summary tibble of miscellaneous players statistics for chosen seasons.
Glossary of columns:
Column name | Column extended name | Column description |
DD2 | Double-doubles | Games with double-digit totals in two of: points, rebounds, assists, steals and blocks |
TD3 | Triple-doubles | Games with double-digit totals in three of: points, rebounds, assists, steals and blocks |
Reference webpage: Stats
Examples
## Not run:
getPlayerMisc(season_code = "E2023")
## End(Not run)
Get player points statistics
Description
Usage
getPlayerPoints(season_code)
Arguments
season_code |
One or more season codes as obtained from |
Value
Returns a summary tibble of points players statistics for chosen seasons.
Glossary of columns:
Column name | Column extended name | Column description |
2PA-S | Two-point attempts share | Player's share of team's total two-point attempts |
3PA-S | Three-point attempts share | Player's share of team's total three-point attempts |
FTA-S | Free throw attempts share | Player's share of team's total free throw attempts |
2PM-S | Two-pointers made share | Player's share of team's total two-pointers made |
3PM-S | Three-pointers made share | Player's share of team's total three-pointers made |
FTM-S | Free throws made share | Player's share of team's total free throws made |
2P-RT | Two-Point Rate | % of a player's field goal attempts that are two-pointers |
3P-RT | Three-Point Rate | % of field goal attempts that are three-pointers |
%2P | % of points from two-pointers | % of points from two-point shots made |
%3P | % of points from three-pointers | % of points from three-point shots made |
%FT | % of points from free throws | % of points from free throws made |
Reference webpage: Stats
Examples
## Not run:
getPlayerPoints(season_code = "E2023")
## End(Not run)
Get player statistics
Description
Usage
getPlayerStats(
season_code,
statistic_mode = c("perGame", "perMinute", "accumulated")
)
Arguments
season_code |
One or more season codes as obtained from |
statistic_mode |
One or more aggregation modes of statistics. |
Value
Returns a summary tibble of players statistics for chosen seasons.
Glossary of columns:
Column name | Column extended name |
GP | Game player |
GS | Game started |
MIN | Minutes played |
PTS | Points scored |
2PM | Two-pointers made |
2PA | Two-pointers attempted |
2P% | Two-point % |
3PM | Three-pointers made |
3PA | Three-pointers attempted |
3P% | Three-point % |
FTM | Free throws made |
FTA | Free throws attempted |
FT% | Free-throw % |
OREB | Offensive rebounds |
DREB | Defensive rebounds |
TREB | Total rebounds |
AST | Assists |
STL | Steals |
TO | Turnovers |
BLK | Blocks |
BLKA | Blocks against |
FC | Personal fouls committed |
FD | Personal fouls drawn |
PIR | Performance Index Rating |
Reference webpage: Stats
Examples
## Not run:
getPlayerStats(season_code = "E2023", statistic_mode = "perGame")
## End(Not run)
Team metadata
Description
Retrieve contextual information about teams.
Outputs may be required as arguments of other getTeam*
or getPlayer*
functions.
Usage
getTeam(season_code, team_code)
getTeamPeople(season_code, team_code)
getTeamGames(season_code, team_code)
Arguments
season_code |
One or more season codes as obtained from |
team_code |
One or more team codes as obtained from |
Value
For each function, returns a tibble with information about team, people or games of chosen season and team code.
Examples
## Not run:
getTeam(team_code = "ASV", season_code = c("E2023", "E2022")) |> head(5)
getTeamPeople(team_code = "ASV", season_code = c("E2023", "E2022")) |> head(5)
getTeamGames(team_code = "ASV", season_code = c("E2023", "E2022")) |> head(5)
## End(Not run)
Get team lead statistics
Description
Usage
getTeamLeadStats(season_code, phase_type = "All", subset = "All")
Arguments
season_code |
One or more season codes as obtained from |
phase_type |
One or more phase type codes as obtained from |
subset |
One or more game subsets. |
Value
Returns a list of elements for the chosen seasons, phase_type and subset.
-
TeamAccumulated. Total sum of statistics of all teams team
-
TeamAveragePerGame. Average per game of statistics of all teams
Glossary of columns:
Column name | Column extended name |
GP | Game player |
GS | Game started |
MIN | Minutes played |
PTS | Points scored |
2PM | Two-pointers made |
2PA | Two-pointers attempted |
2P% | Two-point % |
3PM | Three-pointers made |
3PA | Three-pointers attempted |
3P% | Three-point % |
FTM | Free throws made |
FTA | Free throws attempted |
FT% | Free-throw % |
OREB | Offensive rebounds |
DREB | Defensive rebounds |
TREB | Total rebounds |
AST | Assists |
STL | Steals |
TO | Turnovers |
BLK | Blocks |
BLKA | Blocks against |
FC | Personal fouls committed |
FD | Personal fouls drawn |
PIR | Performance Index Rating |
Reference webpage: TeamLead
Examples
## Not run:
TeamLeadStats = getTeamLeadStats(season_code = c("E2022", "E2023"), phase_type = "RS")
TeamLeadStats$TeamAccumulated |> head(5)
TeamLeadStats$TeamAveragePerGame |> head(5)
## End(Not run)
Get team statistics
Description
Usage
getTeamStats(season_code, team_code, phase_type = "All")
Arguments
season_code |
One or more season codes as obtained from |
team_code |
One or more team codes as obtained from |
phase_type |
One or more phase type codes as obtained from |
Value
Returns a list of elements for the chosen teams and seasons:
-
PlayerAccumulated. Total sum of statistics by player
-
PlayerAveragePerGame. Average per game of statistics by player
-
PlayerAveragePer40. Average per 40 minutes of statistics by player
-
TeamAccumulated. Total sum of statistics of team
-
TeamAveragePerGame. Average per game of statistics of teams
Glossary of columns:
Column name | Column extended name |
GP | Game player |
GS | Game started |
MIN | Minutes played |
PTS | Points scored |
2PM | Two-pointers made |
2PA | Two-pointers attempted |
2P% | Two-point % |
3PM | Three-pointers made |
3PA | Three-pointers attempted |
3FG% | Three-point % |
FTM | Free throws made |
FTA | Free throws attempted |
FT% | Free-throw % |
OREB | Offensive rebounds |
DREB | Defensive rebounds |
TREB | Total rebounds |
AST | Assists |
STL | Steals |
TO | Turnovers |
BLK | Blocks |
BLKA | Blocks against |
FC | Personal fouls committed |
FD | Personal fouls drawn |
PIR | Performance Index Rating |
Reference webpage: Team
Examples
## Not run:
TeamStats = getTeamStats(team_code = "ASV", season_code = c("E2023", "E2022"), phase_type = "RS")
TeamStats$PlayerAccumulated |> head(5)
TeamStats$PlayerAveragePerGame |> head(5)
TeamStats$PlayerAveragePer40 |> head(5)
TeamStats$TeamAccumulated |> head(5)
TeamStats$TeamAveragePerGame |> head(5)
## End(Not run)