
Last chance! 50% off unlimited learning
Sale ends in
For use with the StatsBomb Data API credentials. This function is used to access the JSON file from the StatsBomb API and format it as a data frame (tibble) for use in R. This function supports multiple competitions and seasons simultaneously. Currently, parallel is only supported for windows.
MultiCompMatches(username = "username", password = "password", competitionmatrix,
version = "v1", baseurl = "https://data.statsbombservices.com/api/",
remove.deleted.matches = TRUE)
Character object of your StatsBomb API username.
Character object of your StatsBomb API password.
Matrix of the competition and season ids you want the match information for. Competition ID in the first column and Season ID in the second column.
Character string of the version of the StatsBomb API you wish to access. Currently version v1 and v2 are supported.
Boolean variable for whether or not you want the deleted matches to be removed from the returned data frame.
Returns a data frame with all the matches for the competitions and seasons specified.
# NOT RUN {
##Pull Competitions From the API
comps <- competitions(username, password)
##Filter for the competitions you want
EuropeComps <- comps
# }
# NOT RUN {
<!-- %>% filter(country_name == "Europe") -->
# }
# NOT RUN {
##Create a matrix of the competition and season ids
competitionmatrix <- as.matrix(EuropeComps[,1:2])
##Pull all of the matches.
Matches <- MultiCompMatches(username, password, competitionmatrix)
# }
Run the code above in your browser using DataLab