Currently Empty: $0.00
MMA Analytics
New R Package! Get FREE UFC Data with ufcscrapeR
How to Easily Access UFC and Pride Fight Data for Analytics Projects (Now in R!)
Accessing MMA data is essential for anyone interested in analytics. Whether you’re analyzing fighter performance, predicting fight outcomes, or evaluating match strategies, having access to reliable and detailed data is crucial. In this guide, we’ll focus on a powerful new R package—ufcscrapeR—that allows you to retrieve UFC and Pride fighting data, including round-by-round analytics, control times, strikes, takedowns, and more, all within the R environment.
Step 1: Introducing the ufcscrapeR Package
The ufcscrapeR package is an R-based tool that retrieves detailed MMA fight data from UFCStats.com. This package provides a wealth of information for each fighter’s bouts, including:
- Round-by-Round Statistics: Strikes landed/attempted, takedowns, submission attempts, control time, and more.
- Total Fight Data: Comprehensive metrics aggregated over the entire fight.
- Significant Strikes Details: Breakdowns by head, body, leg, and position (distance, clinch, ground).
- UFC & Pride Coverage: Includes data not only from UFC events but also from Pride fights, allowing you to analyze legends like Fedor Emelianenko who never fought in the UFC but are accessible due to UFC’s acquisition of Pride footage and data.
Accessing the R Package
You can find the ufcscrapeR package and its documentation here:
We will be submitting the package to CRAN for approval today, so stay tuned for an official release!
Running the Package Locally
After installing the package (see instructions in the GitHub README), you can run ufcscrapeR directly in R. Simply load the package, provide a fighter’s name, and retrieve all the detailed fight data, including round-by-round statistics, in a matter of seconds.
Step 2: Using ufcscrapeR in R
The ufcscrapeR package uses R (and packages like rvest and httr) to parse and extract detailed stats from UFCStats.com. The workflow is straightforward:
- Install and load the package: Use devtools::install_local or a CRAN installation (once available) to set it up.
- Provide the fighter’s name: Enter a full name, last name, or first name (e.g., “Israel Adesanya”).
- Retrieve the data: Call
get_ufc_data("Israel Adesanya")
to pull all available fights—UFC and Pride included. - Output is a clean data frame: Perfect for immediate use in modeling, visualization, or statistical analysis.
Example: Retrieving Data for Israel Adesanya
# Just call the function with a fighter name:
df <- get_ufc_data("Israel Adesanya")
# Inspect the first few rows
head(df)
# You now have a data frame with strikes, takedowns, control time, event info, and more.
The resulting data frame provides round-by-round strikes, takedowns, control time, significant strike details, event names, dates, methods of victory, and more.
Predictive Modeling and Visualizations
With this rich dataset, you can:
- Predict Fight Outcomes: Input round-by-round stats, strike patterns, and takedown success rates into a machine learning model in R (e.g., using tidymodels) to forecast future fights.
- Create Data Visualizations: Use ggplot2 or plotly to create heatmaps of striking locations, line graphs of fighter performance over time, or shiny apps for interactive dashboards.
- Compare Legends Across Eras: Since the data includes Pride fights, analyze how legendary Pride fighters compare to modern UFC athletes using standard metrics.
Step 3: Exploring Other Data Sources
While ufcscrapeR focuses on UFCStats.com, you can still use complementary public sources for historical context or to add non-UFC organizations:
- UFC Stats: The official source for UFC metrics, which ufcscrapeR taps into for data.
- Tapology: Offers extensive MMA statistics, useful for cross-referencing the data you scrape.
Step 4: Apply Your Data Skills
The ufcscrapeR data is an excellent starting point for:
- Machine learning models to predict fight outcomes based on historical performance using caret or tidymodels.
- Streak analysis to see how fighters evolve over their careers, leveraging dplyr for data wrangling.
- Comparative analysis of different fighting styles using summary statistics, PCA, or cluster analysis right in R.
Final Thoughts
MMA analytics is a rapidly growing field, and tools like ufcscrapeR simplify the process of obtaining high-quality data directly in R. By combining this data with R’s robust analytics ecosystem, you can gain new insights into fighter performance, predict outcomes, and enhance your MMA research.
Call to Action
Ready to deepen your MMA analytics expertise? Visit our MMA Analytics Courses to learn how to transform raw data into actionable insights, and start your journey to becoming a top-tier MMA analyst today.