Package 'softballR'

Title: Easily Accessible College Softball Data
Description: A tool for accessing the data hidden on ESPN<https://www.espn.com>, NCAA<https://www.ncaa.com>, and a few others. Scrapes player boxes, team boxes, play-by-play, rankings, team stats, individual stats, and whatever else I can find online.
Authors: Tyson King [aut, cre]
Maintainer: Tyson King <[email protected]>
License: MIT + file LICENSE
Version: 1.4.0
Built: 2026-10-12 15:50:58 UTC
Source: https://github.com/sportsdataverse/softballR

Help Index


Gets full ESPN JSON file (Helper Function)

Description

Gets full ESPN JSON file (Helper Function)

Usage

espn_json(gameID)

Arguments

gameID

ESPN Game ID

Value

The entire json file for a given gameID on ESPN's website

Author(s)

Tyson King

Examples

ID = 401444869
try(espn_json(ID))

Get ESPN Play-by-Play data

Description

Get ESPN Play-by-Play data

Usage

espn_softball_pbp(gameID)

Arguments

gameID

ESPN Game ID

Value

A data frame of every pitch of the given game

Author(s)

Tyson King

Examples

ID = 401444869
try(espn_softball_pbp(ID))

Get ESPN Player Box Score for given game

Description

Get ESPN Player Box Score for given game

Usage

espn_softball_playerbox(gameID)

Arguments

gameID

ESPN Game ID

Value

A named list of dataframes, hitting and pitching

Author(s)

Tyson King

Examples

ID = 401444869
try(espn_softball_playerbox(ID))

Get ESPN Softball Scoreboard

Description

Get ESPN Softball Scoreboard

Usage

espn_softball_scoreboard(date)

Arguments

date

YYYY-MM-DD

Value

data frame with 21 columns of relevant game information

Author(s)

Tyson King

Examples

try(espn_softball_scoreboard("2022-03-05"))

Get ESPN Team Box Score for given game

Description

Get ESPN Team Box Score for given game

Usage

espn_softball_teambox(gameID)

Arguments

gameID

ESPN Game ID

Value

A named list of dataframes, Batting, Pitching, and Fielding

Author(s)

Tyson King

Examples

ID = 401444869
try(espn_softball_teambox(ID))

Get the current season

Description

Get the current season

Usage

get_cur_season()

Value

integer of current season

Examples

try(get_cur_season())

Get ESPN Softball Season Scoreboard

Description

Disclaimer: Can take a while to run

Usage

get_espn_softball_season_scoreboard(season)

Arguments

season

YYYY (2015 - 2022)

Value

data frame with data from every game in the given season

Author(s)

Tyson King

Examples

try(get_espn_softball_season_scoreboard(2021))

Load ESPN Scoreboard

Description

Load ESPN Scoreboard

Usage

load_espn_softball_scoreboard(seasons)

Arguments

seasons

vector of seasons (YYYY:YYYY)

Value

dataframe of all games on ESPN website from selected seasons

Examples

try(load_espn_softball_scoreboard(2020:2023))

Load NAIA PBP

Description

Only supports 2023 season for now

Usage

load_naia_softball_pbp(season)

Arguments

season

YYYY

Value

dataframe of all play by play data for an NAIA season

Examples

try(load_naia_softball_pbp(2023))

Load NAIA Scoreboard

Description

Only supports 2023 season for now

Usage

load_naia_softball_scoreboard(season)

Arguments

season

YYYY

Value

dataframe of all games from NAIA website from selected season

Examples

try(load_naia_softball_scoreboard(2023))

Load NCAA softball group aliases

Description

Every name and id a source uses for an NCAA softball division or conference, with the seasons it is valid for – the crosswalk from stats.ncaa.org conference ids and names to SportsDataverse group ids. Published to the ncaa_softball_groups release tag on the sportsdataverse-data releases.

Usage

load_ncaa_softball_group_aliases()

Value

A tibble with the following columns:

col_name types description
league character League key.
group_id character SportsDataverse group id, {league}:{slug}.
source character Source that uses the alias (e.g. ncaa, sdv).
source_id character The source's own id for the group (e.g. the NCAA conference id), when it has one.
name_kind character Alias kind: name, short_name, abbreviation, slug or code.
value character The alias.
valid_from integer First season the alias is valid (inclusive); NA = unbounded.
valid_to integer Last season the alias is valid (inclusive); NA = unbounded.

Examples

try(load_ncaa_softball_group_aliases())

Load NCAA softball division and conference names and parents by season

Description

