Learn R Programming

worldfootballR

Overview

This package is designed to allow users to extract various world football results and player statistics from the following popular football (soccer) data sites:

Installation

You can install the CRAN version of worldfootballR with:

install.packages("worldfootballR")

You can install the released version of worldfootballR from GitHub with:

# install.packages("devtools")
devtools::install_github("JaseZiv/worldfootballR")
library(worldfootballR)

Usage

Package vignettes have been built to help you get started with the package.

  • For functions to extract data from FBref, see here
  • For functions to extract data from Transfermarkt, see here
  • For functions to extract data from Understat, see here
  • For functions to extract data from fotmob, see here
  • For functions to extract data for international matches from FBref, see here
  • For functions to load pre-scraped data, see here

Loading Data

Since the release of v0.5.3, the library now supports very rapid loading of pre-collected data through the use of load_ functions.

The data available for loading is stored in the worldfootballR_data repository. The repo can be found here.

Head to the vignette here to see examples of which data is available for rapid loading.


News

To stay up-to-date with the latest changes, see the package change log


Leagues and Seasons

Fbref

For FBref.com data (match and season data), a list of leagues and seasons included in the package can be found in the worldfootballR_data repository and can be found here

Transfermarkt

For transfermarkt.com data (valuations and transfers), a list of leagues and seasons included in the package can be found in the worldfootballR_data repository and can be found here

Understat

The following leagues are currently supported by Understat (these values can be passed in to the league arguments of most understat_ functions):

  • “EPL”
  • “La liga”
  • “Bundesliga”
  • “Serie A”
  • “Ligue 1”
  • “RFPL”

Attribute the Source

When using the functions in the package, please ensure you attribute the source of the data based on the function you use.

Data providers are listed below:

Acknowledgements

Special mention goes out to Ewan Henderson’s awesome understatr library for the inspiration and internal code for the understat_ functions contained in this package.


Contributing

Issues and Improvements

When creating an issue, please include:

  • Reproducible examples
  • A brief description of what the expected results are
  • If applicable, the fbref.com, transfermarkt.com or understat.com page the observed behaviour is occurring on
  • For improvement suggestions, what features are being requested and their purpose

Feel free to get in touch via email or twitter https://twitter.com/jaseziv if you aren’t able to create an issue.

Show your support

Follow me on Twitter (jaseziv) for updates

If this package helps you, all I ask is that you star this repo

Copy Link

Version

Install

install.packages('worldfootballR')

Monthly Downloads

789

Version

0.6.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jason Zivkovic

Last Published

November 26th, 2022

Functions in worldfootballR (0.6.2)

fb_team_goal_logs

Get team goal logs
fotmob_get_match_details

Get fotmob match details by match id
fb_team_match_log_stats

Get team match log stats
fotmob_get_match_info

Get fotmob match info by match id
fb_player_match_logs

Get fbref Player Match Logs
fotmob_get_season_stats

Get season statistics from fotmob
fotmob_get_matches_by_date

Get fotmob match results by date
get_advanced_match_stats

Get advanced match stats
fb_player_scouting_report

Get fbref Full Player Scouting Report
fotmob_get_match_team_stats

Get fotmob match top team stats by match id
get_match_lineups

Get match lineups
fotmob_get_match_players

Get fotmob match player details by match id
fb_teams_urls

Get fbref Team URLs
load_fb_big5_advanced_season_stats

Load Big 5 Euro League Season Stats
get_match_report

Get match report
fotmob_get_league_ids

Get fotmob league ids
get_match_results

Get match results
get_match_urls

Get match URLs
load_fotmob_match_details

Load pre saved fotmob match details
get_match_summary

Get match summary
tm_player_transfer_history

Get Transfermarkt player transfer history
get_player_market_values

Get player market values
load_match_comp_results

Load match competition results
get_match_shooting

Get match shooting event data
tm_expiring_contracts

Get expiring contracts
load_fotmob_matches_by_date

Load pre saved fotmob match ids by date
load_match_results

Load match results
get_season_team_stats

Get season team stats
tm_player_bio

Get transfermarkt player bios
get_team_match_results

Get team match results
tm_league_debutants

Get league debutants
tm_matchday_table

Get weekly league table
tm_staff_job_history

Get Staff Member's job history
load_understat_league_shots

Load Understat league shot locations
tm_squad_stats

Get squad player stats
tm_team_transfers

Get team transfers
tm_team_player_urls

Get transfermarkt Player URLs
tm_team_transfer_balances

Team transfer balances
tm_league_injuries

Get league injuries
understat_team_meta

Get Understat team info
fotmob_get_league_matches

Get fotmob match results by league
tm_league_team_urls

Get transfermarkt Team URLs
fotmob_get_league_tables

Get standings from fotmob
understat_match_shots

Get Understat match shot locations
player_dictionary_mapping

Player Mapping Dictionary
player_transfer_history

Get player transfer history
tm_player_market_values

Get Transfermarkt player market values
tm_player_injury_history

Get player injury history
understat_team_players_stats

Get Understat team player stats
tm_team_staff_history

Get team staff history
understat_player_shots

Get all Understat shot locations for a player
understat_league_season_shots

Get Understat league season shot locations
understat_team_stats_breakdown

Get Understat team statistics breakdowns
understat_team_season_shots

Get Understat team season shot locations
understat_league_match_results

Get Understat season match results
tm_team_staff_urls

Get transfermarkt Club Staff URLs
fb_match_urls

Get FBref match URLs
fb_league_urls

Get fbref League URLs
fb_match_shooting

Get FBref match shooting event data
fb_player_goal_logs

Get player goal logs
fb_match_summary

Get FBref match summary
fb_advanced_match_stats

Get FBref advanced match stats
fb_match_report

Get FBref match report
fb_match_results

Get FBref match results
fb_match_lineups

Get FBref match lineups
fb_big5_advanced_season_stats

Big 5 Euro League Season Stats
fb_team_match_results

Get FBref team match results
fb_team_player_stats

Get fbref Team's Player Season Statistics
fb_season_team_stats

Get FBref season team stats
fb_player_season_stats

Get fbref Player Season Statistics
fb_player_urls

Get fbref Player URLs
fb_squad_wages

Get team player wages