One row per NCAA softball group per season it existed, with the name, abbreviation and parent group as of that season (not today's). Published to the ncaa_softball_groups release tag on the sportsdataverse-data releases. Seasons are keyed by the spring year.

Usage

load_ncaa_softball_group_seasons()

Value

A tibble with the following columns:

col_name types description
league character League key.
group_id character SportsDataverse group id, {league}:{slug}.
season integer Season (spring year).
level character Group level: league, subdivision or conference.
name character Group name as of that season.
short_name character Short name as of that season.
abbreviation character Abbreviation as of that season.
parent_group_id character Parent group id as of that season (conference, subdivision, league).
n_teams integer Member teams that season.

Examples

try(load_ncaa_softball_group_seasons())

Load NCAA softball groups (divisions and conferences)

Description

One row per NCAA softball group lineage (divisions I-III and their conferences), keyed by the SportsDataverse group id (e.g. ncaa_softball:sec). Published to the ncaa_softball_groups release tag on the sportsdataverse-data releases by sdv-reference-data. Seasons are keyed by the spring year (2025 = the spring 2025 season).

Usage

load_ncaa_softball_groups()

Value

A tibble with the following columns:

col_name types description
league character League key.
group_id character SportsDataverse group id, {league}:{slug}; one id per lineage across renames.
level character Group level: league, subdivision or conference.
first_season integer First season with at least one member.
last_season integer Last season with at least one member.
notes character Lineage decisions and source caveats.

Examples

try(load_ncaa_softball_groups())

Load NCAA PBP

Description

Play-by-play for every game of an NCAA season. The softballR-data release starts in 2021 (D1, D2 and D3); any season up to the current calendar year is accepted and a season that has not been published yet returns a try-error from the download.

Usage

load_ncaa_softball_pbp(season, division = "D1")

Arguments

season

YYYY

division

D1, D2, or D3

Value

dataframe of all play by play data for an NCAA season

Examples

try(load_ncaa_softball_pbp(2024))

Load NCAA Player Box Scores

Description

Hitting: D1 from 2012, D2 and D3 from 2016. Pitching: D1 from 2015, D2 and D3 from 2016. Fielding: D1 2023 only. Any season up to the current calendar year is accepted; one the release has not published yet fails at the download.

Usage

load_ncaa_softball_playerbox(season = 2024, category, division = "D1")

Arguments

season

YYYY can also use vector of years

category

Hitting, Pitching, or Fielding

division

D1, D2, or D3

Value

dataframe of all box scores from NCAA website from selected season

Examples

try(load_ncaa_softball_playerbox(2021:2024, category = "Hitting"))

Load NCAA Roster

Description

Supports 2016-2023 for all divisions

Usage

load_ncaa_softball_rosters(season, division = "D1")

Arguments

season

YYYY format, pass season or vector of seasons 2021-2023

division

"D1", "D2", or "D3"

Value

dataframe of all rosters from given season(s) and division

Examples

try(load_ncaa_softball_rosters(2022:2023))

Load NCAA Scoreboard

Description

Supports 2016-2023 for all divisions

Usage

load_ncaa_softball_scoreboard(season, division = "D1")

Arguments

season

YYYY format, pass season or vector of seasons

division

"D1", "D2", or "D3"

Value

dataframe of all games from NCAA website from selected season

Examples

try(load_ncaa_softball_scoreboard(2022:2024))

Load NCAA softball team division and conference memberships by season

Description

One row per NCAA softball team per season, with the division (subdivision_id) and conference it played in that season, e.g. Texas and Oklahoma moving from ncaa_softball:big-12 (2024) to ncaa_softball:sec (2025). team_id is the stats.ncaa.org org id. Published to the ncaa_softball_groups release tag on the sportsdataverse-data releases, one file per season.

Usage

load_ncaa_softball_team_group_seasons(seasons)

Arguments

seasons

A vector of 4-digit seasons (the spring year), or TRUE for every published season. (Min: 1982)

Value

A tibble with the following columns:

col_name types description
league character League key.
season integer Season (spring year).
team_id character stats.ncaa.org org id.
team_id_source character Id system of team_id (ncaa_org).
team_name character Team name as of that season.
subdivision_id character SportsDataverse division group id (e.g. ncaa_softball:d1).
conference_id character SportsDataverse conference group id; NA where the level does not apply.
division_id character SportsDataverse division-within-conference group id; NA when not used.
source character Source the membership came from.
sources_agree logical Whether a second source agrees; NA when only one source covers the season.
notes character Notes.

Examples

try(load_ncaa_softball_team_group_seasons(seasons = 2025))

Load all-time info for all NCAA softball teams (all divisions)

Description

Load all-time info for all NCAA softball teams (all divisions)

Usage

load_ncaa_softball_team_info()

Value

df with 9 columns of info on each season of each team

Examples

try(load_ncaa_softball_team_info())

Get NCAA play-by-play data for a given game id and game date

Description

only has D1 data for now

Usage

naia_softball_pbp(game_id, game_date)

Arguments

game_id

NAIA Game ID

game_date

YYYY-MM-DD format

Value

dataframe of every play from a given game

Examples

try(naia_softball_pbp("r7z2", "2023-02-05"))

Get all box scores for a given game id and date

Description

Get all box scores for a given game id and date

Usage

naia_softball_playerbox(game_id, game_date)

Arguments

game_id

NAIA Game ID

game_date

YYYY-MM-DD format

Value

named list with two elements, "Hitting" and "Pitching" Each contains a dataframe of the box scores for that game

Examples

try(naia_softball_playerbox("r7z2", "2023-02-05"))

Get all NAIA softball scores for a given day

Description

Get all NAIA softball scores for a given day

Usage

naia_softball_scoreboard(date)

Arguments

date

"YYYY-MM-DD"

Value

data frame of date, team names and their scores

Author(s)

Tyson King

Examples

date = "2022-03-05"
try(naia_softball_scoreboard(date))

Get all NAIA softball scores for a given season

Description

Get all NAIA softball scores for a given season

Usage

naia_softball_season_scoreboard(season)

Arguments

season

YYYY Only 2023 for now

Value

data frame of date, team names and their scores

Examples

season = "2023"
try(naia_softball_season_scoreboard(season))

Get NCAA play-by-play data for an entire season

Description

only has D1 data for now

Usage

ncaa_softball_pbp(game_id)

Arguments

game_id

NCAA Game ID

Value

dataframe of every play from team's season

Examples

try(ncaa_softball_pbp(2377327))

Get all box scores for a given game id

Description

Get all box scores for a given game id

Usage

ncaa_softball_playerbox(game_id)

Arguments

game_id

NCAA Game ID

Value

named list with three elements, "Hitting", "Pitching" and "Fielding". Each contains a dataframe of the box scores for that game

Examples

try(ncaa_softball_playerbox(2377042))

Get NCAA Softball Team Rankings

Description

Get NCAA Softball Team Rankings

Usage

ncaa_softball_rankings(source)

Arguments

source

Source options: RPI, D1Softball, USA Today, or Massey

Value

data frame of rankings, format changes based on source

Author(s)

Tyson King

Examples

try(ncaa_softball_rankings("RPI"))

Get all NCAA Softball rosters for a given seaosn and division

Description

Get all NCAA Softball rosters for a given seaosn and division

Usage

ncaa_softball_rosters(season, division)

Arguments

season

2012 onward (every season with a stats.ncaa.org roster id, see softballR:::.ncaa_softball_roster_ids)

division

"D1", "D2", or "D3

Value

dataframe of every player on every team in a given season/division

Examples

try(ncaa_softball_rosters(2023, "D1"))

Get all NCAA softball scores for a given day

Description

Supports 2017-2024 for D1 and only 2023 for D2 and D3

Usage

ncaa_softball_scoreboard(date, division = "D1")

Arguments

date

"YYYY-MM-DD"

division

"D1", "D2", or "D3"

Value

data frame of date, team names and their scores

Author(s)

Tyson King

Examples

date = "2022-03-05"
try(ncaa_softball_scoreboard(date))

Get NCAA play-by-play data for an entire season

Description

only has D1 data for now

Usage

ncaa_softball_season_pbp(team_id)

Arguments

team_id

get this from ncaa_teams function

Value

dataframe of every play from team's season

Examples

try(ncaa_softball_season_pbp(549186))

Get all box scores for a team's entire season (pitching, hitting, and fielding)

Description

only has data for 2021, 2022, and 2023 and only has D1 for now

Usage

ncaa_softball_season_playerbox(team_id)

Arguments

team_id

get team ids from get_ncaa_teams function

Value

named list with three elements, "Hitting", "Pitching" and "Fielding". Each contains a dataframe of every box score for that team's season

Examples

try(ncaa_softball_season_playerbox(549186))

Get all NCAA softball scores for a given season

Description

Provides the score and some other info for all D1, D2, and D3 games from 2016-2023 (for now)

Usage

ncaa_softball_season_scoreboard(season, division = "D1")

Arguments

season

YYYY 2016-2023

division

"D1", "D2", or "D3"

Value

data frame of date, team names and their scores

Examples

season = "2024"
try(ncaa_softball_season_scoreboard(season))

Get all NCAA softball team names and ids

Description

2021-2023 for D1, only 2023 for D2 and D3

Usage

ncaa_softball_teams(season, division = "D1")

Arguments

season

2021, 2022 2023, or 2024

division

"D1", "D2", or "D3

Value

data frame of date, team names and their scores

Author(s)

Tyson King

Examples

try(ncaa_softball_teams(2024))