Package 'baseballr'

Title: Acquiring and Analyzing Baseball Data
Description: Provides numerous utilities for acquiring and analyzing baseball data from online sources such as 'Baseball Reference' <https://www.baseball-reference.com/>, 'FanGraphs' <https://www.fangraphs.com/>, and the 'MLB Stats' API <https://www.mlb.com/>.
Authors: Bill Petti [aut], Saiem Gilani [aut, cre] (ORCID: <https://orcid.org/0000-0002-7194-9067>), Ben Baumer [ctb], Ben Dilday [ctb], Robert Frey [ctb], Camden Kay [ctb]
Maintainer: Saiem Gilani <[email protected]>
License: MIT + file LICENSE
Version: 2.0.0
Built: 2026-06-08 05:30:47 UTC
Source: https://github.com/billpetti/baseballr

Help Index


(legacy) Scrape Batter Game Logs from FanGraphs

Description

(legacy) Scrape Batter Game Logs from FanGraphs

Usage

batter_game_logs_fg(playerid, year)

Arguments

playerid

This is the playerid used by FanGraphs for a given player

year

The season for which game logs should be returned (use the YYYY format)

Value

A data frame of batter game logs.


Baseball Reference Functions Overview

Description

  • bref_daily_batter(): Scrape Batter Performance Data Over a Custom Time Frame

  • bref_daily_pitcher(): Scrape Pitcher Performance Data Over a Custom Time Frame

  • bref_standings_on_date(): Scrape MLB Standings on a Given Date

  • bref_team_results(): Scrape Team Results

Details

Scrape Batter Performance Data Over a Custom Time Frame

  bref_daily_batter("2015-05-10", "2015-06-20")

Scrape Pitcher Performance Data Over a Custom Time Frame

  bref_daily_batter("2015-05-10", "2015-06-20")

Scrape MLB Standings on a Given Date

  bref_standings_on_date(date = "2015-08-04", division = "AL East")

Scrape Team Results

  bref_team_results("NYM", 2015)
  bref_team_results(Tm="TBR", year=2008)

Team Level Consistency

Uses bref_team_results() to calculate team consistency metrics

  team_consistency(year=2015)

Scrape Batter Performance Data Over a Custom Time Frame

Description

This function allows you to scrape basic batter statistics over a custom time frame. Data is sourced from Baseball-Reference.com.

Usage

bref_daily_batter(t1, t2)

Arguments

t1

First date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

t2

Last date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

Value

Returns a tibble of batter performance over the requested date range, one row per player, with the following columns:

col_name types description
bbref_id character Baseball-Reference player id (slug).
season integer Season year.
Name character Player name.
Age numeric Player age during the season.
Level character League level (e.g. Maj-AL, Maj-NL).
Team character Team name.
G numeric Games played.
PA numeric Plate appearances.
AB numeric At-bats.
R numeric Runs scored.
H numeric Hits.
X1B numeric Singles.
X2B numeric Doubles.
X3B numeric Triples.
HR numeric Home runs.
RBI numeric Runs batted in.
BB numeric Walks (bases on balls).
IBB numeric Intentional walks.
uBB numeric Unintentional walks.
SO numeric Strikeouts.
HBP numeric Times hit by pitch.
SH numeric Sacrifice hits (bunts).
SF numeric Sacrifice flies.
GDP numeric Grounded into double plays.
SB numeric Stolen bases.
CS numeric Times caught stealing.
BA numeric Batting average.
OBP numeric On-base percentage.
SLG numeric Slugging percentage.
OPS numeric On-base plus slugging.

Examples

try(bref_daily_batter(t1="2015-05-10", t2="2015-06-20"))

Scrape Pitcher Performance Data Over a Custom Time Frame

Description

This function allows you to scrape basic pitcher statistics over a custom time frame. Data is sourced from Baseball-Reference.com.

Usage

bref_daily_pitcher(t1, t2)

Arguments

t1

First date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

t2

Last date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

Value

Returns a tibble of pitcher performance over the requested date range, one row per player, with the following columns:

col_name types description
bbref_id character Baseball-Reference player id (slug).
season integer Season year.
Name character Player name.
Age numeric Player age during the season.
Level character League level (e.g. Maj-AL, Maj-NL).
Team character Team name.
G numeric Games pitched.
GS numeric Games started.
W numeric Wins.
L numeric Losses.
SV numeric Saves.
IP numeric Innings pitched.
H numeric Hits allowed.
R numeric Runs allowed.
ER numeric Earned runs allowed.
uBB numeric Unintentional walks allowed.
BB numeric Walks allowed.
SO numeric Strikeouts.
HR numeric Home runs allowed.
HBP numeric Batters hit by pitch.
ERA numeric Earned run average (per 9 innings).
AB numeric At-bats against.
X1B numeric Singles allowed.
X2B numeric Doubles allowed.
X3B numeric Triples allowed.
IBB numeric Intentional walks allowed.
GDP numeric Double plays induced.
SF numeric Sacrifice flies allowed.
SB numeric Stolen bases allowed.
CS numeric Runners caught stealing.
PO numeric Pickoffs.
BF numeric Batters faced.
Pit numeric Total pitches thrown.
Str numeric Strikes thrown (as a share of pitches).
StL numeric Looking (called) strikes share.
StS numeric Swinging strikes share.
GB.FB numeric Ground ball to fly ball share.
LD numeric Line drive share.
PU numeric Pop-up (infield fly) share.
WHIP numeric Walks plus hits per inning pitched.
BAbip numeric Batting average on balls in play allowed.
SO9 numeric Strikeouts per 9 innings.
SO.W numeric Strikeout-to-walk ratio.
SO_perc numeric Strikeout rate (per batter faced).
uBB_perc numeric Unintentional walk rate (per batter faced).
SO_uBB numeric Strikeouts minus unintentional walks.

Examples

try(bref_daily_pitcher("2015-05-10", "2015-06-20"))

Scrape MLB Standings on a Given Date

Description

This function allows you to scrape the standings from MLB for any date you choose.

Usage

bref_standings_on_date(date, division, from = FALSE)

Arguments

date

a date object

division

One or more of AL East, AL Central, AL West, AL Overall, NL East, NL Central, NL West, and NL Overall

from

a logical indicating whether you want standings up to and including the date (FALSE, default) or rather standings for games played after the date

Value

Returns a tibble of MLB standings, one row per team in the requested division, with the following columns:

col_name types description
Tm character Team abbreviation.
W integer Wins as of the requested date.
L integer Losses as of the requested date.
W-L% numeric Winning percentage.
GB character Games behind the division leader (-- for the leader).
RS integer Runs scored.
RA integer Runs allowed.
pythW-L% numeric Pythagorean (expected) winning percentage from RS/RA.

Examples

try(bref_standings_on_date(date = "2015-08-04", division = "AL East"))

Scrape Team Results

Description

This function allows you to scrape schedule and results for a major league team from Baseball-Reference.com

Usage

bref_team_results(Tm, year)

Arguments

Tm

The abbreviation used by Baseball-Reference.com for the team whose results you want to scrape.

year

Season for which you want to scrape the park factors.

Value

Returns a tibble of MLB team results, one row per game on the team's schedule, with the following columns:

col_name types description
Gm character Game number / label in the schedule (includes postseason labels).
Date character Day-of-week and calendar date of the game.
Tm character Team abbreviation.
H_A character Home/away indicator (A denotes a road game).
Opp character Opponent team abbreviation.
Result character Game outcome from the team's perspective (W/L).
R integer Runs scored by the team.
RA integer Runs allowed (opponent runs).
Inn integer Innings played when not nine (e.g. extra innings).
Record character Team's cumulative win-loss record after the game.
Rank character Team's standing/rank in its division after the game.
GB character Games behind the division leader after the game.
Win character Winning pitcher.
Loss character Losing pitcher.
Save character Pitcher credited with the save (N if none).
Time character Duration of the game.
D/N character Day (D) or night (N) game.
Attendance numeric Announced attendance.
cLI numeric Championship leverage index of the game.
Streak character Win/loss streak entering the game.
Orig_Scheduled character Original scheduled date (for rescheduled games).
Year numeric Season year.

Examples

try(bref_team_results("NYM", 2015))
  try(bref_team_results(Tm="TBR", year=2008))

Chadwick Bureau Register Player Lookup

Description

  • chadwick_player_lu(): Directly download the Chadwick Bureau's public register of baseball players and the various IDs associated with them in different systems of record.

  • playername_lookup(): Look up Baseball Player Name.

  • playerid_lookup(): Look up Baseball Player IDs.

Details

Directly download the Chadwick Bureau's public register of baseball players.

  chadwick_player_lu()

Look up baseball player name by ID

  playername_lookup(4885)
  playername_lookup("kaaihki01")

Look up baseball player IDs by player name

  playerid_lookup("Garcia", "Karim")

Check Chadwick installation

Description

Utility functions to help ensure that Chadwick is set up correctly.

The easiest way for the Chadwick CLI tools to work on *nix systems is to set the LD_LIBRARY_PATH environment variable. Unfortunately this environment variable is not set by default during the Chadwick installation.

chadwick_ld_library_path() checks to find the Chadwick shared libraries, and then set the LD_LIBRARY_PATH environment variable. If chadwick_ld_library_path() returns TRUE, the cwevent command line program that retrosheet_data() depends on should work.

The other functions documented here are mostly for internal use.

Usage

chadwick_path()

chadwick_is_installed()

chadwick_find_lib()

chadwick_set_ld_library_path()

chadwick_ld_library_path()

Value

If Chadwick is not installed NULL. If Chadwick is installed, the path to the cwevent binary.

TRUE or FALSE

Path to the Chadwick shared library.

See Also

retrosheet_data()

Examples

chadwick_path()

chadwick_is_installed()

chadwick_find_lib()
## Not run: 
if (chadwick_ld_library_path()) {
  retrosheet_data(tempdir())
}

## End(Not run)

Download the Chadwick Bureau's public register of baseball players

Description

Download the Chadwick Bureau's public register of baseball players

Usage

chadwick_player_lu()

get_chadwick_lu()

Value

A data frame of baseball players and the various IDs associated with them in different systems of record and the following columns:

col_name types description
key_person character Chadwick Bureau primary person key.
key_uuid character Chadwick Bureau universally unique identifier for the person.
key_mlbam integer MLB Advanced Media (MLBAM) player ID.
key_retro character Retrosheet player ID.
key_bbref character Baseball-Reference major league player ID.
key_bbref_minors character Baseball-Reference minor league player ID.
key_fangraphs integer FanGraphs player ID.
key_npb integer Nippon Professional Baseball (Japan) player ID.
key_sr_nfl character Sports Reference NFL player ID.
key_sr_nba character Sports Reference NBA player ID.
key_sr_nhl character Sports Reference NHL player ID.
key_wikidata character Wikidata entity ID for the person.
name_last character Player last name.
name_first character Player first name.
name_given character Player full given (legal) name.
name_suffix character Name suffix (e.g. Jr., Sr., III).
name_matrilineal character Maternal surname, where recorded.
name_nick character Player nickname.
birth_year integer Year of birth.
birth_month integer Month of birth.
birth_day integer Day of birth.
death_year integer Year of death.
death_month integer Month of death.
death_day integer Day of death.
pro_played_first integer First season the person played professional baseball.
pro_played_last integer Last season the person played professional baseball.
mlb_played_first integer First MLB season as a player.
mlb_played_last integer Last MLB season as a player.
col_played_first integer First college season as a player.
col_played_last integer Last college season as a player.
pro_managed_first integer First professional season as a manager.
pro_managed_last integer Last professional season as a manager.
mlb_managed_first integer First MLB season as a manager.
mlb_managed_last integer Last MLB season as a manager.
col_managed_first integer First college season as a manager.
col_managed_last integer Last college season as a manager.
pro_umpired_first integer First professional season as an umpire.
pro_umpired_last integer Last professional season as an umpire.
mlb_umpired_first integer First MLB season as an umpire.
mlb_umpired_last integer Last MLB season as an umpire.

A data frame of baseball players and the various IDs associated with them in different systems of record.

Examples

try(chadwick_player_lu())

Helper for determining whether a batted ball is a "barrel"

Description

This function allows you to code a batted ball as a barrel as defined by the Statcast research team using data as provided by baseballsavant.mlb.com.

Usage

code_barrel(df)

Arguments

df

A dataframe generated by baseballsavant.mlb.com that must include the following variables: launch_angle and launch_speed.

Value

Returns a tibble with the additional column, barrel.


Column structure of the MLB Draft data

Description

A tibble giving column structure of MLB Draft data

Usage

column_structure_draft_mlb

Format

An object of class tbl_df (inherits from tbl, data.frame) with 0 rows and 72 columns.


(legacy) Scrape Batter Performance Data Over a Custom Time Frame

Description

(legacy) Scrape Batter Performance Data Over a Custom Time Frame

Usage

daily_batter_bref(t1, t2)

Arguments

t1

First date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

t2

Last date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

Value

Returns a tibble of batter performance

See Also

bref_daily_batter()


(legacy) Scrape Pitcher Performance Data Over a Custom Time Frame

Description

(legacy) Scrape Pitcher Performance Data Over a Custom Time Frame

Usage

daily_pitcher_bref(t1, t2)

Arguments

t1

First date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

t2

Last date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

Value

Returns a tibble of pitcher performance

See Also

bref_daily_pitcher()


Edge Code

Description

This function allows you to classify individual pitches based on the various categories from the Edge% metric. The dataframe passed to the function must include the batter's handedness, the px and pz coordinates from the PITCHf/x system, and the batter's height.

Usage

edge_code(df, height_var_name = "b_height")

Arguments

df

A dataframe that, at a minimum, includes the following columns: batter height (b_height), the batter's handedness (stand), vertical location of the pitch (pz), and then horizontal location of the pitch (pz)

height_var_name

The name of the variable in the data set that includes the batter's height. Defaults to b_height which assumes an height + inch format. If the variable name is "Height" it assumes the variable is already converted to inches (as is the case in some databases)

Value

Returns a tibble with the additional edge columns necessary for calculations.


Edge Percentage Frequency

Description

This function allows you to calculate the percent of pitches thrown to different edges of the strike zone for a pitch by pitch data set that has been coded using the edge_code() function.

Usage

edge_frequency(df, group = NULL)

Arguments

df

A data frame of pitch by pitch data that has been coded using the edge_code() function.

group

Character string indicating what column to group the frequency by. For example, "pitcher" or "batter". Defaults to NULL, which calculates the frequencies across the entire data set.

Value

Returns a tibble with the additional edge columns necessary for frequency calculations.


ESPN MLB Endpoint Overview

Description

Wrappers around ESPN's Major League Baseball endpoints (⁠espn_mlb_*()⁠). They cover ESPN's three public hosts:

  • site.api.espn.com – scoreboard, schedule, game summary (play-by-play, team / player box scores), teams, rosters.

  • sports.core.api.espn.com – reference data: athletes, coaches, seasons, franchises, draft, futures, leaders, standings, events, plays, and per-competitor game detail.

  • site.web.api.espn.com – athlete overviews, game logs, splits, and league-wide statistics.

These complement the MLB Stats API wrappers (⁠mlb_*()⁠), FanGraphs (⁠fg_*()⁠), Baseball Reference (⁠bref_*()⁠), and Baseball Savant / Statcast (⁠statcast_*()⁠) families. The ⁠espn_mlb_*()⁠ naming mirrors the sister SportsDataverse packages – hoopR (⁠espn_nba_*⁠ / ⁠espn_mbb_*⁠), wehoop (⁠espn_wnba_*⁠ / ⁠espn_wbb_*⁠), and cfbfastR (⁠espn_cfb_*⁠).

Details

Play-by-play, scoreboard, schedule, box scores

Reference data

HTTP layer

ESPN wrappers call .retry_request() directly without ..., so per-call proxy overrides are not supported. Route requests through options(baseballr.proxy = ...) or the http_proxy / https_proxy environment variables instead.

See Also

Other ESPN MLB Functions: espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()


Get ESPN MLB Athletes Index

Description

Get ESPN MLB Athletes Index

Get ESPN MLB Athletes Index

Usage

espn_mlb_athletes_index(
  season = most_recent_mlb_season(),
  active = TRUE,
  limit = 5000L,
  ...
)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

active

logical. When TRUE (default) only active athletes are returned. Set to FALSE for the full historical roster.

limit

integer. Maximum number of rows to return. Default 5000. Pass a small value (e.g. limit = 50) in tests to keep execution fast.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A single baseballr_data tibble with one row per athlete.

col_name types description
athlete_id character Unique athlete identifier (ESPN).
full_name character Player's full name.
jersey character Jersey number worn by the player.
position character Listed roster position (G, F, C, etc.).
team_id character Unique team identifier.
headshot character Headshot image URL.
status character Status label.
link character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_athletes_index(season = 2025, limit = 50)

Get ESPN MLB Season Award Detail

Description

Returns the name, description, and winners of one MLB season award. Most awards have a single winner; multi-recipient awards (e.g. All-MLB First Team) return one row per winner.

Usage

espn_mlb_award(award_id, season = most_recent_mlb_season(), ...)

Arguments

award_id

ESPN award identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A tibble with one row per winner.

col_name types description
league character League slug ("mlb").
season integer Season year.
award_id character ESPN award identifier.
name character Award name (e.g. "MVP").
description character Award description.
athlete_id character ESPN athlete id of winner (parsed from athlete_ref).
team_id character ESPN team id (parsed from team_ref).
athlete_ref character ⁠$ref⁠ to winner's per-season athlete resource.
team_ref character ⁠$ref⁠ to winner's per-season team resource.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

# MVP award id = 33
  espn_mlb_award(award_id = 33, season = 2024)

Get ESPN MLB's Betting information

Description

Get ESPN MLB's Betting information

Usage

espn_mlb_betting(game_id)

Arguments

game_id

Game ID

Value

Returns a named list of data frames: pickcenter, againstTheSpread, predictor

pickcenter

col_name types description
details character Details.
over_under numeric Over under.
spread numeric Spread.
provider_id integer Unique identifier for provider.
provider_name character Provider name.
provider_priority integer Provider priority.
away_team_odds_favorite logical Away team's team odds favorite.
away_team_odds_underdog logical Away team's team odds underdog.
away_team_odds_money_line integer Away team's team odds money line.
away_team_odds_spread_odds numeric Away team's team odds spread odds.
away_team_odds_team_id integer Unique identifier for away team odds team.
away_team_odds_win_percentage numeric Away team odds win percentage (0-1 decimal).
away_team_odds_average_score numeric Away team's team odds average score.
away_team_odds_money_line_odds numeric Away team's team odds money line odds.
away_team_odds_spread_return numeric Away team's team odds spread return.
away_team_odds_spread_record_wins integer Away team's team odds spread record wins.
away_team_odds_spread_record_losses integer Away team's team odds spread record losses.
away_team_odds_spread_record_pushes integer Away team's team odds spread record pushes.
away_team_odds_spread_record_summary character Away team's team odds spread record summary.
home_team_odds_favorite logical Home team's team odds favorite.
home_team_odds_underdog logical Home team's team odds underdog.
home_team_odds_money_line integer Home team's team odds money line.
home_team_odds_spread_odds numeric Home team's team odds spread odds.
home_team_odds_team_id integer Unique identifier for home team odds team.
home_team_odds_win_percentage numeric Home team odds win percentage (0-1 decimal).
home_team_odds_average_score numeric Home team's team odds average score.
home_team_odds_money_line_odds numeric Home team's team odds money line odds.
home_team_odds_spread_return numeric Home team's team odds spread return.
home_team_odds_spread_record_wins integer Home team's team odds spread record wins.
home_team_odds_spread_record_losses integer Home team's team odds spread record losses.
home_team_odds_spread_record_pushes integer Home team's team odds spread record pushes.
home_team_odds_spread_record_summary character Home team's team odds spread record summary.
game_id integer Unique game identifier.

againstTheSpread

col_name types description
id integer Id.
uid character ESPN UID string (universal identifier).
display_name character Display name.
abbreviation character Short abbreviation.
logo character Team or league logo URL.
logos list Logos.
records list Records.
game_id integer Unique game identifier.
team_id integer Unique team identifier.

predictor

col_name types description
game_id integer Unique game identifier.
home_team_id integer Unique identifier for the home team.
away_team_id integer Unique identifier for the away team.
away_team_game_projection numeric Away team's team game projection.
away_team_chance_loss numeric Away team's team chance loss.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_betting(game_id = 401283399))

Get ESPN MLB Calendar

Description

Get ESPN MLB Calendar

Get ESPN MLB Calendar

Usage

espn_mlb_calendar(season = most_recent_mlb_season())

Arguments

season

integer or character. Four-digit season year (e.g. 2025). Defaults to most_recent_mlb_season().

Details

Retrieve the ESPN MLB schedule calendar for a given season. The underlying scoreboard response contains a leagues[[1]]$calendar block with season-type entries (pre-season, regular, post). Uses getOption("baseballr.proxy") or http_proxy/https_proxy environment variables for proxy configuration (per-call proxy override is not supported for ESPN wrappers).

Value

Returns a tibble of calendar entries.

col_name types description
season character Season identifier (4-digit year or 'YYYY-YY' string).
season_type character Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN).
season_type_label character
season_start_date character Date in YYYY-MM-DD format.
season_end_date character Date in YYYY-MM-DD format.
label character
alternate_label character
detail character
value character Numeric or string value field.
start_date character Start date (YYYY-MM-DD).
end_date character End date (YYYY-MM-DD).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_calendar(season = 2025)

Get ESPN MLB Single-Coach Detail

Description

Returns biography, current team / college refs, and counts of career record entries + per-season coaching entries for one MLB coach. Backed by sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/coaches/{coach_id}.

Usage

espn_mlb_coach(coach_id, ...)

Arguments

coach_id

ESPN coach identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
coach_id character ESPN coach identifier.
uid character ESPN UID string.
first_name character First name.
last_name character Last name.
date_of_birth character Date of birth (ISO 8601).
birth_city character Birth city.
birth_state character Birth state / region.
n_career_records integer Count of career-records entries.
n_coach_seasons integer Count of seasons coached.
college_ref character ⁠$ref⁠ to the coach's college.
team_ref character ⁠$ref⁠ to the coach's current team.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_coach(coach_id = 52120)

Get ESPN MLB Coach Career Record (Long Format)

Description

Returns a coach's career record by type in long format (one row per stat in the record's stats[] array). record_type codes commonly populated: 0 = Total, 1 = Pre Season, 2 = Regular Season, 3 = Post Season. Use espn_mlb_coaches() to discover coach_ids for a season.

Usage

espn_mlb_coach_record(coach_id, record_type = 0L, ...)

Arguments

coach_id

ESPN coach identifier (use espn_mlb_coaches() to find).

record_type

Integer record type: 0 = Total (default), 1 = Pre Season, 2 = Regular Season, 3 = Post Season.

...

Additional arguments; currently unused.

Value

A long tibble.

Note: ESPN's core-v2 coach feed is sparsely populated for MLB and this frequently returns an empty tibble. When populated, the columns are:

col_name types description
coach_id character Unique ESPN coach identifier.
record_type integer Record type identifier.
name character Record name (e.g. 'overall').
summary character Record summary (e.g. 'W-L').
stat_name character Statistic name.
value numeric Statistic value.
display_value character Human-readable statistic value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_coach_record(coach_id = 52120, record_type = 2)

Get ESPN MLB Coach-in-Season Detail

Description

Per-season coach detail (name, birth info, ⁠$ref⁠s to team/college/ person). ESPN's coverage of this endpoint is sparse; many (coach × season) combinations return 404.

Usage

espn_mlb_coach_season(coach_id, season = most_recent_mlb_season(), ...)

Arguments

coach_id

ESPN coach identifier.

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Coach-in-Season Detail

Value

A single-row tibble.

col_name types description
league character League slug.
season integer Season year.
coach_id character ESPN coach id.
uid character ESPN UID string.
first_name character First name.
last_name character Last name.
date_of_birth character Date of birth.
birth_city character Birth city.
birth_state character Birth state / region.
n_records integer Count of records entries.
person_ref character ⁠$ref⁠ to person resource.
college_ref character ⁠$ref⁠ to college.
team_ref character ⁠$ref⁠ to team-in-season.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_coach_season(coach_id = 52120, season = 2025)

Get ESPN MLB Coaches

Description

Get ESPN MLB Coaches

Get ESPN MLB Coaches

Usage

espn_mlb_coaches(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A single baseballr_data tibble with one row per coach.

col_name types description
coach_id character
first_name character Player's first name.
last_name character Player's last name.
full_name character Player's full name.
experience integer Years of professional experience.
team_id character Unique team identifier.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_coaches(season = 2025)

Get ESPN MLB Conferences

Description

Get ESPN MLB Conferences

Get ESPN MLB Conferences

Usage

espn_mlb_conferences()

Value

A baseballr_data tibble with one row per conference:

col_name types description
group_id integer Group identifier (e.g. conference group_id).
conference_short_name character Conference short name (e.g. 'ACC').
conference_uid character ESPN universal conference identifier.
conference_name character Full conference name.
conference_logo character Logo image URL for conference.
parent_group_id integer Unique identifier for parent group.
conference_id integer Conference identifier.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_conferences())

Get ESPN MLB Draft Picks

Description

Get ESPN MLB Draft Picks

Get ESPN MLB Draft Picks

Usage

espn_mlb_draft(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...).

Details

Calls the ESPN core-v2 endpoint ⁠https://sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{year}/draft/rounds⁠, which returns each round of the draft with its picks inlined as ⁠picks: [...]⁠. For historical seasons with no ESPN draft data the function returns an empty tibble rather than erroring.

Value

A baseballr_data tibble with one row per draft pick:

col_name types description
season integer Season identifier (4-digit year or 'YYYY-YY' string).
round integer Tournament / playoff round.
pick integer
overall integer Overall.
traded logical
trade_note character
status character Status label.
athlete_id character Unique athlete identifier (ESPN).
athlete_ref character
team_id character Unique team identifier.
team_ref character

Athlete and team details (name, position, college, abbreviation) are not inlined in the draft response; resolve them via espn_mlb_player_info() or espn_mlb_team() using the returned IDs.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_draft(season = 2024)

Get ESPN MLB Draft Athlete Detail (Single Drafted Player)

Description

Returns rich single-row detail for one drafted athlete in one MLB draft year: name, height, weight, position, pick (overall/round/team), and a ⁠$ref⁠ to the athlete's core-v2 profile. Use espn_mlb_draft_athletes() to enumerate draftees for a year.

Usage

espn_mlb_draft_athlete_detail(
  season = most_recent_mlb_season(),
  athlete_id,
  ...
)

Arguments

season

Draft year (numeric). Defaults to the most recent MLB season.

athlete_id

ESPN draftee identifier.

...

Additional arguments; currently unused.

Value

A single-row tibble.

Note: ESPN does not currently populate the MLB draft feed, so this typically returns an empty tibble. When populated, the columns are:

col_name types description
season integer Draft season (4-digit year).
athlete_id character Unique ESPN athlete identifier.
athlete_full_name character Drafted player full name.
position character Player position abbreviation.
round integer Draft round number.
pick integer Pick number within the round.
overall integer Overall pick number.
team_id character Drafting team identifier.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_draft_athlete_detail(season = 2024, athlete_id = 33192)

Get ESPN MLB Draft Athletes Index

Description

Returns one row per drafted athlete in a given MLB draft year.

Usage

espn_mlb_draft_athletes(season = most_recent_mlb_season(), ...)

Arguments

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Draft Athletes Index

Value

A tibble of athlete IDs + ⁠$ref⁠ URLs.

Note: ESPN does not currently populate the MLB draft-prospect feed, so this typically returns an empty tibble. When populated, the columns are:

col_name types description
season integer Draft season (4-digit year).
round integer Draft round number.
pick integer Pick number within the round.
overall integer Overall pick number.
athlete_id character Unique ESPN athlete identifier.
athlete_full_name character Drafted player full name.
position character Player position abbreviation.
team_id character Drafting team identifier.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_draft_athletes(season = 2024)

Get ESPN MLB Draft Pick Detail

Description

Returns a single MLB draft pick. Defaults to the most recent MLB season's #1 overall pick. For a full draft, use espn_mlb_draft().

Usage

espn_mlb_draft_pick(
  season = most_recent_mlb_season(),
  round = 1L,
  pick = 1L,
  ...
)

Arguments

season

Season year. Defaults to most recent MLB season.

round

Draft round (default 1).

pick

Pick number within the round (default 1).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Draft Pick Detail

Value

A single-row tibble.

col_name types description
league character League slug.
season integer Season year of the draft.
round integer Round number.
pick integer Pick within the round.
overall integer Overall pick number.
traded logical Whether the pick was traded.
trade_note character Trade note (if any).
status character Pick status name.
athlete_id character Drafted athlete's ESPN id.
team_id character Drafting team's ESPN id.
athlete_ref character ⁠$ref⁠ to athlete.
team_ref character ⁠$ref⁠ to team.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_draft_pick(season = 2024, round = 1, pick = 1)

Get ESPN MLB Draft Rounds Summary

Description

Returns one row per round of the MLB draft (typically 2 rounds: 1st with 30 picks, 2nd with ~28 picks).

Usage

espn_mlb_draft_rounds(season = most_recent_mlb_season(), ...)

Arguments

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Draft Rounds Summary

Value

A tibble with one row per round.

Note: ESPN does not currently populate the MLB draft feed, so this typically returns an empty tibble. When populated, the columns are:

col_name types description
season integer Draft season (4-digit year).
round integer Draft round number.
display_name character Round display name.
number_of_picks integer Number of picks in the round.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_draft_rounds(season = 2024)

Get ESPN MLB Draft Status

Description

Returns the current status of one MLB draft year (round, state, description). Live during the draft; static afterward.

Usage

espn_mlb_draft_status(season = most_recent_mlb_season(), ...)

Arguments

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Draft Status

Value

A single-row tibble.

col_name types description
league character League.
season integer Season (4-digit year).
round integer Draft round.
type_id character Type id.
type_name character Type name.
type_state character Type state.
description character Description.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_draft_status(season = 2024)

Get ESPN MLB Franchise Detail

Description

Returns franchise-level metadata for an MLB franchise. Franchise IDs are stable across relocations and rebrands — useful for tracking franchise history independent of current team identity.

Usage

espn_mlb_franchise(franchise_id, ...)

Arguments

franchise_id

ESPN franchise identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
id character ESPN franchise identifier.
uid character ESPN UID string.
slug character URL-safe identifier.
location character Franchise location.
name character Franchise name.
nickname character Common nickname (often same as name).
abbreviation character Short abbreviation.
display_name character Full display name.
short_display_name character Short display name.
color character Primary color (hex, no leading '#').
is_active logical Whether franchise is currently active.
league character League slug ("mlb").
logo character Primary logo URL.
logo_dark character Dark-mode logo URL.
venue_ref character ⁠$ref⁠ to franchise's primary venue.
team_ref character ⁠$ref⁠ to the current team for franchise.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_franchise(franchise_id = 13)

Get ESPN MLB Franchises Index

Description

Returns the full MLB franchises index from sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/franchises. Each row is one franchise with its ID and the canonical ⁠$ref⁠ URL — pass an ID to espn_mlb_franchise() for full franchise detail.

Usage

espn_mlb_franchises(...)

Arguments

...

Additional arguments; currently unused.

Value

A tibble with one row per franchise.

col_name types description
franchise_id character ESPN franchise identifier.
ref character Full ⁠$ref⁠ URL for franchise detail.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_franchises()

Get ESPN MLB Free Agents

Description

Get ESPN MLB Free Agents

Get ESPN MLB Free Agents

Usage

espn_mlb_freeagents(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...).

Details

Calls the ESPN core-v2 endpoint ⁠https://sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{year}/freeagents⁠. As of 2026-05, this endpoint returns HTTP 500 for every season tested and there is no documented replacement; the function consequently returns an empty tibble and emits a CLI error message. It is retained so that downstream code does not break if ESPN restores the endpoint, but should not be relied on in the meantime.

Value

A baseballr_data tibble with one row per free agent:

col_name types description
season integer Season identifier (4-digit year or 'YYYY-YY' string).
athlete_id character Unique athlete identifier (ESPN).
athlete_name character Athlete display name (ESPN).
position character Listed roster position (G, F, C, etc.).
prior_team_id character
status character Status label.
signed_team_id character
signed_date character
contract_value character
contract_term_years character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_freeagents(season = 2025)

Get ESPN MLB Season Futures (Long Format)

Description

Returns the full futures-betting board for an MLB season, in long format: one row per (market x team). Markets include championship winner, conference winner, division winner, MVP odds, etc. Backed by sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{season}/futures.

Usage

espn_mlb_futures(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A long-format tibble.

col_name types description
season integer Season year.
league character League slug ("mlb").
market_id character ESPN futures-market identifier.
market_name character Internal market name (e.g. "MLB - Winner").
market_type character Market type code (winLeague, winConference, winDivision, ...).
market_display character Human-readable name (e.g. "MLB Championship Winner").
provider_id character Sportsbook provider identifier.
provider_name character Sportsbook provider name (e.g. "ESPN BET").
team_id character ESPN team id (parsed from team_ref).
odds_value character American odds for the team (e.g. "-250", "+800").
team_ref character ⁠$ref⁠ to the per-season team resource.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_futures(season = 2025)

Get ESPN MLB game data (Pbp, Team and Player Box)

Description

Get ESPN MLB game data (Pbp, Team and Player Box)

Usage

espn_mlb_game_all(game_id)

Arguments

game_id

Game ID

Value

A named list of data frames: Plays, Team, Player

espn_mlb_game_all() bundles three tibbles returned in one call. Each component is identical to the matching standalone function – see those for the full column documentation:

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_game_all(game_id = 401283399))

Get ESPN MLB Event Broadcasts

Description

Get ESPN MLB Event Broadcasts

Get ESPN MLB Event Broadcasts

Usage

espn_mlb_game_broadcasts(event_id, ...)

Arguments

event_id

ESPN event/game identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A tibble with one row per broadcast outlet for the game.

col_name types description
event_id character Unique event / game identifier (ESPN).
broadcast_id character
type_id character Type identifier (numeric).
type_short_name character
type_long_name character
market_id character
market_type character
names character
lang character
region character Region label.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_broadcasts(event_id = "401283399")

ESPN MLB Game Endpoint Overview

Description

  • espn_mlb_scoreboard(): Scores and schedule for a date (YYYYMMDD).

  • espn_mlb_pbp(): Pitch- and at-bat-level play-by-play for a game.

  • espn_mlb_team_box(): Team batting / pitching / fielding box score (one wide row per team).

  • espn_mlb_player_box(): Player batting / pitching box score (one row per athlete-side).

  • espn_mlb_game_all(): Plays, team box, and player box bundled in one call.

  • espn_mlb_game_rosters(): The two game-day rosters.

  • espn_mlb_game_probables(): Probable / announced starting pitchers.

  • espn_mlb_game_info(): Venue, attendance, game duration, and the umpire crew.

  • espn_mlb_betting(), espn_mlb_game_odds(), espn_mlb_game_propbets(): Odds and prop bets.

  • espn_mlb_wp(), espn_mlb_game_probabilities(): Win-probability series.

  • espn_mlb_game_situation(), espn_mlb_game_play(), espn_mlb_game_play_personnel(): Per-play detail.

  • espn_mlb_game_team_statistics(), espn_mlb_game_team_linescores(), espn_mlb_game_team_leaders(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_score(): Per-competitor game detail.

  • espn_mlb_game_officials(), espn_mlb_game_official_detail(), espn_mlb_game_broadcasts(): Officials and broadcasts.

Details

ESPN MLB Game

Game-level ESPN endpoints: scoreboard / schedule, the game-summary feed (play-by-play and box scores), rosters, win probability, odds, and per-competitor game detail. Box scores are returned wide and tidy.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()


Get ESPN MLB Game Info (venue, attendance, duration, umpires)

Description

Returns one wide row of game metadata from the ESPN game-summary gameInfo block: venue, attendance, game duration, and the umpire crew (home-plate, first-, second-, and third-base umpires).

Usage

espn_mlb_game_info(game_id)

Arguments

game_id

Game ID – ESPN event identifier (character or numeric).

Value

A single-row baseballr_data tibble.

col_name types description
game_id integer Unique ESPN game/event identifier.
venue_id character Unique ESPN venue identifier.
venue_name character Venue (ballpark) full name.
venue_city character Venue city.
venue_state character Venue state / province.
attendance integer Announced attendance.
game_duration character Elapsed game time (H:MM).
home_plate_umpire character Home-plate umpire.
first_base_umpire character First-base umpire.
second_base_umpire character Second-base umpire.
third_base_umpire character Third-base umpire.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_game_info(game_id = "401570000"))

Get ESPN MLB Event Odds

Description

Get ESPN MLB Event Odds

Get ESPN MLB Event Odds

Usage

espn_mlb_game_odds(event_id, ...)

Arguments

event_id

ESPN event/game identifier (character or numeric).

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A tibble with one row per odds provider.

col_name types description
event_id character Unique event / game identifier (ESPN).
provider_id character Unique identifier for provider.
provider_name character Provider name.
details character Details.
over_under numeric Over under.
spread numeric Spread.
home_money_line integer
away_money_line integer
home_team_odds_open numeric
home_team_odds_close numeric
away_team_odds_open numeric
away_team_odds_close numeric

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_odds(event_id = "401283399")

Get ESPN MLB Event Official Detail (Single Official)

Description

Returns a single-row tibble for one referee assigned to one MLB event, with their name, position (Referee / Crew Chief / Umpire), and crew order. Pair with espn_mlb_game_officials() to enumerate the crew.

Usage

espn_mlb_game_official_detail(event_id, order, ...)

Arguments

event_id

ESPN event identifier.

order

Crew order index (1 = first official). Pair with the order column from event_officials().

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
official_id character Official id.
first_name character First name.
last_name character Last name.
full_name character Full name.
display_name character Display name.
position_id character Unique position identifier.
position_name character Position name.
order integer Order.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_official_detail(event_id = 401283399, order = 1)

Get ESPN MLB Event Officials

Description

Get ESPN MLB Event Officials

Get ESPN MLB Event Officials

Usage

espn_mlb_game_officials(event_id, ...)

Arguments

event_id

ESPN event/game identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A tibble with one row per official assigned to the game.

col_name types description
event_id character Unique event / game identifier (ESPN).
official_id character Unique official / referee identifier.
full_name character Player's full name.
display_name character Display name.
position_id character Unique position identifier.
position_name character Listed roster position (e.g. 'Pitcher', 'Shortstop', 'Catcher').
position_type character
order integer Display order within the result set.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_officials(event_id = "401283399")

Get ESPN MLB Event Play Detail (Single Play)

Description

Returns the rich detail block for a single MLB play: sequence, period, clock, text, scoring/shooting flags, current home/away score, team ⁠$ref⁠, and shot coordinates if applicable. Complements the bulk espn_mlb_pbp() output by exposing the canonical core-v2 play record.

Usage

espn_mlb_game_play(event_id, play_id, ...)

Arguments

event_id

ESPN event identifier.

play_id

ESPN play identifier (visible in pbp() output as play_id or extractable from ⁠plays[].$ref⁠).

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
play_id character Play id.
sequence_number character Sequence number.
type_id character Type id.
type_text character Type text.
text character Text description.
short_text character Short text.
period integer Inning number.
clock character Clock.
scoring_play logical Scoring play.
score_value numeric Score value.
away_score integer Away team run total.
home_score integer Home team run total.
shooting_play logical Shooting play.
coordinate_x numeric Coordinate x.
coordinate_y numeric Coordinate y.
team_ref character Team ref.
wallclock character Wallclock.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_play(event_id = 401283399, play_id = 4012833994)

Get ESPN MLB Event Play Personnel (On-Court Lineup at Play)

Description

Returns the players on court at a specific MLB play in long format (one row per athlete entry across both competitors). Foundation for lineup analysis. ESPN coverage is sparse — many plays return zero rows; the wrapper returns a typed empty tibble in that case.

Usage

espn_mlb_game_play_personnel(event_id, play_id, ...)

Arguments

event_id

ESPN event identifier.

play_id

ESPN play identifier.

...

Additional arguments; currently unused.

Value

A long tibble with one row per on-court athlete.

Note: ESPN baseball plays do not carry a personnel sub-resource, so this typically returns an empty tibble (it is meaningful for sports such as football). When populated:

col_name types description
event_id character Unique ESPN event/game identifier.
play_id character Unique play identifier within the game.
athlete_id character Athlete involved in the play.
participant_type character Role of the athlete in the play.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_play_personnel(event_id = 401283399, play_id = 4012833994)

Get ESPN MLB Event Player Box Score (Long Format)

Description

Returns the long-format per-game box score for a single athlete in one MLB event. One row per (category x stat). Same shape as espn_mlb_game_team_statistics() but scoped to a single athlete-in-event instead of the full team. stat_type defaults to 0 (regular-season aggregate as ESPN tags it for finished events).

Usage

espn_mlb_game_player_box(event_id, team_id, athlete_id, stat_type = 0L, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier (the competitor the athlete played for).

athlete_id

ESPN athlete identifier.

stat_type

Integer stat-type segment. Defaults to 0 (the only type commonly populated for finished events).

...

Additional arguments; currently unused.

Value

A long tibble with one row per (category x stat).

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
athlete_id character Unique ESPN athlete identifier.
stat_type integer Stat type.
category_name character Category name.
category_display character Category display.
stat_name character Stat name.
stat_abbrev character Stat abbrev.
stat_display character Stat display.
value numeric Numeric value.
display_value character Human-readable value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_player_box(event_id = 401283399, team_id = 29,
                               athlete_id = 33192)

Get ESPN MLB Event Power Index Index

Description

Returns the per-team power-index ⁠$ref⁠ URLs for one MLB event. Coverage is sparse — many events return zero items.

Usage

espn_mlb_game_powerindex(event_id, ...)

Arguments

event_id

ESPN event identifier.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Event Power Index Index

Value

A tibble with one row per team-game power-index entry.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
ref character Ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_powerindex(event_id = 401283399)

Get ESPN MLB Event Predictor (Pre-game)

Description

Returns pre-game predictor statistics for one MLB event in long format: one row per (team × statistic). Typical stats include matchup quality, predicted score, win probability, and team strength metrics. Returns empty for events without predictor data (often the case for already-played games).

Usage

espn_mlb_game_predictor(event_id, ...)

Arguments

event_id

ESPN event identifier.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Event Predictor (Pre-game)

Value

A long tibble with rows for both home and away teams.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
name character Name.
short_name character Short display name.
last_modified character Last modified.
side character Side.
team_id character Unique ESPN team identifier.
stat_name character Statistic name.
stat_display character Stat display.
description character Description.
value numeric Numeric value.
display_value character Human-readable value.
team_ref character Team ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_predictor(event_id = 401283399)

Get ESPN MLB Event Win Probabilities

Description

Get ESPN MLB Event Win Probabilities

Get ESPN MLB Event Win Probabilities

Usage

espn_mlb_game_probabilities(event_id, limit = 200, ...)

Arguments

event_id

ESPN event/game identifier (character or numeric).

limit

integer. Maximum number of probability rows to return. Defaults to 200. Pagination is handled internally.

...

Additional arguments; currently unused.

Value

A tibble with one row per play-level win-probability entry.

col_name types description
event_id character Unique event / game identifier (ESPN).
sequence_number character Sequence number of the play within the game.
play_id character Unique play identifier within a game.
period integer Inning number.
clock character Game clock value (typically empty for baseball).
home_win_percentage numeric Home win percentage (0-1 decimal).
away_win_percentage numeric Away win percentage (0-1 decimal).
tie_percentage numeric Tie percentage (0-1 decimal).
secs_to_end_of_period numeric
secs_to_end_of_game numeric

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_probabilities(event_id = "401283399", limit = 50)

Get ESPN MLB Probable Starting Pitchers

Description

Returns the probable / announced starting pitchers for a game, one row per team, parsed from the ESPN game-summary header.competitions.competitors probables block. Available for upcoming and completed games.

Usage

espn_mlb_game_probables(game_id)

Arguments

game_id

Game ID – ESPN event identifier (character or numeric).

Value

A baseballr_data tibble with one row per team's probable starter.

col_name types description
game_id integer Unique ESPN game/event identifier.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=post).
team_id integer Unique ESPN team identifier.
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_display_name character Full team display name.
home_away character Venue label for the team ('home' or 'away').
athlete_id integer Unique ESPN athlete identifier (pitcher).
athlete_full_name character Pitcher full name.
athlete_display_name character Pitcher display name.
athlete_short_name character Pitcher short display name.
jersey character Jersey number.
position character Position abbreviation (SP / RP / P).
throws character Throwing handedness (L / R).
headshot_href character Headshot image URL.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_game_probables(game_id = "401570000"))

Get ESPN MLB Event Prop Bets (Long Format)

Description

Returns prop-bet markets for one MLB event + provider in long format: one row per (athlete × prop type). Each row has american / decimal / fraction odds plus the current target (e.g. over/under line). Hits the core-v2 competitions/{id}/odds/{provider_id}/propBets endpoint and auto-paginates.

Usage

espn_mlb_game_propbets(event_id, provider_id, ...)

Arguments

event_id

ESPN event identifier.

provider_id

Sportsbook provider id (e.g. 58 = ESPN BET, 100 = Caesars). Look up via espn_mlb_game_odds().

...

Additional arguments; currently unused.

Details

Get ESPN MLB Event Prop Bets (Long Format)

Value

A long tibble with one row per (athlete × prop type).

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
provider_id character Provider id.
athlete_id character Unique ESPN athlete identifier.
prop_type_id character Prop type id.
prop_type_name character Prop type name.
american character American.
decimal numeric Decimal.
fraction character Fraction.
total numeric Total.
current_target numeric Current target.
last_updated character Last updated.
athlete_ref character Athlete ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_propbets(event_id = 401283399, provider_id = 58)

Get ESPN MLB game rosters

Description

Get ESPN MLB game rosters

Usage

espn_mlb_game_rosters(game_id)

Arguments

game_id

Game ID

Value

A game rosters data frame

col_name types description
athlete_id integer Unique ESPN athlete identifier.
athlete_uid character Athlete uid.
athlete_guid character Athlete guid.
athlete_type character Athlete type.
sdr integer Sdr.
first_name character First name.
last_name character Last name.
full_name character Full name.
athlete_display_name character Athlete display name (full).
short_name character Short display name.
weight integer Weight.
display_weight character Display weight.
height integer Height.
display_height character Display height.
age integer Age.
date_of_birth character Date of birth.
debut_year integer Debut year.
birth_place_city character Birth place city.
birth_place_state character Birth place state.
birth_place_country character Birth place country.
slug character Slug.
headshot_href character Headshot href.
headshot_alt character Headshot alt.
athlete_jersey_number character Athlete jersey number.
position_id integer Position id.
position_name character Position name.
position_display_name character Position display name.
position_abbreviation character Position abbreviation.
position_leaf logical Position leaf.
positions_ref character Positions ref.
positions_id character Positions id.
positions_name character Positions name.
positions_display_name character Positions display name.
positions_abbreviation character Positions abbreviation.
positions_leaf logical Positions leaf.
positions_parent_ref character Positions parent ref.
positions_statistics_ref character Positions statistics ref.
linked logical Linked.
years integer Years.
debut_year_2 integer Debut year 2.
debut_ref character Debut ref.
debut_ref_1 character Debut ref 1.
active logical TRUE if the row represents an active record.
status_id integer Status id.
status_name character Game status (e.g. 'STATUS_FINAL').
status_type character Status type.
status_abbreviation character Status abbreviation.
bats_type character Bats type.
bats_abbreviation character Bats abbreviation.
bats_display_value character Bats display value.
throws_type character Throws type.
throws_abbreviation character Throws abbreviation.
throws_display_value character Throws display value.
starter logical TRUE if the player started the game.
valid logical Valid.
display_name character Display name.
bat_order integer Spot in the batting order (1-9; NA if not applicable).
record_number integer Record number.
at_bats list At bats.
positions list Positions.
notes list Notes.
subbed_in_did_sub logical Subbed in did sub.
subbed_out_did_sub logical Subbed out did sub.
team_id integer Unique ESPN team identifier.
team_guid character ESPN team GUID.
team_uid character ESPN universal team identifier (UID).
team_sdr character Team sdr.
team_slug character URL-safe team identifier.
team_location character Team city / location.
team_name character Team nickname (e.g. 'Yankees').
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_display_name character Full team display name (e.g. 'New York Yankees').
team_short_display_name character Short team display name.
team_color character Team primary color (hex, no leading '#').
team_alternate_color character Team alternate color (hex).
team_is_active logical Team is active.
is_all_star logical Is all star.
logo_href character Logo href.
logo_dark_href character Logo dark href.
logos_href_2 character Logos href 2.
logos_href_3 character Logos href 3.
logos_href_4 character Logos href 4.
logos_width_4 integer Logos width 4.
logos_height_4 integer Logos height 4.
logos_alt_4 character Logos alt 4.
logos_rel_full_4 character Logos rel full 4.
logos_rel_primary_logo_on_white_color character Logos rel primary logo on white color.
logos_last_updated_4 character Logos last updated 4.
logos_href_5 character Logos href 5.
logos_width_5 integer Logos width 5.
logos_height_5 integer Logos height 5.
logos_alt_5 character Logos alt 5.
logos_rel_full_5 character Logos rel full 5.
logos_rel_primary_logo_on_black_color character Logos rel primary logo on black color.
logos_last_updated_5 character Logos last updated 5.
logos_href_6 character Logos href 6.
logos_width_6 integer Logos width 6.
logos_height_6 integer Logos height 6.
logos_alt_6 character Logos alt 6.
logos_rel_full_6 character Logos rel full 6.
logos_rel_primary_logo_on_primary_color character Logos rel primary logo on primary color.
logos_last_updated_6 character Logos last updated 6.
logos_href_7 character Logos href 7.
logos_width_7 integer Logos width 7.
logos_height_7 integer Logos height 7.
logos_alt_7 character Logos alt 7.
logos_rel_full_7 character Logos rel full 7.
logos_rel_primary_logo_on_secondary_color character Logos rel primary logo on secondary color.
logos_last_updated_7 character Logos last updated 7.
logos_href_8 character Logos href 8.
logos_width_8 integer Logos width 8.
logos_height_8 integer Logos height 8.
logos_alt_8 character Logos alt 8.
logos_rel_full_8 character Logos rel full 8.
logos_rel_primary_logo_black character Logos rel primary logo black.
logos_last_updated_8 character Logos last updated 8.
logos_href_9 character Logos href 9.
logos_width_9 integer Logos width 9.
logos_height_9 integer Logos height 9.
logos_alt_9 character Logos alt 9.
logos_rel_full_9 character Logos rel full 9.
logos_rel_primary_logo_white character Logos rel primary logo white.
logos_last_updated_9 character Logos last updated 9.
logos_href_10 character Logos href 10.
logos_width_10 integer Logos width 10.
logos_height_10 integer Logos height 10.
logos_alt_10 character Logos alt 10.
logos_rel_full_10 character Logos rel full 10.
logos_rel_secondary_logo_on_white_color character Logos rel secondary logo on white color.
logos_last_updated_10 character Logos last updated 10.
logos_href_11 character Logos href 11.
logos_width_11 integer Logos width 11.
logos_height_11 integer Logos height 11.
logos_alt_11 character Logos alt 11.
logos_rel_full_11 character Logos rel full 11.
logos_rel_secondary_logo_on_black_color character Logos rel secondary logo on black color.
logos_last_updated_11 character Logos last updated 11.
logos_href_12 character Logos href 12.
logos_width_12 integer Logos width 12.
logos_height_12 integer Logos height 12.
logos_alt_12 character Logos alt 12.
logos_rel_full_12 character Logos rel full 12.
logos_rel_secondary_logo_on_primary_color character Logos rel secondary logo on primary color.
logos_last_updated_12 character Logos last updated 12.
logos_href_13 character Logos href 13.
logos_width_13 integer Logos width 13.
logos_height_13 integer Logos height 13.
logos_alt_13 character Logos alt 13.
logos_rel_full_13 character Logos rel full 13.
logos_rel_secondary_logo_on_secondary_color character Logos rel secondary logo on secondary color.
logos_last_updated_13 character Logos last updated 13.
logos_href_14 character Logos href 14.
logos_width_14 integer Logos width 14.
logos_height_14 integer Logos height 14.
logos_alt_14 character Logos alt 14.
logos_rel_full_14 character Logos rel full 14.
logos_rel_secondary_logo_black character Logos rel secondary logo black.
logos_last_updated_14 character Logos last updated 14.
logos_href_15 character Logos href 15.
logos_width_15 integer Logos width 15.
logos_height_15 integer Logos height 15.
logos_alt_15 character Logos alt 15.
logos_rel_full_15 character Logos rel full 15.
logos_rel_secondary_logo_white character Logos rel secondary logo white.
logos_last_updated_15 character Logos last updated 15.
game_id integer Unique ESPN game/event identifier.
order integer Order.
home_away character Venue label for the team ('home' or 'away').
winner logical Winner.
nickname character Team nickname.
draft_display_text character Draft display text.
draft_round integer Draft round.
draft_year integer Draft year.
draft_selection integer Draft selection.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_game_rosters(game_id = 401283399))

Get ESPN MLB Event Situation (Live)

Description

Returns the live game situation for one MLB event: timeouts remaining, team fouls, fouls to give, bonus state, and a ⁠$ref⁠ to the last play. During a live game this reflects current state; after the game ends the values are frozen.

Usage

espn_mlb_game_situation(event_id, ...)

Arguments

event_id

ESPN event identifier.

...

Additional arguments; currently unused.

Value

A single-row tibble with timeouts + fouls for both teams.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
home_timeouts_current integer Home timeouts current.
home_timeouts_remaining integer Home timeouts remaining.
away_timeouts_current integer Away timeouts current.
away_timeouts_remaining integer Away timeouts remaining.
home_team_fouls integer Home team fouls.
home_team_fouls_current integer Home team fouls current.
home_fouls_to_give integer Home fouls to give.
home_bonus_state character Home bonus state.
away_team_fouls integer Away team fouls.
away_team_fouls_current integer Away team fouls current.
away_fouls_to_give integer Away fouls to give.
away_bonus_state character Away bonus state.
last_play_ref character Last play ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_situation(event_id = 401283399)

Get ESPN MLB Event Competitor Leaders (Top Performers)

Description

Returns the per-team statistical leaders for one MLB event in long format: one row per (category x athlete rank). Categories typically include batting average, home runs, RBIs, and MLB rating.

Usage

espn_mlb_game_team_leaders(event_id, team_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier.

...

Additional arguments; currently unused.

Value

A long tibble with one row per (category x rank).

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
category_name character Statistic category name.
category_display character Category display.
category_abbrev character Category abbrev.
rank integer Rank within the result set.
athlete_id character Unique ESPN athlete identifier.
display_value character Human-readable value.
value numeric Numeric value.
athlete_ref character Athlete ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_leaders(event_id = 401283399, team_id = 29)

Get ESPN MLB Event Competitor Linescores (Per-Inning)

Description

Returns the per-inning run breakdown for one team in one MLB event. One row per inning (regulation innings plus any extra innings).

Usage

espn_mlb_game_team_linescores(event_id, team_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier (the competitor whose linescore to fetch).

...

Additional arguments; currently unused.

Value

A tibble with one row per inning.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
period integer Inning number.
value numeric Numeric value.
display_value character Human-readable value.
source character Source.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_linescores(event_id = 401283399, team_id = 29)

Get ESPN MLB Event Competitor Records (At-Game Breakdown)

Description

Returns team records as of the given MLB event: overall, home, away, conference, and division breakdowns where available. One row per record type.

Usage

espn_mlb_game_team_records(event_id, team_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier.

...

Additional arguments; currently unused.

Value

A tibble with one row per record type.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
record_id character Record id.
name character Name.
abbreviation character Short abbreviation.
display_name character Display name.
short_display_name character Short display name.
type character Type.
summary character Record summary (e.g. 'W-L').
value numeric Numeric value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_records(event_id = 401283399, team_id = 29)

Get ESPN MLB Event Competitor Roster (Game-Day)

Description

Returns the game-day roster index for one team in one MLB event. Each row carries the athlete id and the core-v2 ⁠$ref⁠ URL — use the ref to dereference athlete-game splits or biographical data.

Usage

espn_mlb_game_team_roster(event_id, team_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier.

...

Additional arguments; currently unused.

Value

A tibble with one row per active athlete.

Note: ESPN's core-v2 per-game competitor roster is not populated for MLB and typically returns an empty tibble; use espn_mlb_game_rosters() (site summary) for game-day rosters. When populated:

col_name types description
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
athlete_id character Unique ESPN athlete identifier.
athlete_display_name character Player display name.
position character Position abbreviation.
jersey character Jersey number.
starter logical TRUE if the player started the game.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_roster(event_id = 401283399, team_id = 29)

Get ESPN MLB Event Competitor Roster Entry (Per-Athlete Game-Day Row)

Description

Returns a single-row tibble describing one athlete's game-day roster entry for one MLB event. Carries the starter flag, didNotPlay flag with reason, ejection flag, and the substitution slot if the athlete came in for another player. Pair with espn_mlb_game_team_roster() to enumerate the roster.

Usage

espn_mlb_game_team_roster_entry(event_id, team_id, athlete_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier.

athlete_id

ESPN athlete identifier.

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
athlete_id character Unique ESPN athlete identifier.
player_id character Player id.
period integer Inning number.
active logical Active.
starter logical TRUE if a starter.
did_not_play logical Did not play.
reason character Reason.
ejected logical Ejected.
for_player_id character For player id.
jersey character Jersey number.
display_name character Display name.
athlete_ref character Athlete ref.
position_ref character Position ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_roster_entry(event_id = 401283399,
                                            team_id = 13,
                                            athlete_id = 33192)

Get ESPN MLB Event Competitor Score (Single Row)

Description

Returns a one-row tibble with one team's final score for one MLB event: numeric value, display string, winner flag, and source metadata. Quick-lookup wrapper — use espn_mlb_game_team_linescores() for per-period detail.

Usage

espn_mlb_game_team_score(event_id, team_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier.

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
value numeric Numeric value.
display_value character Human-readable value.
winner logical Winner.
source_id character Source id.
source_description character Source description.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_score(event_id = 401283399, team_id = 29)

Get ESPN MLB Event Competitor Team Statistics (Long Format)

Description

Returns full team-game statistics for one team in one MLB event in long format: one row per (category x stat). Covers offensive, defensive, and general categories with both raw values and display strings.

Usage

espn_mlb_game_team_statistics(event_id, team_id, ...)

Arguments

event_id

ESPN event identifier.

team_id

ESPN team identifier.

...

Additional arguments; currently unused.

Value

A long tibble with one row per (category x stat).

col_name types description
league character League.
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
category_name character Statistic category name.
category_display character Category display.
stat_name character Statistic name.
stat_abbrev character Stat abbrev.
stat_display character Stat display.
value numeric Numeric value.
display_value character Human-readable value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_game_team_statistics(event_id = 401283399, team_id = 29)

Get ESPN MLB Injuries

Description

Get ESPN MLB Injuries

Get ESPN MLB Injuries

Usage

espn_mlb_injuries(season = most_recent_mlb_season(), ...)

Arguments

season

Numeric or character season year (e.g. 2025). The ESPN injury endpoint does not filter by season server-side; the value is attached as a constant column on the returned tibble for downstream joins. Defaults to most_recent_mlb_season().

...

Currently unused; reserved for future argument threading.

Value

Returns a tibble of league-wide MLB injury records. Returns an empty tibble (zero rows) when no injuries are reported.

Injuries

col_name types description
team_id character Unique team identifier.
athlete_id character Unique athlete identifier (ESPN).
athlete_name character Athlete display name (ESPN).
position character Listed roster position (G, F, C, etc.).
status character Status label.
date character Date in YYYY-MM-DD format.
type character Record type / category.
side character Side label (e.g. 'home', 'away', or 'overUnder').
returns_at character
short_comment character
long_comment character Long-form play / event comment.
season integer Season identifier (4-digit year or 'YYYY-YY' string).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_injuries()

Get ESPN MLB League Leaders

Description

Get ESPN MLB League Leaders

Get ESPN MLB League Leaders

Usage

espn_mlb_leaders(season = most_recent_mlb_season(), season_type = 2, ...)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

season_type

Integer season type: 1 = preseason, 2 = regular (default), 3 = postseason.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A single baseballr_data tibble with one row per category-athlete pair.

col_name types description
season integer Season identifier (4-digit year or 'YYYY-YY' string).
season_type integer Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN).
category character Category label.
abbreviation character Short abbreviation.
athlete_id character Unique athlete identifier (ESPN).
athlete_name character Athlete display name (ESPN).
team_id character Unique team identifier.
team_abbrev character
value numeric Numeric or string value field.
rank integer Rank.
display_value character Human-readable display value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_leaders(season = 2024, season_type = 2)

Get ESPN MLB News

Description

Get ESPN MLB News

Get ESPN MLB News

Usage

espn_mlb_news(limit = 50)

Arguments

limit

integer. Maximum number of articles to return. Default 50.

Details

Retrieve ESPN MLB news. Uses getOption("baseballr.proxy") or http_proxy/https_proxy environment variables for proxy configuration (per-call proxy override is not supported for ESPN wrappers).

Value

Returns a tibble of news articles.

col_name types description
id character Id.
type character Record type / category.
headline character News headline.
description character Long-form description text.
published character Publication timestamp (ISO 8601).
premium logical
byline character News article byline / author.
link_web character Web link / URL.
league_id character ESPN league identifier.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_news(limit = 5)

Get ESPN MLB PBP data

Description

Get ESPN MLB PBP data

Usage

espn_mlb_pbp(game_id)

Arguments

game_id

Game ID

Value

A play-by-play data frame.

col_name types description
id character Play / record identifier.
sequence_number character Play sequence number within the game.
text character Text description of the play.
away_score integer Away team run total after the play.
home_score integer Home team run total after the play.
scoring_play logical TRUE if the play scored a run.
score_value integer Runs scored on the play.
wallclock character Wall-clock timestamp of the play (ISO 8601).
at_bat_id character Identifier of the at-bat the play belongs to.
summary_type character Play summary type.
outs integer Outs in the inning after the play.
type character Type.
bat_order integer Spot in the batting order (1-9; NA if not applicable).
at_bat_pitch_number integer Pitch number within the at-bat.
pitch_velocity integer Pitch velocity (mph).
trajectory character Batted-ball trajectory.
alternative_play character Alternative play.
type_id integer Type id.
type_text character Type text.
type_type character Type type.
type_alternative_text character Type alternative text.
type_abbreviation character Type abbreviation.
period_type character Period type ('inning').
period_number integer Inning number.
period_display_value character Inning display value (e.g. 'Top 1st').
team_id integer Unique ESPN team identifier.
pitch_count_balls integer Balls in the count when the pitch was thrown.
pitch_count_strikes integer Strikes in the count when the pitch was thrown.
result_count_balls integer Balls in the count after the pitch.
result_count_strikes integer Strikes in the count after the pitch.
bats_type character Bats type.
bats_abbreviation character Bats abbreviation.
bats_display_value character Bats display value.
pitch_coordinate_x integer Pitch location x-coordinate.
pitch_coordinate_y integer Pitch location y-coordinate.
pitch_type_id character Pitch type identifier.
pitch_type_text character Pitch type description (e.g. 'Four-seam FB').
pitch_type_abbreviation character Pitch type abbreviation.
hit_coordinate_x integer Batted-ball location x-coordinate.
hit_coordinate_y integer Batted-ball location y-coordinate.
alternative_type_id character Alternative type id.
alternative_type_text character Alternative type text.
alternative_type_abbreviation character Alternative type abbreviation.
alternative_type_alternative_text character Alternative type alternative text.
alternative_type_type character Alternative type type.
on_first_athlete_id character Athlete id of the runner on first base.
on_second_athlete_id character Athlete id of the runner on second base.
play_id character Play id.
athlete_id_1 integer Primary participating athlete id (batter).
athlete_id_2 integer Second participating athlete id (pitcher).
athlete_id_3 integer Third participating athlete id (fielder).
home_team_id integer Home team id.
home_team_mascot character Home team mascot.
home_team_name character Home team name.
home_team_abbrev character Home team abbrev.
home_team_logo character Home team logo.
home_team_logo_dark character Home team logo dark.
home_team_full_name character Home team full name.
home_team_color character Home team color.
home_team_alternate_color character Home team alternate color.
home_team_score integer Home team score.
home_team_winner logical Home team winner.
home_team_record character Home team record.
away_team_id integer Away team id.
away_team_mascot character Away team mascot.
away_team_name character Away team name.
away_team_abbrev character Away team abbrev.
away_team_logo character Away team logo.
away_team_logo_dark character Away team logo dark.
away_team_full_name character Away team full name.
away_team_color character Away team color.
away_team_alternate_color character Away team alternate color.
away_team_score integer Away team score.
away_team_winner logical Away team winner.
away_team_record character Away team record.
game_id integer Unique ESPN game/event identifier.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=postseason, 4=off-season).
game_date Date Game date (YYYY-MM-DD).
game_date_time POSIXct Game start date/time (US/Eastern).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_pbp(game_id = 401071880))

Get ESPN MLB Athlete Awards

Description

Get ESPN MLB Athlete Awards

Get ESPN MLB Athlete Awards

Usage

espn_mlb_player_awards(athlete_id, ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A single tibble. This endpoint is sparse; many athletes have no award data, in which case an empty tibble with canonical columns is returned.

col_name types description
season character Season identifier (4-digit year or 'YYYY-YY' string).
award_id character
name character Display name.
description character Long-form description text.
date character Date in YYYY-MM-DD format.
type character Record type / category.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_awards(athlete_id = "1966")

Get ESPN MLB player box scores

Description

Get ESPN MLB player box scores

Usage

espn_mlb_player_box(game_id)

Arguments

game_id

Game ID

Value

A player boxscore data frame

col_name types description
game_id integer Unique ESPN game/event identifier.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=postseason, 4=off-season).
game_date Date Game date (YYYY-MM-DD).
game_date_time POSIXct Game start date/time (US/Eastern).
stat_group character Statistic side this row reports: 'batting' or 'pitching'.
team_id integer Unique ESPN team identifier.
team_name character Team nickname (e.g. 'Yankees').
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_display_name character Full team display name (e.g. 'New York Yankees').
athlete_id integer Unique ESPN athlete identifier.
athlete_display_name character Athlete display name (full).
athlete_short_name character Athlete short display name.
athlete_position_name character Athlete fielding position (e.g. 'Shortstop', 'Pitcher').
athlete_position_abbreviation character Position abbreviation (e.g. 'SS', 'P').
starter logical TRUE if the player started the game.
bat_order integer Spot in the batting order (1-9; NA if not applicable).
active logical TRUE if the row represents an active record.
h_ab character Hits-for-At-bats line (e.g. '2-4').
ab character At-bats.
r character Runs scored.
h character Hits.
rbi character Runs batted in.
hr character Home runs.
bb character Bases on balls (walks).
k character Strikeouts.
number_p character Pitches seen / thrown.
avg character Batting average.
obp character On-base percentage.
slg character Slugging percentage.
ip character Innings pitched.
er character Earned runs.
pc_st character Pitch count - strikes (e.g. '95-58').
era character Earned run average.
pc character Pitch count.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_player_box(game_id = 401071880))

Get ESPN MLB Athlete Career Stats (Long Format)

Description

Returns career stats for an MLB athlete in long format. Default stat_type = 0L fetches the standard "All Splits" / regular-season view. Pass a vector like c(0L, 1L, 2L) to attempt multiple types and bind them via a stat_type_id column; variants that 404 for that athlete are silently skipped. Stat types: 0 = regular season (default endpoint), 1 = postseason, 2 = career aggregate. Coverage of types 1 and 2 is sparse — many athletes only have type 0 populated.

Usage

espn_mlb_player_career_stats(athlete_id, stat_type = 0L, ...)

Arguments

athlete_id

ESPN athlete identifier.

stat_type

Integer or integer vector of stat-type codes. Default 0L fetches the standard "All Splits" / regular-season view. Pass a vector like c(0L, 1L, 2L) to bind multiple types via a stat_type_id column; non-existent variants are silently skipped.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Athlete Career Stats (Long Format)

Value

A long tibble (one row per stat_type × split × category × stat).

col_name types description
league character League slug.
athlete_id character ESPN athlete id.
stat_type_id character Stat-type code (0 = reg, 1 = post, 2 = career).
split_id character Split id.
split_name character Split name (typically "All Splits").
split_type character Split type code.
category_name character Category key (e.g. "defensive").
category_display character Category display name.
category_short character Category short display.
category_abbrev character Category abbreviation.
stat_name character Stat key.
stat_abbrev character Stat abbreviation.
stat_display character Stat display name.
stat_short character Stat short display.
description character Stat description.
value numeric Stat value.
display_value character Display-formatted value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

# Aaron Judge — regular + postseason combined
  espn_mlb_player_career_stats(athlete_id = 33192)
  # Just career aggregate
  espn_mlb_player_career_stats(athlete_id = 33192, stat_type = 2L)

Get ESPN MLB Athlete Contract (Single Season)

Description

Returns the full contract record for one MLB athlete in one season, including salary, cap-rule flags, option type, Bird status, and trade protections. Backed by sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/athletes/{athlete_id}/contracts/{season}.

Usage

espn_mlb_player_contract(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
athlete_id character ESPN athlete identifier.
season integer Contract season year.
bird_status integer Bird-rights tier (0 = Non, 1 = Early, 2 = Full).
salary numeric Total cap-counting salary for the season ($).
salary_remaining numeric Remaining salary owed.
years_remaining integer Years left on the contract.
incoming_trade_value numeric Trade value if receiving this contract ($).
outgoing_trade_value numeric Trade value if sending out this contract ($).
option_type integer Option type code (e.g. team / player option).
minimum_salary_exception logical Signed under the minimum-salary exception.
trade_restriction logical Whether a trade restriction is active.
unsigned_foreign_pick logical Unsigned-foreign-pick flag.
active logical Whether the contract is currently active.
base_year_compensation_active logical Base-year-compensation rule active.
poison_pill_provision_active logical Poison-pill provision active.
trade_kicker_active logical Trade kicker active.
trade_kicker_percentage numeric Trade kicker percentage of salary.
trade_kicker_value numeric Trade kicker dollar value.
trade_kicker_trade_value numeric Trade kicker post-trade dollar value.
season_ref character ⁠$ref⁠ to the season resource.
team_ref character ⁠$ref⁠ to the team-in-season resource.
team_id character ESPN team id parsed from team_ref.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

# Aaron Judge 2025 contract
  espn_mlb_player_contract(athlete_id = 33192, season = 2025)

Get ESPN MLB Athlete Contracts Index

Description

Returns the index of contract seasons recorded for an MLB athlete from sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/athletes/{athlete_id}/contracts. Each row is one contract year — pass the season to espn_mlb_player_contract() for the full contract record.

Usage

espn_mlb_player_contracts(athlete_id, ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A tibble with one row per contract year.

col_name types description
athlete_id character ESPN athlete identifier.
season integer Contract season year.
ref character Full ⁠$ref⁠ URL for the contract detail.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

# Aaron Judge — athlete id 1966
  espn_mlb_player_contracts(athlete_id = 33192)

ESPN MLB Player / Athlete Endpoint Overview

Description

  • espn_mlb_athletes_index(): Paginated index of MLB athletes.

  • espn_mlb_player_info(): Athlete bio / identity.

  • espn_mlb_player_overview(): Athlete overview (stats, next game, news).

  • espn_mlb_player_gamelog(): Game-by-game log for a season.

  • espn_mlb_player_splits(): Statistical splits.

  • espn_mlb_player_stats(), espn_mlb_player_stats_v3(): Season statistics.

  • espn_mlb_player_career_stats(), espn_mlb_player_seasons(): Career / season history.

  • espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_statisticslog(): Event / statistics logs.

  • espn_mlb_player_contract(), espn_mlb_player_contracts(): Contract data.

  • espn_mlb_player_awards(): Athlete awards.

  • espn_mlb_draft_athletes(), espn_mlb_draft_athlete_detail(): Draft prospects.

Details

ESPN MLB Players

Athlete-level ESPN endpoints across sports.core.api.espn.com and site.web.api.espn.com: identity, overviews, game logs, splits, season / career statistics, contracts, and awards.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()


Get ESPN MLB Athlete Eventlog

Description

Get ESPN MLB Athlete Eventlog

Get ESPN MLB Athlete Eventlog

Usage

espn_mlb_player_eventlog(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single tibble. Per-event statistics.$ref URLs from the ESPN core-v2 API are returned as the character column statistics_ref and are NOT resolved. Similarly, event_ref, competition_ref, and team_ref are returned as character columns.

col_name types description
event_ref character Reference link to the originating event.
competition_ref character
team_ref character
statistics_ref character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_eventlog(athlete_id = "1966", season = 2024)

Get ESPN MLB Athlete Per-Season Event Log (core-v2)

Description

Returns one row per (event x team) for an MLB athlete's appearances in a given season. Distinct from espn_mlb_player_eventlog() which wraps the web-common-v3 gamelog endpoint returning stats per game; this core-v2 variant returns refs + played flag and is era-correct.

Usage

espn_mlb_player_eventlog_v2(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier.

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Value

A tibble with one row per event appearance. See package source for column schema.

col_name types description
league character League.
athlete_id character Unique ESPN athlete identifier.
season integer Season (4-digit year).
event_id character Unique ESPN event/game identifier.
team_id character Unique ESPN team identifier.
played logical Played.
event_ref character Event ref.
competition_ref character Competition ref.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_eventlog_v2(athlete_id = 33192, season = 2025)

Get ESPN MLB Athlete Gamelog

Description

Get ESPN MLB Athlete Gamelog

Get ESPN MLB Athlete Gamelog

Usage

espn_mlb_player_gamelog(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single tibble with one row per game. Column names reflect the stat labels returned by ESPN and will vary by season and player.

col_name types description
id character Identifier.
at_vs character At vs.
game_date character Game date (YYYY-MM-DD).
score character Score.
home_team_id character Unique ESPN team identifier.
away_team_id character Unique ESPN team identifier.
home_team_score character Home team score.
away_team_score character Away team score.
game_result character Game result (W/L).
league_name character League name.
league_abbreviation character League abbreviation.
league_short_name character League short name.
event_note character Event note.
team_id character Unique ESPN team identifier.
team_uid character ESPN universal team identifier (UID).
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_logo character Team logo.
team_is_all_star character Team is all star.
opponent_id character Opponent team identifier.
opponent_uid character ESPN UID.
opponent_display_name character Display name.
opponent_abbreviation character Opponent abbreviation.
opponent_logo character Opponent logo.
event_id character Unique ESPN event/game identifier.
week character Week.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_gamelog(athlete_id = "1966", season = 2024)

Get ESPN MLB Athlete Info

Description

Get ESPN MLB Athlete Info

Get ESPN MLB Athlete Info

Usage

espn_mlb_player_info(athlete_id, ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A named list of data frames: Bio, Team, Position, Status, College, Draft.

Bio

col_name types description
id character Id.
full_name character Player's full name.
display_name character Display name.
jersey character Jersey number worn by the player.
age character Player age (in years).
date_of_birth character Date of birth (YYYY-MM-DD).
headshot_href character Headshot image URL.

Team

col_name types description
id character Id.
abbreviation character Short abbreviation.
display_name character Display name.

Position

col_name types description
id character Id.
name character Display name.
abbreviation character Short abbreviation.

Status

col_name types description
id character Id.
name character Display name.
type character Record type / category.

College

col_name types description
id character Id.
name character Display name.
mascot character Team mascot.

Draft

col_name types description
year character 4-digit year.
round character Tournament / playoff round.
selection character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_info(athlete_id = "1966")

Get ESPN MLB Athlete Overview

Description

Get ESPN MLB Athlete Overview

Get ESPN MLB Athlete Overview

Usage

espn_mlb_player_overview(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A named list of data frames: Statistics, NextGame, Last5Games, Headlines, FantasyOutlook.

Statistics

col_name types description
(varies) character

NextGame

col_name types description
id character Id.
date character Date in YYYY-MM-DD format.
name character Display name.
short_name character Short display name.

Last5Games

col_name types description
(varies) character

Headlines

col_name types description
headline character News headline.
description character Long-form description text.
published character Publication timestamp (ISO 8601).

FantasyOutlook

col_name types description
(varies) character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_overview(athlete_id = "1966", season = 2024)

Get ESPN MLB Athlete Career Seasons

Description

Returns the list of seasons an MLB athlete appeared in. Useful for bounding follow-up calls to per-season endpoints.

Usage

espn_mlb_player_seasons(athlete_id, ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A tibble with one row per career season.

col_name types description
league character League slug.
athlete_id character ESPN athlete id.
season integer Season year.
ref character ⁠$ref⁠ URL to the season detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

# Aaron Judge (33192): 23 career seasons
  espn_mlb_player_seasons(athlete_id = 33192)

Get ESPN MLB Athlete Splits

Description

Get ESPN MLB Athlete Splits

Get ESPN MLB Athlete Splits

Usage

espn_mlb_player_splits(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single long-format tibble. When data are present, columns include at minimum category and split_name, plus per-stat columns driven by ESPN labels.

col_name types description
name character Name.
display_name character Display name.
splits list Splits.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_splits(athlete_id = "1966", season = 2024)

Get ESPN MLB Athlete Statisticslog

Description

Get ESPN MLB Athlete Statisticslog

Get ESPN MLB Athlete Statisticslog

Usage

espn_mlb_player_statisticslog(
  athlete_id,
  season = most_recent_mlb_season(),
  ...
)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single tibble. When resolved, each row corresponds to one statistical entry in the core-v2 statistics log, with event_ref and statistics_ref character columns pointing to resolvable ESPN endpoints.

col_name types description
event_ref character Reference link to the originating event.
statistics_ref character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_statisticslog(athlete_id = "1966", season = 2024)

Get ESPN MLB player stats data

Description

Get ESPN MLB player stats data

Usage

espn_mlb_player_stats(athlete_id, year, season_type = "regular", total = FALSE)

Arguments

athlete_id

Athlete ID

year

Year

season_type

(character, default: regular): Season type - regular or postseason

total

(boolean, default: FALSE): Totals

Value

Returns a tibble with the player stats data

col_name types description
athlete_id integer Unique ESPN athlete identifier.
athlete_uid character Athlete uid.
athlete_guid character Athlete guid.
athlete_type character Athlete type.
sdr integer Sdr.
first_name character First name.
last_name character Last name.
full_name character Full name.
display_name character Display name.
nickname character Team nickname.
short_name character Short display name.
weight numeric Weight.
display_weight character Display weight.
height numeric Height.
display_height character Display height.
age integer Age.
date_of_birth character Date of birth.
debut_year integer Debut year.
slug character Slug.
headshot_href character Headshot href.
headshot_alt character Headshot alt.
jersey character Jersey.
position_id integer Position id.
position_name character Position name.
position_display_name character Position display name.
position_abbreviation character Position abbreviation.
position_leaf logical Position leaf.
positions_x_ref character Positions x ref.
positions_id character Positions id.
positions_name character Positions name.
positions_display_name character Positions display name.
positions_abbreviation character Positions abbreviation.
positions_leaf logical Positions leaf.
positions_x_ref_1 character Positions x ref 1.
positions_x_ref_2 character Positions x ref 2.
positions_x_ref_3 character Positions x ref 3.
positions_id_1 character Positions id 1.
positions_name_1 character Positions name 1.
positions_display_name_1 character Positions display name 1.
positions_abbreviation_1 character Positions abbreviation 1.
positions_leaf_1 logical Positions leaf 1.
positions_x_ref_4 character Positions x ref 4.
positions_x_ref_5 character Positions x ref 5.
positions_x_ref_6 character Positions x ref 6.
positions_id_2 character Positions id 2.
positions_name_2 character Positions name 2.
positions_display_name_2 character Positions display name 2.
positions_abbreviation_2 character Positions abbreviation 2.
positions_leaf_2 logical Positions leaf 2.
positions_x_ref_7 character Positions x ref 7.
positions_x_ref_8 character Positions x ref 8.
positions_x_ref_9 character Positions x ref 9.
positions_id_3 character Positions id 3.
positions_name_3 character Positions name 3.
positions_display_name_3 character Positions display name 3.
positions_abbreviation_3 character Positions abbreviation 3.
positions_leaf_3 logical Positions leaf 3.
positions_x_ref_10 character Positions x ref 10.
positions_x_ref_11 character Positions x ref 11.
linked logical Linked.
...and 216 further ESPN stat columns (full batting / pitching / fielding stat set).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_player_stats(athlete_id = 33192, year = 2022))

Get ESPN MLB Athlete Stats

Description

Get ESPN MLB Athlete Stats

Get ESPN MLB Athlete Stats

Usage

espn_mlb_player_stats_v3(athlete_id, season = most_recent_mlb_season(), ...)

Arguments

athlete_id

ESPN athlete identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A named list of per-category tibbles. Default category names are General, Offensive, Defensive, Rebounding, Shooting, Misc. Actual names are driven by the ESPN response; additional categories may appear. Each tibble has columns depending on the category returned by ESPN.

Note: ESPN's web-v3 athlete-statistics feed is sparsely populated for MLB and frequently returns an empty tibble; use espn_mlb_player_stats() or espn_mlb_player_splits() for season statistics. When populated:

col_name types description
athlete_id character Unique ESPN athlete identifier.
season integer Season (4-digit year).
category character Statistic category (e.g. 'batting', 'pitching').
stat_name character Statistic name.
abbreviation character Statistic abbreviation.
value numeric Numeric statistic value.
display_value character Human-readable statistic value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_player_stats_v3(athlete_id = "1966", season = 2024)

Get ESPN MLB Position Detail

Description

Returns metadata for a single MLB position. Useful for dereferencing position ⁠$ref⁠ URLs embedded in athlete records, and for navigating parent/leaf relationships in the position taxonomy.

Usage

espn_mlb_position(position_id, ...)

Arguments

position_id

ESPN position identifier (character or numeric).

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
position_id character Unique position identifier.
name character Name.
display_name character Display name.
abbreviation character Short abbreviation.
leaf logical TRUE if a leaf position.
parent_ref character Parent ref.
league character League.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_position(position_id = 1)

Get ESPN MLB Positions Index

Description

Returns the MLB position dictionary index. One row per position with its id and the canonical ⁠$ref⁠ URL — pass an id to espn_mlb_position() for full details (display name, abbreviation, leaf flag, parent link).

Usage

espn_mlb_positions(...)

Arguments

...

Additional arguments; currently unused.

Value

A tibble with one row per position.

col_name types description
position_id character Unique position identifier.
ref character Ref.
league character League.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_positions()

Get ESPN MLB Season Power Index (Long Format)

Description

Returns ESPN's power-index and related per-team metrics for one MLB season, in long format: one row per (team x stat). Auto-paginates through all teams. Backed by sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{season}/powerindex. Note: ESPN's power-index feed is sparsely populated for MLB and frequently returns zero items.

Usage

espn_mlb_powerindex(
  season = most_recent_mlb_season(),
  season_type = c(2L, 3L),
  ...
)

Arguments

season

Season year (numeric). Defaults to the most recent MLB season.

season_type

Integer (1=preseason, 2=regular (default), 3=postseason).

...

Additional arguments; currently unused.

Value

A long tibble with one row per (team x stat).

col_name types description
league character League slug ("mlb").
season integer Season year.
season_type integer 1=preseason, 2=regular, 3=postseason.
team_id character ESPN team id (parsed from team_ref).
stat_name character Internal ESPN stat key.
abbreviation character Short stat abbreviation.
display_name character Human-readable stat name.
description character Stat description.
value numeric Stat value.
display_value character Display-formatted value.
last_updated character Last-updated timestamp.
team_ref character ⁠$ref⁠ to the team-in-season resource.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_powerindex(season = 2025)

Get ESPN MLB schedule for a specific year

Description

Get ESPN MLB schedule for a specific year

Usage

espn_mlb_scoreboard(season)

Arguments

season

Either numeric or character (YYYYMMDD)

Value

Returns a tibble with scoreboard data

col_name types description
matchup character Full game matchup name.
matchup_short character Short matchup name.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=postseason, 4=off-season).
season_slug character Season slug.
game_id integer Unique ESPN game/event identifier.
game_uid character ESPN game UID.
game_date Date Game date (YYYY-MM-DD).
attendance integer Game attendance.
play_by_play_available logical TRUE if play-by-play is available.
was_suspended logical Was suspended.
notes logical Notes.
status_name character Game status (e.g. 'STATUS_FINAL').
broadcast_market character Broadcast market ('national'/'home'/'away').
broadcast_name character Broadcast network name.
batting_leader_value numeric Team batting: batting leader value.
batting_leader_stat character Team batting: batting leader stat.
batting_leader_name character Team batting: batting leader name.
batting_leader_shortname character Team batting: batting leader shortname.
batting_leader_headshot character Team batting: batting leader headshot.
batting_leader_team_id character Team batting: batting leader team id.
batting_leader_pos character Team batting: batting leader pos.
home_run_leader_value logical Home run leader value.
home_run_leader_stat logical Home run leader stat.
home_run_leader_name logical Home run leader name.
home_run_leader_shortname logical Home run leader shortname.
home_run_leader_headshot logical Home run leader headshot.
home_run_leader_team_id logical Home run leader team id.
home_run_leader_pos logical Home run leader pos.
rbi_leader_value logical Rbi leader value.
rbi_leader_stat logical Rbi leader stat.
rbi_leader_name logical Rbi leader name.
rbi_leader_shortname logical Rbi leader shortname.
rbi_leader_headshot logical Rbi leader headshot.
rbi_leader_team_id logical Rbi leader team id.
rbi_leader_pos logical Rbi leader pos.
start_date character Start date.
broadcast character Broadcast network.
highlights logical Highlights.
game_date_time POSIXct Game start date/time (US/Eastern).
home_team_name character Home team name.
home_team_logo character Home team logo.
home_team_abb character Home team abb.
home_team_id integer Home team id.
home_team_location character Home team location.
home_team_full_name character Home team full name.
home_team_color character Home team color.
home_score integer Home team run total after the play.
home_win integer Home win.
home_record character Home record.
away_team_name character Away team name.
away_team_logo character Away team logo.
away_team_abb character Away team abb.
away_team_id integer Away team id.
away_team_location character Away team location.
away_team_full_name character Away team full name.
away_team_color character Away team color.
away_score integer Away team run total after the play.
away_win integer Away win.
away_record character Away record.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

# Get schedule from date 2022-11-17 (returns 1000 results, max allowable.)

try(espn_mlb_scoreboard(season = 20230423))

Get ESPN MLB Season Awards Index

Description

Returns the list of award IDs given out in an MLB season from sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{season}/awards. The index only contains IDs and ⁠$ref⁠ URLs — pass an ID to espn_mlb_award() for the award name, description, and winners.

Usage

espn_mlb_season_awards(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A tibble with one row per award.

col_name types description
season integer Season year.
award_id character ESPN award identifier.
ref character Full ⁠$ref⁠ URL for the award detail.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_awards(season = 2024)

Get ESPN MLB Season Draft (Top-Level Metadata)

Description

Returns a single-row tibble with top-level draft-year metadata: year, number of rounds, display name, plus ⁠$ref⁠s for the deeper sub-resources (status, athletes, rounds) already wrapped by espn_mlb_draft_status(), espn_mlb_draft_athletes(), and espn_mlb_draft_rounds().

Usage

espn_mlb_season_draft(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single-row tibble.

Note: ESPN does not currently populate the MLB draft feed, so this typically returns an empty/metadata-only tibble. When populated:

col_name types description
season integer Draft season (4-digit year).
display_name character Draft display name.
status character Draft status (e.g. 'pre', 'complete').

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_draft(season = 2024)

Get ESPN MLB Season Group Detail

Description

Returns metadata for one group (conference or division) in one (MLB season x season-type), plus ⁠$ref⁠ URLs to its parent group, children groups, member teams, and standings.

Usage

espn_mlb_season_group(
  group_id,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

group_id

ESPN group identifier.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season Group Detail

Value

A single-row tibble.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
group_id character ESPN group id.
uid character ESPN UID string.
name character Full name (e.g. "Eastern Conference").
abbreviation character Short code (e.g. "EAST").
short_name character Short name.
midsize_name character Mid-size display name.
is_conference logical Whether this group is a conference.
slug character URL slug.
parent_ref character ⁠$ref⁠ to parent group (if any).
children_ref character ⁠$ref⁠ to child-groups endpoint.
teams_ref character ⁠$ref⁠ to teams-in-group endpoint.
standings_ref character ⁠$ref⁠ to standings endpoint.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_group(group_id = 5, season = 2025)

Get ESPN MLB Season Group Children Index

Description

Returns the list of child groups (e.g. divisions within a conference) for one (MLB season x season-type x parent-group).

Usage

espn_mlb_season_group_children(
  group_id,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

group_id

Parent group identifier.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season Group Children Index

Value

A tibble with one row per child group.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
parent_group_id character Parent group id (queried).
child_group_id character Child group id.
ref character ⁠$ref⁠ to child group detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_group_children(group_id = 5, season = 2025)

Get ESPN MLB Season Group Teams Index

Description

Returns the list of team IDs that belong to one group (conference or division) for one (MLB season x season-type).

Usage

espn_mlb_season_group_teams(
  group_id,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

group_id

ESPN group identifier.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season Group Teams Index

Value

A tibble with one row per team in the group.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
group_id character ESPN group id.
team_id character ESPN team id.
ref character ⁠$ref⁠ URL to the team-in-season entry.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_group_teams(group_id = 5, season = 2025)

Get ESPN MLB Season Groups Index

Description

Returns the list of group IDs (conferences / divisions) for one (MLB season x season-type) via core-v2 ⁠/seasons/{season}/types/{season_type}/groups⁠.

Usage

espn_mlb_season_groups(
  season = most_recent_mlb_season(),
  season_type = c(2L, 3L),
  ...
)

Arguments

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Value

A tibble with one row per group.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
group_id character ESPN group id.
ref character ⁠$ref⁠ URL for the group detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_groups(season = 2025)

Get ESPN MLB Season Info

Description

Get ESPN MLB Season Info

Get ESPN MLB Season Info

Usage

espn_mlb_season_info(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A named list of baseballr_data tibbles: Info, Types, Athletes, Coaches, Teams, Awards. ⁠$ref⁠ URL components are returned as character columns and are NOT auto-resolved – use targeted endpoint functions for details.

Info

col_name types description
year integer 4-digit year.
start_date character Start date (YYYY-MM-DD).
end_date character End date (YYYY-MM-DD).
display_name character Display name.
type_id character Type identifier (numeric).
type_name character

Types / Athletes / Coaches / Teams / Awards

col_name types description
count integer Count of count.
ref character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_info(season = 2025)

Get ESPN MLB Season Leaders (Long Format)

Description

Returns the per-category leaderboard for one (MLB season x season-type), in long format. Each row is one (category x rank) entry, e.g. "Points Per Game x rank 1 x Aaron Judge".

Usage

espn_mlb_season_leaders(
  season = most_recent_mlb_season(),
  season_type = c(2L, 3L),
  ...
)

Arguments

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default), 3 = postseason).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season Leaders (Long Format)

Value

A long tibble with one row per (category x leader).

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
category_name character Internal category key (e.g. "pointsPerGame").
category_display character Human-readable category name.
category_short character Short display name.
category_abbrev character Stat abbreviation (e.g. "PTS").
rank integer Rank within the category (1 = best).
athlete_id character ESPN athlete id.
team_id character ESPN team id.
display_value character Display-formatted value.
value numeric Numeric leader value.
rel character Comma-joined rel tags from ESPN.
athlete_ref character ⁠$ref⁠ URL to the leader's athlete.
team_ref character ⁠$ref⁠ URL to the leader's team.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_leaders(season = 2025)

Get ESPN MLB Season Ranking Detail

Description

Returns the per-week snapshot index for one ranking source (e.g. AP Top 25). Each row is one weekly snapshot; the ref URL resolves to the actual ranked teams for that (season-type x week) and will be wrapped by a forthcoming espn_mlb_week_ranking().

Usage

espn_mlb_season_ranking(ranking_id, season = most_recent_mlb_season(), ...)

Arguments

ranking_id

ESPN ranking identifier (character or numeric).

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season Ranking Detail

Value

A tibble with one row per weekly snapshot.

col_name types description
league character League slug.
season integer Season year.
ranking_id character ESPN ranking id.
name character Ranking name (e.g. "AP Top 25").
short_name character Short name (e.g. "AP Poll").
type character Ranking type code (e.g. "ap").
season_type integer Season-type id of this snapshot.
week integer Week number of this snapshot.
ref character ⁠$ref⁠ URL for the per-week ranking detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_ranking(ranking_id = 1, season = 2025)

Get ESPN MLB Season Rankings Index

Description

Returns the index of season-level rankings recorded for one MLB season. MLB typically returns zero rankings (ranking polls are a college concept); the wrapper is provided for completeness. (College-basketball / football ranking equivalents live in the hoopR / wehoop / cfbfastR packages.)

Usage

espn_mlb_season_rankings(season = most_recent_mlb_season(), ...)

Arguments

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season Rankings Index

Value

A tibble with one row per ranking source.

col_name types description
league character League slug.
season integer Season year.
ranking_id character ESPN ranking id.
ref character ⁠$ref⁠ URL for the ranking detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_rankings(season = 2025)

Get ESPN MLB Season-Type Detail

Description

Returns metadata for one season-type within an MLB season: name, abbreviation, start / end dates, and whether it carries groups, standings, or playoff legs.

Usage

espn_mlb_season_type(season_type = 2L, season = most_recent_mlb_season(), ...)

Arguments

season_type

Season-type id (1 = preseason, 2 = regular (default), 3 = postseason, 4 = off-season).

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season-Type Detail

Value

A single-row tibble.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
type integer Numeric type code.
name character Display name (e.g. "Regular Season").
abbreviation character Short code (e.g. "reg").
year integer Year stamp.
start_date character ISO 8601 start date.
end_date character ISO 8601 end date.
has_groups logical Whether groups exist for this type.
has_standings logical Whether standings exist.
has_legs logical Whether playoff legs exist.
slug character URL slug.
groups_ref character ⁠$ref⁠ to the groups endpoint.
weeks_ref character ⁠$ref⁠ to the weeks endpoint.
leaders_ref character ⁠$ref⁠ to the leaders endpoint.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_type(season_type = 2, season = 2025)

Get ESPN MLB Season Types Index

Description

Returns the index of season-type IDs that exist for one MLB season (typically 1 = preseason, 2 = regular, 3 = postseason, 4 = off-season). Pass an ID to espn_mlb_season_type() for the start/end dates and whether that type carries groups, standings, or legs.

Usage

espn_mlb_season_types(season = most_recent_mlb_season(), ...)

Arguments

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A tibble with one row per season type.

col_name types description
league character League slug ("mlb").
season integer Season year.
season_type integer Season-type id (1/2/3/4).
ref character ⁠$ref⁠ URL for the type detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_types(season = 2025)

Get ESPN MLB Season-Week Detail

Description

Returns metadata for one week (number, start / end dates, text label, and ⁠$ref⁠ to the per-week rankings endpoint).

Usage

espn_mlb_season_week(
  week,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

week

Week number.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Season-Week Detail

Value

A single-row tibble.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
week integer Week number.
text character Display label (e.g. "Week 5").
start_date character ISO 8601 week start.
end_date character ISO 8601 week end.
rankings_ref character ⁠$ref⁠ to the per-week rankings endpoint.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_week(week = 5, season = 2025)

Get ESPN MLB Season Weeks Index

Description

Returns the list of week IDs for one (MLB season x season-type). MLB uses a week structure inherited from ESPN's schema, but week-level rankings are populated only for college sports, not MLB.

Usage

espn_mlb_season_weeks(
  season = most_recent_mlb_season(),
  season_type = c(2L, 3L),
  ...
)

Arguments

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default), 3 = postseason).

...

Additional arguments; currently unused.

Value

A tibble with one row per week.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
week integer Week number (1-based).
ref character ⁠$ref⁠ URL for the week detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_season_weeks(season = 2025)

Get ESPN MLB Seasons

Description

Get ESPN MLB Seasons

Get ESPN MLB Seasons

Usage

espn_mlb_seasons(...)

Arguments

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A single baseballr_data tibble with one row per season.

col_name types description
season integer Season identifier (4-digit year or 'YYYY-YY' string).
start_date character Start date (YYYY-MM-DD).
end_date character End date (YYYY-MM-DD).
display_name character Display name.
season_type_count integer

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_seasons()

Get ESPN MLB's Standings

Description

Get ESPN MLB's Standings

Usage

espn_mlb_standings(year)

Arguments

year

Either numeric or character (YYYY)

Value

A standings data frame

col_name types description
team_id integer Unique ESPN team identifier.
team character Team.
otlosses character Otlosses.
otwins character Otwins.
avgpointsagainst numeric Avgpointsagainst.
avgpointsfor numeric Avgpointsfor.
clincher numeric Clincher.
differential numeric Differential.
divisionwinpercent numeric Divisionwinpercent.
gamesbehind numeric Gamesbehind.
gamesplayed character Gamesplayed.
leaguewinpercent numeric Leaguewinpercent.
losses numeric Losses.
playoffseed numeric Playoffseed.
pointdifferential character Pointdifferential.
points character Points.
pointsagainst character Pointsagainst.
pointsfor character Pointsfor.
streak numeric Streak.
ties character Ties.
winpercent numeric Winpercent.
wins numeric Wins.
divisiongamesbehind character Divisiongamesbehind.
divisionpercent character Divisionpercent.
divisiontied character Divisiontied.
homelosses character Homelosses.
hometies character Hometies.
homewins character Homewins.
magicnumberdivision character Magicnumberdivision.
magicnumberwildcard character Magicnumberwildcard.
playoffpercent character Playoffpercent.
roadlosses character Roadlosses.
roadties character Roadties.
roadwins character Roadwins.
wildcardpercent character Wildcardpercent.
total character Total.
home character Home.
road character Road.
intradivision character Intradivision.
intraleague character Intraleague.
lasttengames character Lasttengames.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_standings(year = 2021))

Get ESPN MLB Team Detail

Description

Get ESPN MLB Team Detail

Get ESPN MLB Team Detail

Usage

espn_mlb_team(team_id, season = most_recent_mlb_season(), ...)

Arguments

team_id

ESPN team identifier (character or numeric).

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A named list of data frames: Info, Record, NextEvent, StandingSummary, Coaches.

Info

col_name types description
id character Id.
uid character ESPN UID string (universal identifier).
slug character URL-safe identifier.
abbreviation character Short abbreviation.
display_name character Display name.
short_display_name character Short display name.
name character Display name.
nickname character Team or athlete nickname.
location character Location.
color character Primary color (hex without leading '#').
alternate_color character Alternate color (hex without leading '#').
logo character Team or league logo URL.

Record

col_name types description
type character Record type / category.
summary character
stats list

NextEvent

col_name types description
id character Id.
date character Date in YYYY-MM-DD format.
name character Display name.
short_name character Short display name.

StandingSummary

col_name types description
standing_summary character

Coaches

col_name types description
id character Id.
first_name character Player's first name.
last_name character Player's last name.
experience integer Years of professional experience.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team(team_id = "13", season = 2025)

Get ESPN MLB team box scores

Description

Get ESPN MLB team box scores

Usage

espn_mlb_team_box(game_id)

Arguments

game_id

Game ID

Value

A team boxscore data frame

col_name types description
game_id integer Unique ESPN game/event identifier.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=postseason, 4=off-season).
game_date Date Game date (YYYY-MM-DD).
game_date_time POSIXct Game start date/time (US/Eastern).
team_id integer Unique ESPN team identifier.
team_uid character ESPN universal team identifier (UID).
team_slug character URL-safe team identifier.
team_location character Team city / location.
team_name character Team nickname (e.g. 'Yankees').
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_display_name character Full team display name (e.g. 'New York Yankees').
team_short_display_name character Short team display name.
team_color character Team primary color (hex, no leading '#').
team_alternate_color character Team alternate color (hex).
team_logo character Team logo image URL.
batting_games_played character Team batting: batting games played.
batting_team_games_played character Team batting: batting team games played.
batting_hit_by_pitch character Team batting: batting hit by pitch.
batting_ground_balls character Team batting: batting ground balls.
batting_strikeouts character Team batting: batting strikeouts.
batting_rb_is character Team batting: batting rb is.
batting_sac_hits character Team batting: batting sac hits.
batting_hits character Team batting: batting hits.
batting_stolen_bases character Team batting: batting stolen bases.
batting_walks character Team batting: batting walks.
batting_catcher_interference character Team batting: batting catcher interference.
batting_runs character Team batting: batting runs.
batting_gid_ps character Team batting: batting gid ps.
batting_sac_flies character Team batting: batting sac flies.
batting_at_bats character Team batting: batting at bats.
batting_home_runs character Team batting: batting home runs.
batting_grand_slam_home_runs character Team batting: batting grand slam home runs.
batting_runners_left_on_base character Team batting: batting runners left on base.
batting_triples character Team batting: batting triples.
batting_game_winning_rb_is character Team batting: batting game winning rb is.
batting_intentional_walks character Team batting: batting intentional walks.
batting_doubles character Team batting: batting doubles.
batting_fly_balls character Team batting: batting fly balls.
batting_caught_stealing character Team batting: batting caught stealing.
batting_pitches character Team batting: batting pitches.
batting_games_started character Team batting: batting games started.
batting_pinch_at_bats character Team batting: batting pinch at bats.
batting_pinch_hits character Team batting: batting pinch hits.
batting_player_rating character Team batting: batting player rating.
batting_is_qualified character Team batting: batting is qualified.
batting_is_qualified_steals character Team batting: batting is qualified steals.
batting_total_bases character Team batting: batting total bases.
batting_plate_appearances character Team batting: batting plate appearances.
batting_projected_home_runs character Team batting: batting projected home runs.
batting_extra_base_hits character Team batting: batting extra base hits.
batting_runs_created character Team batting: batting runs created.
batting_avg character Team batting: batting average.
batting_pinch_avg character Team batting: batting pinch avg.
batting_slug_avg character Team batting: batting slug avg.
batting_secondary_avg character Team batting: batting secondary avg.
batting_on_base_pct character Team batting: batting on base pct.
batting_ops character Team batting: batting ops.
batting_ground_to_fly_ratio character Team batting: batting ground to fly ratio.
batting_runs_created_per27outs character Team batting: batting runs created per27outs.
batting_batter_rating character Team batting: batting batter rating.
batting_at_bats_per_home_run character Team batting: batting at bats per home run.
batting_stolen_base_pct character Team batting: batting stolen base pct.
batting_pitches_per_plate_appearance character Team batting: batting pitches per plate appearance.
batting_isolated_power character Team batting: batting isolated power.
batting_walk_to_strikeout_ratio character Team batting: batting walk to strikeout ratio.
batting_walks_per_plate_appearance character Team batting: batting walks per plate appearance.
batting_secondary_avg_minus_ba character Team batting: batting secondary avg minus ba.
batting_runs_produced character Team batting: batting runs produced.
batting_runs_ratio character Team batting: batting runs ratio.
...and 128 further ESPN stat columns (full batting / pitching / fielding stat set).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_team_box(game_id = 401071880))

Get ESPN MLB current team roster

Description

Get ESPN MLB current team roster

Usage

espn_mlb_team_current_roster(team_id)

Arguments

team_id

Either numeric or character (YYYY)

Value

A teams data frame

col_name types description
team_id integer Unique ESPN team identifier.
team_uid character ESPN universal team identifier (UID).
team_slug character URL-safe team identifier.
team_location character Team city / location.
team_name character Team nickname (e.g. 'Yankees').
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_display_name character Full team display name (e.g. 'New York Yankees').
team_short_name character Team short name.
team_color character Team primary color (hex, no leading '#').
team_alternate_color character Team alternate color (hex).
team_is_active logical Team is active.
franchise..ref character Franchise..ref.
franchise.id character Franchise.id.
franchise.uid character Franchise.uid.
franchise.slug character Franchise.slug.
franchise.location character Franchise.location.
franchise.name character Franchise.name.
franchise.abbreviation character Franchise.abbreviation.
franchise.displayName character Franchise.displayName.
franchise.shortDisplayName character Franchise.shortDisplayName.
franchise.color character Franchise.color.
franchise.isActive logical Franchise.isActive.
franchise.venue..ref character Franchise.venue..ref.
franchise.venue.id character Franchise.venue.id.
franchise.venue.fullName character Franchise.venue.fullName.
franchise.venue.shortName character Franchise.venue.shortName.
franchise.venue.address.city character Franchise.venue.address.city.
franchise.venue.address.state character Franchise.venue.address.state.
franchise.venue.address.zipCode character Franchise.venue.address.zipCode.
franchise.venue.grass logical Franchise.venue.grass.
franchise.venue.indoor logical Franchise.venue.indoor.
franchise.venue.images.href character Franchise.venue.images.href.
franchise.venue.images.width integer Franchise.venue.images.width.
franchise.venue.images.height integer Franchise.venue.images.height.
franchise.venue.images.alt character Franchise.venue.images.alt.
franchise.venue.images.rel list Franchise.venue.images.rel.
franchise..ref.1 character Franchise..ref.1.
franchise..ref.2 character Franchise..ref.2.
standingSummary character StandingSummary.
logo character Logo image URL.
logo_dark character Dark-mode logo image URL.
group_id integer Group id.
parent_group_id integer Parent group id.
group_is_conference logical Group is conference.
conference_id integer Conference id.
athlete_id integer Unique ESPN athlete identifier.
athlete_uid character Athlete uid.
athlete_guid character Athlete guid.
athlete_type character Athlete type.
athlete_first_name character Athlete first name.
athlete_last_name character Athlete last name.
athlete_full_name character Athlete full name.
athlete_display_name character Athlete display name (full).
athlete_short_name character Athlete short display name.
athlete_weight integer Athlete weight.
athlete_display_weight character Athlete display weight.
athlete_height integer Athlete height.
athlete_display_height character Athlete display height.
athlete_age integer Athlete age.
athlete_date_of_birth character Athlete date of birth.
athlete_slug character Athlete slug.
athlete_jersey character Athlete jersey.
athlete_linked logical Athlete linked.
athlete_active logical Athlete active.
athlete_positions list Athlete positions.
athlete_hot_zones list Athlete hot zones.
athlete_debut_year integer Athlete debut year.
athlete_nickname character Athlete nickname.
athlete_middle_name character Athlete middle name.
athlete_citizenship character Athlete citizenship.
athlete_alternate_ids_sdr character Athlete alternate ids sdr.
athlete_birth_place_city character Athlete birth place city.
athlete_birth_place_state character Athlete birth place state.
athlete_birth_place_country character Athlete birth place country.
athlete_position_id character Athlete position id.
athlete_position_name character Athlete fielding position (e.g. 'Shortstop', 'Pitcher').
athlete_position_display_name character Athlete position display name.
athlete_position_abbreviation character Position abbreviation (e.g. 'SS', 'P').
athlete_position_leaf logical Athlete position leaf.
athlete_experience_years integer Athlete experience years.
athlete_debut_year_2 integer Athlete debut year 2.
athlete_status_id character Athlete status id.
athlete_status_name character Athlete status name.
athlete_status_type character Athlete status type.
athlete_status_abbreviation character Athlete status abbreviation.
athlete_bats_type character Athlete bats type.
athlete_bats_abbreviation character Athlete bats abbreviation.
athlete_bats_display_value character Athlete bats display value.
athlete_throws_type character Athlete throws type.
athlete_throws_abbreviation character Athlete throws abbreviation.
athlete_throws_display_value character Athlete throws display value.
athlete_headshot_href character Athlete headshot href.
athlete_draft_display_text character Athlete draft display text.
athlete_draft_round integer Athlete draft round.
athlete_draft_year integer Athlete draft year.
athlete_draft_selection integer Athlete draft selection.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_team_current_roster(team_id = 13))

Get ESPN MLB Team Depth Chart (Long Format)

Description

Returns the team's depth chart in long format, one row per (position × rank × athlete). MLB-only at ESPN's core-v2.

Usage

espn_mlb_team_depthchart(team_id, season = most_recent_mlb_season(), ...)

Arguments

team_id

ESPN team identifier.

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Team Depth Chart (Long Format)

Value

A long tibble with one row per athlete depth entry.

col_name types description
league character League slug.
team_id character ESPN team id.
season integer Season year.
depthchart_id character Depth chart id (typically "1").
depthchart_name character Depth chart name.
position character Position code (pg/sg/sf/pf/c).
rank integer Depth rank (1 = starter).
athlete_id character ESPN athlete id.
athlete_ref character ⁠$ref⁠ URL to athlete-in-season.
position_ref character ⁠$ref⁠ URL to position resource.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_depthchart(team_id = 13, season = 2025)

ESPN MLB Team Endpoint Overview

Description

  • espn_mlb_teams(), espn_mlb_team(): Team list and single-team detail.

  • espn_mlb_team_roster(), espn_mlb_team_current_roster(): Team rosters.

  • espn_mlb_team_schedule(): Team schedule.

  • espn_mlb_team_stats(), espn_mlb_team_season_statistics(): Team statistics.

  • espn_mlb_team_record(), espn_mlb_team_record_detail(): Team records.

  • espn_mlb_team_leaders(): Team statistical leaders.

  • espn_mlb_team_injuries(), espn_mlb_team_news(): Team injuries and news.

  • espn_mlb_team_depthchart(): Team depth chart.

  • espn_mlb_standings(): League standings.

  • espn_mlb_leaders(): League-wide statistical leaders.

Details

ESPN MLB Teams

Team- and league-level ESPN endpoints: team lists and detail, rosters, schedules, statistics, records, leaders, injuries, news, and standings.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()


Get ESPN MLB Team Injuries

Description

Get ESPN MLB Team Injuries

Get ESPN MLB Team Injuries

Usage

espn_mlb_team_injuries(team_id, ...)

Arguments

team_id

ESPN team identifier (character or numeric; passed as-is). Use espn_mlb_teams() to look up team IDs. Example: "17" (Las Vegas Aces).

...

Currently unused; reserved for future argument threading.

Value

Returns a tibble of injury records for the specified MLB team. Returns an empty tibble (zero rows) when the team has no reported injuries.

Injuries

col_name types description
team_id character Unique team identifier.
athlete_id character Unique athlete identifier (ESPN).
athlete_name character Athlete display name (ESPN).
position character Listed roster position (G, F, C, etc.).
status character Status label.
date character Date in YYYY-MM-DD format.
type character Record type / category.
side character Side label (e.g. 'home', 'away', or 'overUnder').
returns_at character
short_comment character
long_comment character Long-form play / event comment.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_injuries(team_id = "13")

Get ESPN MLB Team Leaders

Description

Get ESPN MLB Team Leaders

Get ESPN MLB Team Leaders

Usage

espn_mlb_team_leaders(team_id, season = most_recent_mlb_season(), ...)

Arguments

team_id

ESPN team identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single long-format tibble (one row per category-rank-athlete).

col_name types description
team_id character Unique team identifier.
season integer Season identifier (4-digit year or 'YYYY-YY' string).
category character Category label.
display_name character Display name.
athlete_id character Unique athlete identifier (ESPN).
athlete_name character Athlete display name (ESPN).
value numeric Numeric or string value field.
rank integer Rank.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_leaders(team_id = "13", season = 2025)

Get ESPN MLB Team News

Description

Get ESPN MLB Team News

Get ESPN MLB Team News

Usage

espn_mlb_team_news(team_id, limit = 25)

Arguments

team_id

character or integer. ESPN team ID (e.g. 17 for New York Yankees).

limit

integer. Maximum number of articles to return. Default 25.

Details

Retrieve ESPN MLB news for a specific team. Uses getOption("baseballr.proxy") or http_proxy/https_proxy environment variables for proxy configuration (per-call proxy override is not supported for ESPN wrappers).

Value

Returns a tibble of team news articles.

col_name types description
id character Id.
type character Record type / category.
headline character News headline.
description character Long-form description text.
published character Publication timestamp (ISO 8601).
premium logical
byline character News article byline / author.
link_web character Web link / URL.
league_id character ESPN league identifier.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_news(team_id = "13", limit = 5)

Get ESPN MLB Team Odds-Records (Long Format)

Description

Returns the long-format odds-records breakdown for a team in one season. Each row is one (category × stat) — typical categories include Money Line Overall, Money Line Home, Money Line Road, Against The Spread Overall, Over/Under, etc. ESPN's coverage of this endpoint is sparse; many (team × season-type) combinations return 404, in which case the wrapper returns an empty tibble.

Usage

espn_mlb_team_odds_records(
  team_id,
  season = most_recent_mlb_season(),
  season_type = 0L,
  ...
)

Arguments

team_id

ESPN team identifier.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id. ESPN populates odds-records mostly under season_type = 0 (all-types aggregate), so that is the default.

...

Additional arguments; currently unused.

Value

A long tibble with one row per (category × stat).

col_name types description
league character League slug.
team_id character ESPN team identifier.
season integer Season year.
season_type integer Season-type id.
category_type character Category type code (e.g. "moneyLineOverall").
category_abbrev character Category abbreviation (e.g. "ML").
category_short character Short display.
category_display character Full category name.
stat_type character Stat type code (e.g. "win", "loss").
stat_abbrev character Stat abbreviation (e.g. "W", "L").
stat_display character Stat display name.
value numeric Numeric stat value.
display_value character Display-formatted value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_odds_records(team_id = 13, season = 2026)

Get ESPN MLB Team Record (Per Season Type)

Description

Returns the long-format record breakdown for an MLB team in one season and season-type. Each row is one record type (Overall, Home, Road, vs Conference, vs Division, etc.). Backed by sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{season}/types/{season_type}/teams/{team_id}/record.

Usage

espn_mlb_team_record(
  team_id,
  season = most_recent_mlb_season(),
  season_type = c(2L, 3L),
  ...
)

Arguments

team_id

ESPN team identifier.

season

Season year (numeric). Defaults to most recent MLB season.

season_type

Integer (2 = regular season default; 3 = postseason).

...

Additional arguments; currently unused.

Value

A tibble with one row per record category.

col_name types description
league character League slug ("mlb").
team_id character ESPN team identifier.
season integer Season year.
season_type integer Season type (1/2/3).
record_id character Record sub-id.
name character Internal record name (e.g. "overall").
abbreviation character Abbreviation (e.g. "Total").
display_name character Display name (e.g. "Overall").
short_display_name character Short display (e.g. "OVER").
description character Description (e.g. "Overall Record").
type character Record type code (total, home, ...).
summary character W-L summary (e.g. "50-32").
display_value character Same as summary in most cases.
value numeric Win percentage (0-1).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_record(team_id = 13, season = 2025)

Get ESPN MLB Team Record Detail (Long Format)

Description

Returns one team's record detail in long format: one row per stat in the record's stats[] array. Use espn_mlb_team_record() to enumerate available record_id values per team-season (overall / home / away / conference + per-opponent breakdowns).

Usage

espn_mlb_team_record_detail(team_id, season, record_id, season_type = 2L, ...)

Arguments

team_id

ESPN team identifier.

season

Season year (numeric).

record_id

Record identifier (from espn_mlb_team_record() index).

season_type

Integer season type: 1 = preseason, 2 = regular (default), 3 = postseason.

...

Additional arguments; currently unused.

Value

A long tibble.

col_name types description
league character League.
team_id character Unique ESPN team identifier.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=post).
record_id character Record id.
record_name character Record name.
record_abbrev character Record abbrev.
record_display character Record display.
record_type character Record type id.
record_summary character Record summary.
stat_name character Statistic name.
stat_abbrev character Stat abbrev.
stat_display character Stat display.
value numeric Numeric value.
stat_display_value character Statistic display value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_record_detail(team_id = 13, season = 2024, record_id = 0)

Get ESPN MLB Team Roster

Description

Get ESPN MLB Team Roster

Get ESPN MLB Team Roster

Usage

espn_mlb_team_roster(team_id, season = most_recent_mlb_season(), ...)

Arguments

team_id

ESPN team identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single tibble with one row per athlete.

col_name types description
athlete_id character Unique athlete identifier (ESPN).
full_name character Player's full name.
jersey character Jersey number worn by the player.
position_abbrev character
position_name character Listed roster position (e.g. 'Pitcher', 'Shortstop', 'Catcher').
height character Player height (string e.g. '6-2' or inches).
weight character Player weight in pounds.
age character Player age (in years).
birth_date character Date of birth (YYYY-MM-DD).
birth_place character Place of birth.
headshot character Headshot image URL.
link_web character Web link / URL.
status character Status label.
team_id character Unique team identifier.
season integer Season identifier (4-digit year or 'YYYY-YY' string).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_roster(team_id = "13", season = 2025)

Get ESPN MLB Team Schedule

Description

Get ESPN MLB Team Schedule

Get ESPN MLB Team Schedule

Usage

espn_mlb_team_schedule(
  team_id,
  season = most_recent_mlb_season(),
  season_type = 2,
  ...
)

Arguments

team_id

ESPN team identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

season_type

Integer season type: 1 = preseason, 2 = regular (default), 3 = postseason.

...

Additional arguments; currently unused.

Value

A single tibble with one row per event.

col_name types description
event_id character Unique event / game identifier (ESPN).
season integer Season identifier (4-digit year or 'YYYY-YY' string).
season_type integer Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN).
week integer Week number within the season.
date character Date in YYYY-MM-DD format.
name character Display name.
short_name character Short display name.
opponent_id character Unique identifier for opponent.
opponent_abbrev character Abbreviation for opponent.
home_away character Game venue label ('home' or 'away').
neutral_site logical Neutral site.
conference_competition logical Conference competition.
venue_id character Unique venue identifier.
venue_name character Venue name.
venue_city character Venue city.
venue_state character Venue state / region.
broadcast character Broadcast information string.
result character Result.
team_score character Team's score / final score.
opponent_score character Opponent score.
winner logical Winner.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_schedule(team_id = "13", season = 2025)

Get ESPN MLB Team-in-Season Profile

Description

Era-correct team identity for an MLB franchise in a specific season, plus the available ⁠$ref⁠ URLs for deeper resources (record, statistics, leaders, coaches, etc.). Backed by the core-v2 endpoint sports.core.api.espn.com/v2/sports/baseball/leagues/mlb/seasons/{season}/teams/{team_id}.

Historical depth goes back to 1947 (MLB founding). Older seasons return fewer ⁠$ref⁠ keys; missing refs become NA.

Usage

espn_mlb_team_season_profile(team_id, season = most_recent_mlb_season(), ...)

Arguments

team_id

ESPN team identifier (character or numeric).

season

Season year (numeric). Defaults to the most recent MLB season.

...

Additional arguments; currently unused.

Value

A single-row tibble with team identity scalars and ⁠_ref⁠ URL columns. Selected columns:

col_name types description
id character ESPN team identifier.
guid character Stable cross-league team GUID.
uid character ESPN UID string.
slug character URL-safe identifier.
location character Team city/region (e.g. "Los Angeles").
name character Team name (e.g. "Yankees").
abbreviation character Short abbreviation (e.g. "LAL").
display_name character Full display name.
short_display_name character Short display name.
color character Primary color (hex, no leading '#').
alternate_color character Alternate color (hex, no leading '#').
is_active logical Whether the team was active in this season.
season integer Season year.
logo character Primary logo URL.
logo_dark character Dark-mode logo URL.
record_ref character ⁠$ref⁠ to team record resource (if present).
statistics_ref character ⁠$ref⁠ to team statistics resource (if present).
leaders_ref character ⁠$ref⁠ to team leaders resource (if present).
coaches_ref character ⁠$ref⁠ to team coaches resource (if present).
depth_charts_ref character ⁠$ref⁠ to depth chart resource (MLB-only).
events_ref character ⁠$ref⁠ to team events resource (if present).
transactions_ref character ⁠$ref⁠ to team transactions resource (if present).
franchise_ref character ⁠$ref⁠ to franchise resource.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_season_profile(team_id = "13", season = 2025)

Get ESPN MLB Team Roster (Per-Season, core-v2)

Description

Returns the per-season team roster as a tibble of athlete IDs from seasons/{y}/teams/{id}/athletes. Distinct from espn_mlb_team_roster() which targets a site-v2 endpoint optimized for the current season; this core-v2 variant is era-correct and available back to ESPN's earliest season for each league.

Usage

espn_mlb_team_season_roster(team_id, season = most_recent_mlb_season(), ...)

Arguments

team_id

ESPN team identifier.

season

Season year. Defaults to most recent MLB season.

...

Additional arguments; currently unused.

Details

Get ESPN MLB Team Roster (Per-Season, core-v2)

Value

A tibble with one row per athlete on the season roster.

col_name types description
league character League slug.
team_id character ESPN team id.
season integer Season year.
athlete_id character ESPN athlete id.
ref character ⁠$ref⁠ URL to athlete-in-season detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_season_roster(team_id = 13, season = 2025)

Get ESPN MLB Team Season Statistics (Long Format with Rank)

Description

Returns the full team-season-type statistics sheet for one MLB team in long format: one row per (category x stat). Each row carries the team's league rank for that stat where ESPN provides it (rank + rank_display_value). Complements espn_mlb_team_record() (W-L only) with the full stat package.

Usage

espn_mlb_team_season_statistics(
  team_id,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

team_id

ESPN team identifier.

season

Season year (numeric). Defaults to the most recent MLB season.

season_type

Integer season type: 1 = preseason, 2 = regular (default), 3 = postseason.

...

Additional arguments; currently unused.

Value

A long tibble with one row per (category x stat).

col_name types description
league character League.
season integer Season (4-digit year).
season_type integer ESPN season type (1=pre, 2=regular, 3=post).
team_id character Unique ESPN team identifier.
category_name character Statistic category name.
category_display character Category display.
stat_name character Statistic name.
stat_abbrev character Stat abbrev.
stat_display character Stat display.
value numeric Numeric value.
display_value character Human-readable value.
rank integer Rank within the result set.
rank_display_value character Rank display value.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_team_season_statistics(team_id = 13, season = 2024)

Get ESPN MLB team stats data

Description

Get ESPN MLB team stats data

Usage

espn_mlb_team_stats(team_id, year, season_type = "regular", total = FALSE)

Arguments

team_id

Team ID

year

Year

season_type

(character, default: regular): Season type - regular or postseason

total

(boolean, default: FALSE): Totals

Value

Returns a tibble with the team stats data

col_name types description
team_id integer Unique ESPN team identifier.
team_guid character ESPN team GUID.
team_uid character ESPN universal team identifier (UID).
team_sdr character Team sdr.
team_slug character URL-safe team identifier.
team_location character Team city / location.
team_name character Team nickname (e.g. 'Yankees').
team_abbreviation character Short team abbreviation (e.g. 'NYY').
team_display_name character Full team display name (e.g. 'New York Yankees').
team_short_display_name character Short team display name.
team_color character Team primary color (hex, no leading '#').
team_alternate_color character Team alternate color (hex).
team_is_active logical Team is active.
is_all_star logical Is all star.
logo_href character Logo href.
logo_dark_href character Logo dark href.
logos_href_2 character Logos href 2.
logos_href_3 character Logos href 3.
logos_href_4 character Logos href 4.
logos_width_4 integer Logos width 4.
logos_height_4 integer Logos height 4.
logos_alt_4 character Logos alt 4.
logos_rel_full_4 character Logos rel full 4.
logos_rel_primary_logo_on_white_color character Logos rel primary logo on white color.
logos_last_updated_4 character Logos last updated 4.
logos_href_5 character Logos href 5.
logos_width_5 integer Logos width 5.
logos_height_5 integer Logos height 5.
logos_alt_5 character Logos alt 5.
logos_rel_full_5 character Logos rel full 5.
logos_rel_primary_logo_on_black_color character Logos rel primary logo on black color.
logos_last_updated_5 character Logos last updated 5.
logos_href_6 character Logos href 6.
logos_width_6 integer Logos width 6.
logos_height_6 integer Logos height 6.
logos_alt_6 character Logos alt 6.
logos_rel_full_6 character Logos rel full 6.
logos_rel_primary_logo_on_primary_color character Logos rel primary logo on primary color.
logos_last_updated_6 character Logos last updated 6.
logos_href_7 character Logos href 7.
logos_width_7 integer Logos width 7.
logos_height_7 integer Logos height 7.
logos_alt_7 character Logos alt 7.
logos_rel_full_7 character Logos rel full 7.
logos_rel_primary_logo_on_secondary_color character Logos rel primary logo on secondary color.
logos_last_updated_7 character Logos last updated 7.
logos_href_8 character Logos href 8.
logos_width_8 integer Logos width 8.
logos_height_8 integer Logos height 8.
logos_alt_8 character Logos alt 8.
logos_rel_full_8 character Logos rel full 8.
logos_rel_primary_logo_black character Logos rel primary logo black.
logos_last_updated_8 character Logos last updated 8.
logos_href_9 character Logos href 9.
logos_width_9 integer Logos width 9.
logos_height_9 integer Logos height 9.
logos_alt_9 character Logos alt 9.
logos_rel_full_9 character Logos rel full 9.
logos_rel_primary_logo_white character Logos rel primary logo white.
logos_last_updated_9 character Logos last updated 9.
...and 212 further ESPN stat columns (full batting / pitching / fielding stat set).

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_team_stats(team_id = 13, year = 2020))

Get ESPN MLB team names and IDs

Description

Get ESPN MLB team names and IDs

Usage

espn_mlb_teams()

Value

A teams data frame

col_name types description
abbreviation character Short abbreviation.
alternate_color character Alternate color (hex).
color character Primary color (hex).
display_name character Display name.
team_id integer Unique ESPN team identifier.
team character Team.
logo character Logo image URL.
logo_dark character Dark-mode logo image URL.
logos_href_3 character Logos href 3.
logos_href_4 character Logos href 4.
logos_href_5 character Logos href 5.
logos_href_6 character Logos href 6.
logos_href_7 character Logos href 7.
logos_href_8 character Logos href 8.
logos_href_9 character Logos href 9.
logos_href_10 character Logos href 10.
logos_href_11 character Logos href 11.
logos_href_12 character Logos href 12.
logos_href_13 character Logos href 13.
logos_href_14 character Logos href 14.
logos_href_15 character Logos href 15.
logos_href_16 character Logos href 16.
mascot character Team mascot.
nickname character Team nickname.
short_name character Short display name.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

try(espn_mlb_teams())

Get ESPN MLB Tournament Detail

Description

Returns metadata for a single tournament plus the ⁠$ref⁠ URL for the tournament's seasons list. Use espn_mlb_tournament_seasons() to resolve the seasons.

Usage

espn_mlb_tournament(tournament_id, ...)

Arguments

tournament_id

ESPN tournament identifier.

...

Additional arguments; currently unused.

Value

A single-row tibble.

col_name types description
tournament_id character ESPN tournament identifier.
display_name character Human-readable tournament name.
seasons_ref character ⁠$ref⁠ to the seasons-list endpoint.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_tournament(tournament_id = 1)

Get ESPN MLB Tournament Season Detail

Description

Returns single-row detail for one (tournament, season) pair: id, display name, number of rounds, and ⁠$ref⁠s to the season + bracketology resources. Use espn_mlb_tournament_seasons() to enumerate valid (tournament_id, season) pairs.

Usage

espn_mlb_tournament_season(tournament_id, season, ...)

Arguments

tournament_id

ESPN tournament identifier.

season

Season year (numeric).

...

Additional arguments; currently unused.

Value

A single-row tibble.

Note: MLB has no tournament structure at ESPN, so this returns an empty tibble (the wrapper exists for cross-sport API symmetry). When populated (other sports), the columns are:

col_name types description
tournament_id character Unique ESPN tournament identifier.
season integer Season (4-digit year).
name character Tournament name.
display_name character Tournament display name.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_tournament_season(tournament_id = 1, season = 2024)

Get ESPN MLB Tournament Seasons List

Description

Returns the seasons in which a given MLB tournament was held.

Usage

espn_mlb_tournament_seasons(tournament_id, ...)

Arguments

tournament_id

ESPN tournament identifier.

...

Additional arguments; currently unused.

Value

A tibble with one row per season.

col_name types description
league character League slug ("mlb").
tournament_id character ESPN tournament identifier.
season integer Season year.
ref character Full ⁠$ref⁠ URL for that season.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_tournament_seasons(tournament_id = 1)

Get ESPN MLB Tournaments Index

Description

Returns the index of MLB-branded tournaments tracked by ESPN (e.g. the in-season tournament). Each row is one tournament with its ID and the ⁠$ref⁠ URL.

Usage

espn_mlb_tournaments(...)

Arguments

...

Additional arguments; currently unused.

Value

A tibble with one row per tournament.

col_name types description
tournament_id character ESPN tournament identifier.
ref character Full ⁠$ref⁠ URL for the detail.
league character League slug ("mlb").

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_tournaments()

Get ESPN MLB Transactions

Description

Get ESPN MLB Transactions

Get ESPN MLB Transactions

Usage

espn_mlb_transactions(season = most_recent_mlb_season(), limit = 100, ...)

Arguments

season

Season year (numeric, e.g. 2025). Defaults to the most recent MLB season.

limit

Maximum number of transactions to return (integer). Default 100.

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...).

Details

Calls the ESPN site-v2 endpoint ⁠https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/transactions?season={year}&limit={limit}⁠. Releases have a NULL to_team_id; those are stored as NA. Returns an empty tibble rather than erroring when no transactions are available.

Value

A baseballr_data tibble with one row per transaction:

col_name types description
transaction_id character
date character Date in YYYY-MM-DD format.
type character Record type / category.
description character Long-form description text.
team_id character Unique team identifier.
athlete_id character Unique athlete identifier (ESPN).
athlete_name character Athlete display name (ESPN).
from_team_id character
to_team_id character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_transactions(season = 2025, limit = 10)

Get ESPN MLB Venues

Description

Get ESPN MLB Venues

Get ESPN MLB Venues

Usage

espn_mlb_venues(...)

Arguments

...

Additional arguments; currently unused but retained for forward compatibility. Proxy configuration should use options(baseballr.proxy = ...) – see ?baseballr for details.

Value

A single baseballr_data tibble with one row per venue.

col_name types description
venue_id character Unique venue identifier.
name character Display name.
full_name character Player's full name.
address_city character
address_state character
capacity integer
indoor logical
grass logical
images_url character

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_week_ranking(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_venues()

Get ESPN MLB Per-Week Ranking Detail

Description

Returns the long-format ranked teams for one (season x season-type x week x ranking-source). MLB typically returns an empty tibble.

Usage

espn_mlb_week_ranking(
  ranking_id,
  week,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

ranking_id

Ranking source id (1 = AP, 2 = Coaches, etc.).

week

Week number.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Per-Week Ranking Detail

Value

A tibble with one row per ranked team (typically 25).

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
week integer Week number.
ranking_id character ESPN ranking id.
name character Ranking name (e.g. "AP Top 25").
short_name character Short name.
type character Ranking type code.
headline character Full headline.
date character Date of the ranking.
current integer Current rank.
previous integer Previous-week rank.
points numeric Voting points.
first_place_votes integer First-place vote count.
trend character Trend indicator (e.g. "+3", "-2", "-").
record_summary character Team's record at time of poll (e.g. "20-2").
team_id character ESPN team id.
team_ref character ⁠$ref⁠ to the team-in-season resource.
last_updated character Last-updated timestamp.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_rankings(), espn_mlb_wp()

Examples

espn_mlb_week_ranking(ranking_id = 1, week = 5, season = 2025)

Get ESPN MLB Per-Week Rankings Index

Description

Returns the index of ranking sources available for one (MLB season x season-type x week). MLB does not publish weekly rankings, so this typically returns an empty tibble; the wrapper is provided for completeness with the ESPN schema.

Usage

espn_mlb_week_rankings(
  week,
  season = most_recent_mlb_season(),
  season_type = 2L,
  ...
)

Arguments

week

Week number.

season

Season year. Defaults to most recent MLB season.

season_type

Season-type id (2 = regular (default)).

...

Additional arguments; currently unused.

Details

Get ESPN MLB Per-Week Rankings Index

Value

A tibble with one row per ranking source.

col_name types description
league character League slug.
season integer Season year.
season_type integer Season-type id.
week integer Week number.
ranking_id character ESPN ranking id.
ref character ⁠$ref⁠ URL for the ranked-teams detail.

Author(s)

Saiem Gilani

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_wp()

Examples

espn_mlb_week_rankings(week = 5, season = 2025)

Get MLB win probability chart data from ESPN

Description

Get MLB win probability chart data from ESPN

Usage

espn_mlb_wp(game_id)

Arguments

game_id

(Integer required): Game ID filter for querying a single game

Value

espn_mlb_wp() - A baseballr_data tibble, one row per win-probability play:

col_name types description
game_id numeric Unique ESPN game/event identifier.
play_id character Unique play identifier within the game.
home_win_percentage numeric Home team win probability (0-1 decimal).
away_win_percentage numeric Away team win probability (0-1 decimal).
tie_percentage numeric Tie probability (0-1 decimal; extra-innings tie state).
sequence_number character Sequence number of the play within the game.
text character Text description of the play.
away_score integer Away team run total after the play.
home_score integer Home team run total after the play.
scoring_play logical TRUE if the play scored a run.
score_value integer Runs scored on the play.
wallclock character Wall-clock timestamp of the play (ISO 8601).
at_bat_id character Identifier of the at-bat the play belongs to.
summary_type character Play summary type.
outs integer Outs in the inning after the play.
participants list List of athlete participants in the play.
type_id character Play type identifier.
type_text character Play type description.
type_type character Play type category.
period_type character Period type ('inning').
period_number integer Inning number.
period_display_value character Inning display value (e.g. 'Top 1st').
team_id character Batting team identifier.
pitch_count_balls integer Balls in the count when the pitch was thrown.
pitch_count_strikes integer Strikes in the count when the pitch was thrown.
result_count_balls integer Balls in the count after the pitch.
result_count_strikes integer Strikes in the count after the pitch.
bat_order integer Batting order spot of the batter.
type_alternative_text character Alternative play type text.
bats_type character Batter handedness type.
bats_abbreviation character Batter handedness (L/R/S).
bats_display_value character Batter handedness display value.
at_bat_pitch_number integer Pitch number within the at-bat.
pitch_velocity integer Pitch velocity (mph).
trajectory character Batted-ball trajectory.
type_abbreviation character Play type abbreviation.
pitch_coordinate_x integer Pitch location x-coordinate.
pitch_coordinate_y integer Pitch location y-coordinate.
pitch_type_id character Pitch type identifier.
pitch_type_text character Pitch type description.
pitch_type_abbreviation character Pitch type abbreviation.
hit_coordinate_x integer Batted-ball location x-coordinate.
hit_coordinate_y integer Batted-ball location y-coordinate.
alternative_play character Alternative play flag.
alternative_type_id character Alternative play type id.
alternative_type_text character Alternative play type text.
alternative_type_abbreviation character Alternative play type abbreviation.
alternative_type_alternative_text character Alternative play alternative text.
alternative_type_type character Alternative play type category.
on_first_athlete_id character Athlete id of the runner on first base.
on_second_athlete_id character Athlete id of the runner on second base.
on_third_athlete_id character Athlete id of the runner on third base.

See Also

Other ESPN MLB Functions: espn_mlb, espn_mlb_athletes_index(), espn_mlb_award(), espn_mlb_betting(), espn_mlb_calendar(), espn_mlb_coach(), espn_mlb_coach_record(), espn_mlb_coach_season(), espn_mlb_coaches(), espn_mlb_conferences(), espn_mlb_draft(), espn_mlb_draft_athlete_detail(), espn_mlb_draft_athletes(), espn_mlb_draft_pick(), espn_mlb_draft_rounds(), espn_mlb_draft_status(), espn_mlb_franchise(), espn_mlb_franchises(), espn_mlb_freeagents(), espn_mlb_futures(), espn_mlb_game_all(), espn_mlb_game_broadcasts(), espn_mlb_game_endpoints, espn_mlb_game_info(), espn_mlb_game_odds(), espn_mlb_game_official_detail(), espn_mlb_game_officials(), espn_mlb_game_play(), espn_mlb_game_play_personnel(), espn_mlb_game_player_box(), espn_mlb_game_powerindex(), espn_mlb_game_predictor(), espn_mlb_game_probabilities(), espn_mlb_game_probables(), espn_mlb_game_propbets(), espn_mlb_game_rosters(), espn_mlb_game_situation(), espn_mlb_game_team_leaders(), espn_mlb_game_team_linescores(), espn_mlb_game_team_records(), espn_mlb_game_team_roster(), espn_mlb_game_team_roster_entry(), espn_mlb_game_team_score(), espn_mlb_game_team_statistics(), espn_mlb_injuries(), espn_mlb_leaders(), espn_mlb_news(), espn_mlb_pbp(), espn_mlb_player_awards(), espn_mlb_player_box(), espn_mlb_player_career_stats(), espn_mlb_player_contract(), espn_mlb_player_contracts(), espn_mlb_player_endpoints, espn_mlb_player_eventlog(), espn_mlb_player_eventlog_v2(), espn_mlb_player_gamelog(), espn_mlb_player_info(), espn_mlb_player_overview(), espn_mlb_player_seasons(), espn_mlb_player_splits(), espn_mlb_player_statisticslog(), espn_mlb_player_stats(), espn_mlb_player_stats_v3(), espn_mlb_position(), espn_mlb_positions(), espn_mlb_powerindex(), espn_mlb_scoreboard(), espn_mlb_season_awards(), espn_mlb_season_draft(), espn_mlb_season_group(), espn_mlb_season_group_children(), espn_mlb_season_group_teams(), espn_mlb_season_groups(), espn_mlb_season_info(), espn_mlb_season_leaders(), espn_mlb_season_ranking(), espn_mlb_season_rankings(), espn_mlb_season_type(), espn_mlb_season_types(), espn_mlb_season_week(), espn_mlb_season_weeks(), espn_mlb_seasons(), espn_mlb_standings(), espn_mlb_team(), espn_mlb_team_box(), espn_mlb_team_current_roster(), espn_mlb_team_depthchart(), espn_mlb_team_endpoints, espn_mlb_team_injuries(), espn_mlb_team_leaders(), espn_mlb_team_news(), espn_mlb_team_odds_records(), espn_mlb_team_record(), espn_mlb_team_record_detail(), espn_mlb_team_roster(), espn_mlb_team_schedule(), espn_mlb_team_season_profile(), espn_mlb_team_season_roster(), espn_mlb_team_season_statistics(), espn_mlb_team_stats(), espn_mlb_teams(), espn_mlb_tournament(), espn_mlb_tournament_season(), espn_mlb_tournament_seasons(), espn_mlb_tournaments(), espn_mlb_transactions(), espn_mlb_venues(), espn_mlb_week_ranking(), espn_mlb_week_rankings()

Examples

espn_mlb_wp(game_id = 401283399)

FanGraphs Functions Overview

Description

  • fg_pitcher_game_logs(): Scrape Pitcher Game Logs from FanGraphs.

  • fg_batter_game_logs(): Scrape Batter Game Logs from FanGraphs.

  • fg_milb_pitcher_game_logs(): Scrape MiLB game logs for pitchers from Fangraphs, combining 'standard' and 'advanced' tabs.

  • fg_milb_batter_game_logs(): Scrape MiLB game logs for batters from Fangraphs, combining 'standard' and 'advanced' tabs.

  • fg_batter_leaders(): Scrape Batter Leaderboards from FanGraphs.

  • fg_pitcher_leaders(): Scrape Pitcher Leaderboards from FanGraphs.

  • fg_fielder_leaders(): Scrape Fielder Leaderboards from FanGraphs.

  • fg_team_batter(): Scrape Team Batter Leaderboards from FanGraphs.

  • fg_team_pitcher(): Scrape Team Pitcher Leaderboards from FanGraphs.

  • fg_team_fielder(): Scrape Team Fielder Leaderboards from FanGraphs.

  • fg_guts(): Scrape FanGraphs.com Guts!.

  • fg_park(): Scrape Park Factors from FanGraphs.com.

  • fg_park_hand(): Scrape Park Factors by handedness from FanGraphs.com.

Details

Scrape Pitcher Game Logs from FanGraphs

  fg_pitcher_game_logs(playerid = 104, year = 2006)

Scrape Batter Game Logs from FanGraphs

  fg_batter_game_logs(playerid = 6184, year = 2017)

Scrape MiLB game logs for pitchers from Fangraphs

  fg_milb_pitcher_game_logs(playerid = "sa3004210", year=2017)

Scrape MiLB game logs for batters from Fangraphs

  fg_milb_batter_game_logs(playerid = "sa917940", year=2018)

Scrape Batter Leaderboards from FanGraphs

  fg_batter_leaders(startseason = 2015, endseason = 2015, qual = 400)

Scrape Pitcher Leaderboards from FanGraphs

  fg_pitcher_leaders(startseason = 2015, endseason = 2015, qual = 150)

Scrape Fielder Leaderboards from FanGraphs

  fg_fielder_leaders(startseason = 2015, endseason = 2015, qual = 150)

Scrape Team Batter Leaderboards from FanGraphs

  fg_team_batter(startseason = 2015, endseason = 2015, qual = 400)

Scrape Team Pitcher Leaderboards from FanGraphs

  fg_team_pitcher(startseason = 2015, endseason = 2015, qual = 150)

Scrape Team Fielder Leaderboards from FanGraphs

  fg_team_fielder(startseason = 2015, endseason = 2015, qual = 150)

Scrape FanGraphs.com Guts!

  fg_guts()

Scrape Park Factors from FanGraphs.com

  fg_park(2013)

Scrape Park Factors by handedness from FanGraphs.com

  fg_park_hand(2013)

(legacy) Scrape Batter Leaderboards from FanGraphs

Description

(legacy) Scrape Batter Leaderboards from FanGraphs

(legacy) Scrape Batter Leaderboards from FanGraphs

Usage

fg_bat_leaders(
  age = "",
  pos = "all",
  stats = "bat",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

fg_bat_leaders(
  age = "",
  pos = "all",
  stats = "bat",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of batter data.

A data frame of batter data.


Scrape Batter Game Logs from FanGraphs

Description

This function allows you to scrape game logs by year for a batter from FanGraphs.com.

Usage

fg_batter_game_logs(playerid, year)

Arguments

playerid

This is the playerid used by FanGraphs for a given player

year

The season for which game logs should be returned (use the YYYY format)

Value

A data frame of batter game logs, one row per game, with the following columns:

col_name types description
PlayerName character Player name.
playerid integer FanGraphs player ID.
Date character Calendar date of the game (YYYY-MM-DD).
Team character Team the player appeared for.
Opp character Opponent team; leading @ indicates a road game.
season integer Season year.
Age integer Player age during the season.
BatOrder character Spot in the batting order.
Pos character Fielding position played.
G numeric Games (1 per row).
AB numeric At-bats.
PA numeric Plate appearances.
H numeric Hits.
1B numeric Singles.
2B numeric Doubles.
3B numeric Triples.
HR numeric Home runs.
R numeric Runs scored.
RBI numeric Runs batted in.
BB numeric Walks (bases on balls).
IBB numeric Intentional walks.
SO numeric Strikeouts.
HBP numeric Times hit by pitch.
SF numeric Sacrifice flies.
SH numeric Sacrifice hits (bunts).
GDP numeric Grounded into double plays.
SB numeric Stolen bases.
CS numeric Times caught stealing.
AVG numeric Batting average.
GB numeric Ground balls.
FB numeric Fly balls.
LD numeric Line drives.
IFFB numeric Infield fly balls.
Pitches numeric Pitches seen.
Balls numeric Balls.
Strikes numeric Strikes.
IFH numeric Infield hits.
BU numeric Bunts.
BUH numeric Bunt hits.
BB% numeric Walk rate.
K% numeric Strikeout rate.
BB/K numeric Walk-to-strikeout ratio.
OBP numeric On-base percentage.
SLG numeric Slugging percentage.
OPS numeric On-base plus slugging.
ISO numeric Isolated power.
BABIP numeric Batting average on balls in play.
GB/FB numeric Ground-ball to fly-ball ratio.
LD% numeric Line-drive rate.
GB% numeric Ground-ball rate.
FB% numeric Fly-ball rate.
IFFB% numeric Infield-fly-ball rate.
HR/FB numeric Home-run-per-fly-ball rate.
IFH% numeric Infield-hit rate.
BUH% numeric Bunt-hit rate.
wOBA numeric Weighted on-base average.
wRAA numeric Weighted runs above average.
wRC numeric Weighted runs created.
Spd numeric Bill James Speed Score.
wRC+ numeric Weighted runs created plus (100 = average).
wBSR numeric Weighted base running runs.
WPA numeric Win probability added.
-WPA numeric Negative win probability added.
+WPA numeric Positive win probability added.
RE24 numeric Run expectancy based on 24 base-out states.
REW numeric Run expectancy wins.
pLI numeric Average leverage index.
PH numeric Pinch-hit appearances.
WPA/LI numeric Context-neutral win probability added.
Clutch numeric Clutch performance score.
FB%1 numeric Fastball usage rate.
FBv numeric Average four-seam fastball velocity (mph).
SL% numeric slider usage rate.
SLv numeric Average slider velocity (mph).
CT% numeric cutter usage rate.
CTv numeric Average cutter velocity (mph).
CB% numeric curveball usage rate.
CBv numeric Average curveball velocity (mph).
CH% numeric changeup usage rate.
CHv numeric Average changeup velocity (mph).
SF% numeric split-finger fastball usage rate.
SFv numeric Average split-finger fastball velocity (mph).
XX% numeric unknown/other pitch usage rate.
wFB numeric Total runs above average on the fastball.
wSL numeric Total runs above average on the slider.
wCT numeric Total runs above average on the cutter.
wCB numeric Total runs above average on the curveball.
wCH numeric Total runs above average on the changeup.
wSF numeric Total runs above average on the split-finger fastball.
wFB/C numeric Runs above average per 100 fastballs.
wSL/C numeric Runs above average per 100 sliders.
wCT/C numeric Runs above average per 100 cutters.
wCB/C numeric Runs above average per 100 curveballs.
wCH/C numeric Runs above average per 100 changeups.
wSF/C numeric Runs above average per 100 split-finger fastballs.
O-Swing% numeric Swing rate on pitches outside the zone.
Z-Swing% numeric Swing rate on pitches in the zone.
Swing% numeric Overall swing rate.
O-Contact% numeric Contact rate on pitches outside the zone.
Z-Contact% numeric Contact rate on pitches in the zone.
Contact% numeric Overall contact rate.
Zone% numeric Rate of pitches in the strike zone.
F-Strike% numeric First-pitch strike rate.
SwStr% numeric Swinging-strike rate.
Pull numeric Pulled batted balls.
Cent numeric Batted balls hit up the middle.
Oppo numeric Opposite-field batted balls.
Soft numeric Soft-hit batted balls.
Med numeric Medium-hit batted balls.
Hard numeric Hard-hit batted balls.
bipCount numeric Balls in play.
Pull% numeric Pulled batted-ball rate.
Cent% numeric Up-the-middle batted-ball rate.
Oppo% numeric Opposite-field batted-ball rate.
Soft% numeric Soft-contact rate.
Med% numeric Medium-contact rate.
Hard% numeric Hard-contact rate.
xwOBA numeric Expected weighted on-base average.
xAVG numeric Expected batting average.
xSLG numeric Expected slugging percentage.
pfxFA% numeric PITCHf/x four-seam fastball usage rate.
pfxFC% numeric PITCHf/x cutter usage rate.
pfxFS% numeric PITCHf/x splitter usage rate.
pfxFO% numeric PITCHf/x forkball usage rate.
pfxSI% numeric PITCHf/x sinker usage rate.
pfxSL% numeric PITCHf/x slider usage rate.
pfxCU% numeric PITCHf/x curveball usage rate.
pfxKC% numeric PITCHf/x knuckle curve usage rate.
pfxCH% numeric PITCHf/x changeup usage rate.
pfxSLO% numeric PITCHf/x slurve usage rate.
pfxST% numeric PITCHf/x sweeper usage rate.
pfxCUO% numeric PITCHf/x other curve usage rate.
pfxCV% numeric PITCHf/x curve usage rate.
pfxvFA numeric PITCHf/x average four-seam fastball velocity (mph).
pfxvFC numeric PITCHf/x average cutter velocity (mph).
pfxvFS numeric PITCHf/x average splitter velocity (mph).
pfxvFO numeric PITCHf/x average forkball velocity (mph).
pfxvSI numeric PITCHf/x average sinker velocity (mph).
pfxvSL numeric PITCHf/x average slider velocity (mph).
pfxvCU numeric PITCHf/x average curveball velocity (mph).
pfxvKC numeric PITCHf/x average knuckle curve velocity (mph).
pfxvCH numeric PITCHf/x average changeup velocity (mph).
pfxvSLO numeric PITCHf/x average slurve velocity (mph).
pfxvST numeric PITCHf/x average sweeper velocity (mph).
pfxvCUO numeric PITCHf/x average other curve velocity (mph).
pfxvCV numeric PITCHf/x average curve velocity (mph).
pfxFA-X numeric PITCHf/x horizontal movement of the four-seam fastball (inches).
pfxFC-X numeric PITCHf/x horizontal movement of the cutter (inches).
pfxFS-X numeric PITCHf/x horizontal movement of the splitter (inches).
pfxFO-X numeric PITCHf/x horizontal movement of the forkball (inches).
pfxSI-X numeric PITCHf/x horizontal movement of the sinker (inches).
pfxSL-X numeric PITCHf/x horizontal movement of the slider (inches).
pfxCU-X numeric PITCHf/x horizontal movement of the curveball (inches).
pfxKC-X numeric PITCHf/x horizontal movement of the knuckle curve (inches).
pfxCH-X numeric PITCHf/x horizontal movement of the changeup (inches).
pfxSLO-X numeric PITCHf/x horizontal movement of the slurve (inches).
pfxST-X numeric PITCHf/x horizontal movement of the sweeper (inches).
pfxCUO-X numeric PITCHf/x horizontal movement of the other curve (inches).
pfxCV-X numeric PITCHf/x horizontal movement of the curve (inches).
pfxFA-Z numeric PITCHf/x vertical movement of the four-seam fastball (inches).
pfxFC-Z numeric PITCHf/x vertical movement of the cutter (inches).
pfxFS-Z numeric PITCHf/x vertical movement of the splitter (inches).
pfxFO-Z numeric PITCHf/x vertical movement of the forkball (inches).
pfxSI-Z numeric PITCHf/x vertical movement of the sinker (inches).
pfxSL-Z numeric PITCHf/x vertical movement of the slider (inches).
pfxCU-Z numeric PITCHf/x vertical movement of the curveball (inches).
pfxKC-Z numeric PITCHf/x vertical movement of the knuckle curve (inches).
pfxCH-Z numeric PITCHf/x vertical movement of the changeup (inches).
pfxSLO-Z numeric PITCHf/x vertical movement of the slurve (inches).
pfxST-Z numeric PITCHf/x vertical movement of the sweeper (inches).
pfxCUO-Z numeric PITCHf/x vertical movement of the other curve (inches).
pfxCV-Z numeric PITCHf/x vertical movement of the curve (inches).
pfxwFA numeric PITCHf/x total runs above average on the four-seam fastball.
pfxwFC numeric PITCHf/x total runs above average on the cutter.
pfxwFS numeric PITCHf/x total runs above average on the splitter.
pfxwFO numeric PITCHf/x total runs above average on the forkball.
pfxwSI numeric PITCHf/x total runs above average on the sinker.
pfxwSL numeric PITCHf/x total runs above average on the slider.
pfxwCU numeric PITCHf/x total runs above average on the curveball.
pfxwKC numeric PITCHf/x total runs above average on the knuckle curve.
pfxwCH numeric PITCHf/x total runs above average on the changeup.
pfxwSLO numeric PITCHf/x total runs above average on the slurve.
pfxwST numeric PITCHf/x total runs above average on the sweeper.
pfxwCUO numeric PITCHf/x total runs above average on the other curve.
pfxwCV numeric PITCHf/x total runs above average on the curve.
pfxwFA/C numeric PITCHf/x runs above average per 100 four-seam fastballs.
pfxwFC/C numeric PITCHf/x runs above average per 100 cutters.
pfxwFS/C numeric PITCHf/x runs above average per 100 splitters.
pfxwFO/C numeric PITCHf/x runs above average per 100 forkballs.
pfxwSI/C numeric PITCHf/x runs above average per 100 sinkers.
pfxwSL/C numeric PITCHf/x runs above average per 100 sliders.
pfxwCU/C numeric PITCHf/x runs above average per 100 curveballs.
pfxwKC/C numeric PITCHf/x runs above average per 100 knuckle curves.
pfxwCH/C numeric PITCHf/x runs above average per 100 changeups.
pfxwSLO/C numeric PITCHf/x runs above average per 100 slurves.
pfxwST/C numeric PITCHf/x runs above average per 100 sweepers.
pfxwCUO/C numeric PITCHf/x runs above average per 100 other curves.
pfxwCV/C numeric PITCHf/x runs above average per 100 curves.
pfxaaFA numeric PITCHf/x average spin/active component on the four-seam fastball.
pfxaaFC numeric PITCHf/x average spin/active component on the cutter.
pfxaaFS numeric PITCHf/x average spin/active component on the splitter.
pfxaaFO numeric PITCHf/x average spin/active component on the forkball.
pfxaaSI numeric PITCHf/x average spin/active component on the sinker.
pfxaaSL numeric PITCHf/x average spin/active component on the slider.
pfxaaCU numeric PITCHf/x average spin/active component on the curveball.
pfxaaKC numeric PITCHf/x average spin/active component on the knuckle curve.
pfxaaCH numeric PITCHf/x average spin/active component on the changeup.
pfxaaSLO numeric PITCHf/x average spin/active component on the slurve.
pfxaaST numeric PITCHf/x average spin/active component on the sweeper.
pfxaaCUO numeric PITCHf/x average spin/active component on the other curve.
pfxaaCV numeric PITCHf/x average spin/active component on the curve.
pfxspFA numeric PITCHf/x average spin rate on the four-seam fastball (rpm).
pfxspFC numeric PITCHf/x average spin rate on the cutter (rpm).
pfxspFS numeric PITCHf/x average spin rate on the splitter (rpm).
pfxspFO numeric PITCHf/x average spin rate on the forkball (rpm).
pfxspSI numeric PITCHf/x average spin rate on the sinker (rpm).
pfxspSL numeric PITCHf/x average spin rate on the slider (rpm).
pfxspCU numeric PITCHf/x average spin rate on the curveball (rpm).
pfxspKC numeric PITCHf/x average spin rate on the knuckle curve (rpm).
pfxspCH numeric PITCHf/x average spin rate on the changeup (rpm).
pfxspSLO numeric PITCHf/x average spin rate on the slurve (rpm).
pfxspST numeric PITCHf/x average spin rate on the sweeper (rpm).
pfxspCUO numeric PITCHf/x average spin rate on the other curve (rpm).
pfxspCV numeric PITCHf/x average spin rate on the curve (rpm).
pfxO-Swing% numeric PITCHf/x Swing rate on pitches outside the zone.
pfxZ-Swing% numeric PITCHf/x Swing rate on pitches in the zone.
pfxSwing% numeric PITCHf/x Overall swing rate.
pfxO-Contact% numeric PITCHf/x Contact rate on pitches outside the zone.
pfxZ-Contact% numeric PITCHf/x Contact rate on pitches in the zone.
pfxContact% numeric PITCHf/x Overall contact rate.
pfxZone% numeric PITCHf/x Rate of pitches in the strike zone.
pfxPace numeric PITCHf/x Average seconds between pitches.
AvgBatSpeed numeric Average bat speed (mph).
FastSwing% numeric Rate of fast swings.
SwingLength numeric Average swing length (feet).
SquaredUpContact% numeric Squared-up rate per contact.
SquaredUpSwing% numeric Squared-up rate per swing.
BlastContact% numeric Blast rate per contact.
BlastSwing% numeric Blast rate per swing.
Swords numeric Swords (especially ugly swinging strikeouts).
CompetitiveSwings numeric Competitive swings.
Tilt numeric Average swing tilt (degrees).
AttackAngle numeric Average attack angle (degrees).
AttackDirection numeric Average attack direction (degrees).
IdealAttackAngle% numeric Rate of swings in the ideal attack-angle range.
DepthInBox numeric Average depth in the batter's box (inches).
DistanceOffPlate numeric Average distance off the plate (inches).
scH-Swing% numeric Statcast heart-zone swing rate.
scH-Contact% numeric Statcast heart-zone contact rate.
scH-Zone% numeric Statcast heart-zone zone rate.
scS-Swing% numeric Statcast shadow-zone swing rate.
scS-Contact% numeric Statcast shadow-zone contact rate.
scS-Zone% numeric Statcast shadow-zone zone rate.
scC-Swing% numeric Statcast chase-zone swing rate.
scC-Contact% numeric Statcast chase-zone contact rate.
scC-Zone% numeric Statcast chase-zone zone rate.
scW-Swing% numeric Statcast waste-zone swing rate.
scW-Contact% numeric Statcast waste-zone contact rate.
scW-Zone% numeric Statcast waste-zone zone rate.
scSI-Swing% numeric Statcast in-zone strike-zone swing rate.
scSI-Contact% numeric Statcast in-zone strike-zone contact rate.
scSI-Zone% numeric Statcast in-zone strike-zone zone rate.
scSO-Swing% numeric Statcast out-of-zone strike-zone swing rate.
scSO-Contact% numeric Statcast out-of-zone strike-zone contact rate.
scSO-Zone% numeric Statcast out-of-zone strike-zone zone rate.
scO-Swing% numeric Statcast out-of-zone-zone swing rate.
scO-Contact% numeric Statcast out-of-zone-zone contact rate.
scO-Zone% numeric Statcast out-of-zone-zone zone rate.
scZ-Swing% numeric Statcast in-zone-zone swing rate.
scZ-Contact% numeric Statcast in-zone-zone contact rate.
scZ-Zone% numeric Statcast in-zone-zone zone rate.
piCH% numeric PITCHInfo changeup usage rate.
piCS% numeric PITCHInfo slow curve usage rate.
piCU% numeric PITCHInfo curveball usage rate.
piFA% numeric PITCHInfo four-seam fastball usage rate.
piFC% numeric PITCHInfo cutter usage rate.
piFS% numeric PITCHInfo splitter usage rate.
piSI% numeric PITCHInfo sinker usage rate.
piSL% numeric PITCHInfo slider usage rate.
piXX% numeric PITCHInfo unknown/other pitch usage rate.
pivCH numeric PITCHInfo average changeup velocity (mph).
pivCS numeric PITCHInfo average slow curve velocity (mph).
pivCU numeric PITCHInfo average curveball velocity (mph).
pivFA numeric PITCHInfo average four-seam fastball velocity (mph).
pivFC numeric PITCHInfo average cutter velocity (mph).
pivFS numeric PITCHInfo average splitter velocity (mph).
pivSI numeric PITCHInfo average sinker velocity (mph).
pivSL numeric PITCHInfo average slider velocity (mph).
pivXX numeric PITCHInfo average unknown/other pitch velocity (mph).
piCH-X numeric PITCHInfo horizontal movement of the changeup (inches).
piCS-X numeric PITCHInfo horizontal movement of the slow curve (inches).
piCU-X numeric PITCHInfo horizontal movement of the curveball (inches).
piFA-X numeric PITCHInfo horizontal movement of the four-seam fastball (inches).
piFC-X numeric PITCHInfo horizontal movement of the cutter (inches).
piFS-X numeric PITCHInfo horizontal movement of the splitter (inches).
piSI-X numeric PITCHInfo horizontal movement of the sinker (inches).
piSL-X numeric PITCHInfo horizontal movement of the slider (inches).
piXX-X numeric PITCHInfo horizontal movement of the unknown/other pitch (inches).
piCH-Z numeric PITCHInfo vertical movement of the changeup (inches).
piCS-Z numeric PITCHInfo vertical movement of the slow curve (inches).
piCU-Z numeric PITCHInfo vertical movement of the curveball (inches).
piFA-Z numeric PITCHInfo vertical movement of the four-seam fastball (inches).
piFC-Z numeric PITCHInfo vertical movement of the cutter (inches).
piFS-Z numeric PITCHInfo vertical movement of the splitter (inches).
piSI-Z numeric PITCHInfo vertical movement of the sinker (inches).
piSL-Z numeric PITCHInfo vertical movement of the slider (inches).
piXX-Z numeric PITCHInfo vertical movement of the unknown/other pitch (inches).
piwCH numeric PITCHInfo total runs above average on the changeup.
piwCS numeric PITCHInfo total runs above average on the slow curve.
piwCU numeric PITCHInfo total runs above average on the curveball.
piwFA numeric PITCHInfo total runs above average on the four-seam fastball.
piwFC numeric PITCHInfo total runs above average on the cutter.
piwFS numeric PITCHInfo total runs above average on the splitter.
piwSI numeric PITCHInfo total runs above average on the sinker.
piwSL numeric PITCHInfo total runs above average on the slider.
piwXX numeric PITCHInfo total runs above average on the unknown/other pitch.
piwCH/C numeric PITCHInfo runs above average per 100 changeups.
piwCS/C numeric PITCHInfo runs above average per 100 slow curves.
piwCU/C numeric PITCHInfo runs above average per 100 curveballs.
piwFA/C numeric PITCHInfo runs above average per 100 four-seam fastballs.
piwFC/C numeric PITCHInfo runs above average per 100 cutters.
piwFS/C numeric PITCHInfo runs above average per 100 splitters.
piwSI/C numeric PITCHInfo runs above average per 100 sinkers.
piwSL/C numeric PITCHInfo runs above average per 100 sliders.
piwXX/C numeric PITCHInfo runs above average per 100 unknown/other pitchs.
piO-Swing% numeric PITCHInfo Swing rate on pitches outside the zone.
piZ-Swing% numeric PITCHInfo Swing rate on pitches in the zone.
piSwing% numeric PITCHInfo Overall swing rate.
piO-Contact% numeric PITCHInfo Contact rate on pitches outside the zone.
piZ-Contact% numeric PITCHInfo Contact rate on pitches in the zone.
piContact% numeric PITCHInfo Overall contact rate.
piZone% numeric PITCHInfo Rate of pitches in the strike zone.
Events numeric Batted-ball events with Statcast data.
EV numeric Average exit velocity (mph).
LA numeric Average launch angle (degrees).
Barrels numeric Barreled batted balls.
Barrel% numeric Barrel rate (per batted-ball event).
maxEV numeric Maximum exit velocity (mph).
HardHit numeric Hard-hit batted balls (95+ mph).
HardHit% numeric Hard-hit rate (95+ mph).
gamedate character Game date as parsed from the source feed.
dh integer Doubleheader game indicator (0 = single game).

Examples

try(fg_batter_game_logs(playerid = 19755, year = 2023))

Scrape Batter Leaderboards from FanGraphs

Description

This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.

Usage

fg_batter_leaders(
  age = "",
  pos = "all",
  stats = "bat",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of batter data.

col_name types description
Season integer Season (YYYY).
team_name character Team name.
Bats character Batting handedness (L/R/S).
xMLBAMID integer MLBAM player ID.
PlayerNameRoute character Player name URL slug used by FanGraphs.
PlayerName character Player name.
playerid integer FanGraphs player ID.
Age integer Player age.
AgeRng character Player age range across the span.
SeasonMin integer First season in the queried span.
SeasonMax integer Last season in the queried span.
G integer Games played.
AB integer At-bats.
PA integer Plate appearances.
H integer Hits.
1B integer Singles.
2B integer Doubles.
3B integer Triples.
HR integer Home runs.
R integer Runs scored.
RBI integer Runs batted in.
BB integer Walks (bases on balls).
IBB integer Intentional walks.
SO integer Strikeouts.
HBP integer Hit by pitch.
SF integer Sacrifice flies.
SH integer Sacrifice hits (bunts).
GDP integer Grounded into double plays.
SB integer Stolen bases.
CS integer Caught stealing.
AVG numeric Batting average (or opponent average for pitchers).
GB integer Ground balls.
FB integer Fly balls.
LD integer Line drives.
IFFB integer Infield fly balls.
Pitches integer Total pitches seen or thrown.
Balls integer Total balls.
Strikes integer Total strikes.
IFH integer Infield hits.
BU integer Bunts.
BUH integer Bunt hits.
BB_pct numeric Walk rate.
K_pct numeric Strikeout rate.
BB_K numeric Walk-to-strikeout ratio.
OBP numeric On-base percentage.
SLG numeric Slugging percentage.
OPS numeric On-base plus slugging.
ISO numeric Isolated power.
BABIP numeric Batting average on balls in play.
GB_FB numeric Ground-ball to fly-ball ratio.
LD_pct numeric Line-drive percentage.
GB_pct numeric Ground-ball percentage.
FB_pct numeric Fly-ball percentage.
IFFB_pct numeric Infield-fly-ball percentage.
HR_FB numeric Home-run-per-fly-ball rate.
IFH_pct numeric Infield-hit percentage.
BUH_pct numeric Bunt-hit percentage.
TTO_pct numeric Three-true-outcomes percentage (BB, K, HR).
wOBA numeric Weighted On-Base Average.
wRAA numeric Weighted Runs Above Average.
wRC numeric Weighted Runs Created.
Batting numeric Batting runs above average.
Fielding numeric Fielding runs above average.
Replacement numeric Replacement-level runs.
Positional numeric Positional adjustment runs.
wLeague numeric League adjustment runs.
Defense numeric Total defensive value (runs above average).
Offense numeric Total offensive value (runs above average).
RAR numeric Runs Above Replacement.
WAR numeric Wins Above Replacement.
WAROld numeric Wins Above Replacement (legacy formulation).
Dollars numeric Estimated market value of production.
BaseRunning numeric Base-running runs above average.
Spd numeric Speed Score.
wRC_plus numeric Weighted Runs Created Plus (park/league-adjusted, 100 = average).
wBsR numeric Weighted Base Running runs.
WPA numeric Win Probability Added.
WPA_minus numeric Negative Win Probability Added.
WPA_plus numeric Positive Win Probability Added.
RE24 numeric Run Expectancy based on the 24 base-out states.
REW numeric Run Expectancy Wins.
pLI numeric Average Leverage Index.
PH integer Pinch-hit appearances.
WPA_LI numeric Situational Win Probability Added (WPA divided by Leverage Index).
Clutch numeric Clutch performance relative to context-neutral performance.
FB_pct1 numeric Overall fastball percentage (pitch usage).
FBv numeric Average fastball velocity.
SL_pct numeric Slider percentage (pitch usage).
SLv numeric Average slider velocity.
CT_pct numeric Cutter percentage (pitch usage).
CTv numeric Average cutter velocity.
CB_pct numeric Curveball percentage (pitch usage).
CBv numeric Average curveball velocity.
CH_pct numeric Changeup percentage (pitch usage).
CHv numeric Average changeup velocity.
SF_pct numeric Splitter percentage (pitch usage).
SFv numeric Average splitter velocity.
XX_pct numeric Unidentified-pitch percentage (pitch usage).
wFB numeric Fastball pitch-type linear weight runs.
wSL numeric Slider pitch-type linear weight runs.
wCT numeric Cutter pitch-type linear weight runs.
wCB numeric Curveball pitch-type linear weight runs.
wCH numeric Changeup pitch-type linear weight runs.
wSF numeric Splitter pitch-type linear weight runs.
wFB_C numeric Fastball linear weight runs per 100 pitches.
wSL_C numeric Slider linear weight runs per 100 pitches.
wCT_C numeric Cutter linear weight runs per 100 pitches.
wCB_C numeric Curveball linear weight runs per 100 pitches.
wCH_C numeric Changeup linear weight runs per 100 pitches.
wSF_C numeric Splitter linear weight runs per 100 pitches.
O-Swing_pct numeric Swing percentage on pitches outside the zone (chase rate).
Z-Swing_pct numeric Swing percentage on pitches inside the zone.
Swing_pct numeric Overall swing percentage.
O-Contact_pct numeric Contact percentage on pitches outside the zone.
Z-Contact_pct numeric Contact percentage on pitches inside the zone.
Contact_pct numeric Overall contact percentage.
Zone_pct numeric Percentage of pitches in the strike zone.
F-Strike_pct numeric First-pitch strike percentage.
SwStr_pct numeric Swinging-strike percentage.
CStr_pct numeric Called-strike percentage.
C+SwStr_pct numeric Combined called- plus swinging-strike percentage.
Pull integer Balls in play hit to the pull field.
Cent integer Balls in play hit up the middle.
Oppo integer Balls in play hit to the opposite field.
Soft integer Soft-contact balls in play.
Med integer Medium-contact balls in play.
Hard integer Hard-contact balls in play.
bipCount integer Count of balls in play with contact-quality data.
Pull_pct numeric Pull-field percentage.
Cent_pct numeric Up-the-middle percentage.
Oppo_pct numeric Opposite-field percentage.
Soft_pct numeric Soft-contact percentage.
Med_pct numeric Medium-contact percentage.
Hard_pct numeric Hard-contact percentage.
UBR numeric Ultimate Base Running runs.
GDPRuns numeric Runs from grounded-into-double-play avoidance.
AVG+ numeric Park/league-adjusted batting average (100 = average).
BB_pct+ numeric Park/league-adjusted walk rate (100 = average).
K_pct+ numeric Park/league-adjusted strikeout rate (100 = average).
OBP+ numeric Park/league-adjusted on-base percentage (100 = average).
SLG+ numeric Park/league-adjusted slugging percentage (100 = average).
ISO+ numeric Park/league-adjusted isolated power (100 = average).
BABIP+ numeric Park/league-adjusted BABIP (100 = average).
LD_pct+ numeric Park/league-adjusted line-drive rate (100 = average).
GB_pct+ numeric Park/league-adjusted ground-ball rate (100 = average).
FB_pct+ numeric Park/league-adjusted fly-ball rate (100 = average).
HRFB_pct+ numeric Park/league-adjusted home-run-per-fly-ball rate (100 = average).
Pull_pct+ numeric Park/league-adjusted pull rate (100 = average).
Cent_pct+ numeric Park/league-adjusted up-the-middle rate (100 = average).
Oppo_pct+ numeric Park/league-adjusted opposite-field rate (100 = average).
Soft_pct+ numeric Park/league-adjusted soft-contact rate (100 = average).
Med_pct+ numeric Park/league-adjusted medium-contact rate (100 = average).
Hard_pct+ numeric Park/league-adjusted hard-contact rate (100 = average).
xwOBA numeric Expected Weighted On-Base Average (Statcast).
xAVG numeric Expected batting average (Statcast).
xSLG numeric Expected slugging percentage (Statcast).
XBR numeric Extra bases taken on the bases, runs above average.
PPTV integer Pitch-type pitch values (raw component).
CPTV integer Catcher pitch-type value (raw component).
BPTV integer Batter pitch-type value (raw component).
DSV integer Defensive stuff value (raw component).
DGV integer Defensive game value (raw component).
BTV integer Base-state team value (raw component).
rPPTV numeric Regressed pitch-type pitch values.
rBPTV numeric Regressed batter pitch-type value.
EBV integer Earned-base value (raw component).
ESV integer Earned-strike value (raw component).
rFTeamV numeric Regressed fielding team value.
rBTeamV numeric Regressed base-running team value.
rTV numeric Regressed total team value.
pfx_FA_pct numeric PITCHf/x four-seam fastballs usage percentage.
pfx_FC_pct numeric PITCHf/x cutters usage percentage.
pfx_FS_pct numeric PITCHf/x splitters usage percentage.
pfx_FO_pct numeric PITCHf/x forkballs/pitch-outs usage percentage.
pfx_SI_pct numeric PITCHf/x sinkers usage percentage.
pfx_SL_pct numeric PITCHf/x sliders usage percentage.
pfx_CU_pct numeric PITCHf/x curveballs usage percentage.
pfx_KC_pct numeric PITCHf/x knuckle-curves usage percentage.
pfx_EP_pct numeric PITCHf/x eephus pitches usage percentage.
pfx_CH_pct numeric PITCHf/x changeups usage percentage.
pfx_SC_pct numeric PITCHf/x screwballs usage percentage.
pfx_SLO_pct numeric PITCHf/x slurves usage percentage.
pfx_ST_pct numeric PITCHf/x sweepers usage percentage.
pfx_CUO_pct numeric PITCHf/x slurves usage percentage.
pfx_CV_pct numeric PITCHf/x slow curves usage percentage.
pfx_vFA numeric PITCHf/x average four-seam fastballs velocity.
pfx_vFC numeric PITCHf/x average cutters velocity.
pfx_vFS numeric PITCHf/x average splitters velocity.
pfx_vFO numeric PITCHf/x average forkballs/pitch-outs velocity.
pfx_vSI numeric PITCHf/x average sinkers velocity.
pfx_vSL numeric PITCHf/x average sliders velocity.
pfx_vCU numeric PITCHf/x average curveballs velocity.
pfx_vKC numeric PITCHf/x average knuckle-curves velocity.
pfx_vEP numeric PITCHf/x average eephus pitches velocity.
pfx_vCH numeric PITCHf/x average changeups velocity.
pfx_vSC numeric PITCHf/x average screwballs velocity.
pfx_vSLO numeric PITCHf/x average slurves velocity.
pfx_vST numeric PITCHf/x average sweepers velocity.
pfx_vCUO numeric PITCHf/x average slurves velocity.
pfx_vCV numeric PITCHf/x average slow curves velocity.
pfx_FA-X numeric PITCHf/x average horizontal movement on four-seam fastballs.
pfx_FC-X numeric PITCHf/x average horizontal movement on cutters.
pfx_FS-X numeric PITCHf/x average horizontal movement on splitters.
pfx_FO-X numeric PITCHf/x average horizontal movement on forkballs/pitch-outs.
pfx_SI-X numeric PITCHf/x average horizontal movement on sinkers.
pfx_SL-X numeric PITCHf/x average horizontal movement on sliders.
pfx_CU-X numeric PITCHf/x average horizontal movement on curveballs.
pfx_KC-X numeric PITCHf/x average horizontal movement on knuckle-curves.
pfx_EP-X numeric PITCHf/x average horizontal movement on eephus pitches.
pfx_CH-X numeric PITCHf/x average horizontal movement on changeups.
pfx_SC-X numeric PITCHf/x average horizontal movement on screwballs.
pfx_SLO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_ST-X numeric PITCHf/x average horizontal movement on sweepers.
pfx_CUO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_CV-X numeric PITCHf/x average horizontal movement on slow curves.
pfx_FA-Z numeric PITCHf/x average vertical movement on four-seam fastballs.
pfx_FC-Z numeric PITCHf/x average vertical movement on cutters.
pfx_FS-Z numeric PITCHf/x average vertical movement on splitters.
pfx_FO-Z numeric PITCHf/x average vertical movement on forkballs/pitch-outs.
pfx_SI-Z numeric PITCHf/x average vertical movement on sinkers.
pfx_SL-Z numeric PITCHf/x average vertical movement on sliders.
pfx_CU-Z numeric PITCHf/x average vertical movement on curveballs.
pfx_KC-Z numeric PITCHf/x average vertical movement on knuckle-curves.
pfx_EP-Z numeric PITCHf/x average vertical movement on eephus pitches.
pfx_CH-Z numeric PITCHf/x average vertical movement on changeups.
pfx_SC-Z numeric PITCHf/x average vertical movement on screwballs.
pfx_SLO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_ST-Z numeric PITCHf/x average vertical movement on sweepers.
pfx_CUO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_CV-Z numeric PITCHf/x average vertical movement on slow curves.
pfx_wFA numeric PITCHf/x four-seam fastballs linear weight runs.
pfx_wFC numeric PITCHf/x cutters linear weight runs.
pfx_wFS numeric PITCHf/x splitters linear weight runs.
pfx_wFO numeric PITCHf/x forkballs/pitch-outs linear weight runs.
pfx_wSI numeric PITCHf/x sinkers linear weight runs.
pfx_wSL numeric PITCHf/x sliders linear weight runs.
pfx_wCU numeric PITCHf/x curveballs linear weight runs.
pfx_wKC numeric PITCHf/x knuckle-curves linear weight runs.
pfx_wEP numeric PITCHf/x eephus pitches linear weight runs.
pfx_wCH numeric PITCHf/x changeups linear weight runs.
pfx_wSC numeric PITCHf/x screwballs linear weight runs.
pfx_wSLO numeric PITCHf/x slurves linear weight runs.
pfx_wST numeric PITCHf/x sweepers linear weight runs.
pfx_wCUO numeric PITCHf/x slurves linear weight runs.
pfx_wCV numeric PITCHf/x slow curves linear weight runs.
pfx_wFA_C numeric PITCHf/x four-seam fastballs linear weight runs per 100 pitches.
pfx_wFC_C numeric PITCHf/x cutters linear weight runs per 100 pitches.
pfx_wFS_C numeric PITCHf/x splitters linear weight runs per 100 pitches.
pfx_wFO_C numeric PITCHf/x forkballs/pitch-outs linear weight runs per 100 pitches.
pfx_wSI_C numeric PITCHf/x sinkers linear weight runs per 100 pitches.
pfx_wSL_C numeric PITCHf/x sliders linear weight runs per 100 pitches.
pfx_wCU_C numeric PITCHf/x curveballs linear weight runs per 100 pitches.
pfx_wKC_C numeric PITCHf/x knuckle-curves linear weight runs per 100 pitches.
pfx_wEP_C numeric PITCHf/x eephus pitches linear weight runs per 100 pitches.
pfx_wCH_C numeric PITCHf/x changeups linear weight runs per 100 pitches.
pfx_wSC_C numeric PITCHf/x screwballs linear weight runs per 100 pitches.
pfx_wSLO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_wST_C numeric PITCHf/x sweepers linear weight runs per 100 pitches.
pfx_wCUO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_wCV_C numeric PITCHf/x slow curves linear weight runs per 100 pitches.
pfx_aaFA numeric PITCHf/x average arsenal value on four-seam fastballs.
pfx_aaFC numeric PITCHf/x average arsenal value on cutters.
pfx_aaFS numeric PITCHf/x average arsenal value on splitters.
pfx_aaFO numeric PITCHf/x average arsenal value on forkballs/pitch-outs.
pfx_aaSI numeric PITCHf/x average arsenal value on sinkers.
pfx_aaSL numeric PITCHf/x average arsenal value on sliders.
pfx_aaCU numeric PITCHf/x average arsenal value on curveballs.
pfx_aaKC numeric PITCHf/x average arsenal value on knuckle-curves.
pfx_aaEP numeric PITCHf/x average arsenal value on eephus pitches.
pfx_aaCH numeric PITCHf/x average arsenal value on changeups.
pfx_aaSC numeric PITCHf/x average arsenal value on screwballs.
pfx_aaSLO numeric PITCHf/x average arsenal value on slurves.
pfx_aaST numeric PITCHf/x average arsenal value on sweepers.
pfx_aaCUO numeric PITCHf/x average arsenal value on slurves.
pfx_aaCV numeric PITCHf/x average arsenal value on slow curves.
pfx_spFA numeric PITCHf/x Stuff+ value on four-seam fastballs.
pfx_spFC numeric PITCHf/x Stuff+ value on cutters.
pfx_spFS numeric PITCHf/x Stuff+ value on splitters.
pfx_spFO numeric PITCHf/x Stuff+ value on forkballs/pitch-outs.
pfx_spSI numeric PITCHf/x Stuff+ value on sinkers.
pfx_spSL numeric PITCHf/x Stuff+ value on sliders.
pfx_spCU numeric PITCHf/x Stuff+ value on curveballs.
pfx_spKC numeric PITCHf/x Stuff+ value on knuckle-curves.
pfx_spEP numeric PITCHf/x Stuff+ value on eephus pitches.
pfx_spCH numeric PITCHf/x Stuff+ value on changeups.
pfx_spSC numeric PITCHf/x Stuff+ value on screwballs.
pfx_spSLO numeric PITCHf/x Stuff+ value on slurves.
pfx_spST numeric PITCHf/x Stuff+ value on sweepers.
pfx_spCUO numeric PITCHf/x Stuff+ value on slurves.
pfx_spCV numeric PITCHf/x Stuff+ value on slow curves.
pfx_O-Swing_pct numeric PITCHf/x swing percentage on pitches outside the zone.
pfx_Z-Swing_pct numeric PITCHf/x swing percentage on pitches inside the zone.
pfx_Swing_pct numeric PITCHf/x swing percentage.
pfx_O-Contact_pct numeric PITCHf/x contact percentage on pitches outside the zone.
pfx_Z-Contact_pct numeric PITCHf/x contact percentage on pitches inside the zone.
pfx_Contact_pct numeric PITCHf/x contact percentage.
pfx_Zone_pct numeric PITCHf/x percentage of pitches in the strike zone.
pfx_Pace numeric PITCHf/x pace (seconds between pitches).
AvgBatSpeed numeric Average bat speed (mph).
FastSwing_pct numeric Fast-swing percentage (75+ mph bat speed).
SwingLength numeric Average swing length (feet).
SquaredUpContact_pct numeric Squared-up percentage per batted-ball contact.
SquaredUpSwing_pct numeric Squared-up percentage per swing.
BlastContact_pct numeric Blast percentage per batted-ball contact.
BlastSwing_pct numeric Blast percentage per swing.
Swords integer Swords (awkward, defensive swinging strikes induced).
CompetitiveSwings integer Competitive swings tracked.
Tilt numeric Average swing tilt (degrees).
AttackAngle numeric Average attack angle (degrees).
AttackDirection numeric Average attack direction (degrees).
IdealAttackAngle_pct numeric Percentage of swings in the ideal attack-angle range.
DepthInBox numeric Average batter depth in the box (inches).
DistanceOffPlate numeric Average batter distance off the plate (inches).
scH-Swing_pct numeric Statcast swing percentage on hard-hit pitches.
scH-Contact_pct numeric Statcast contact percentage on hard-hit pitches.
scH-Zone_pct numeric Statcast in-zone percentage on hard-hit pitches.
scS-Swing_pct numeric Statcast swing percentage on slider pitches.
scS-Contact_pct numeric Statcast contact percentage on slider pitches.
scS-Zone_pct numeric Statcast in-zone percentage on slider pitches.
scC-Swing_pct numeric Statcast swing percentage on curveball pitches.
scC-Contact_pct numeric Statcast contact percentage on curveball pitches.
scC-Zone_pct numeric Statcast in-zone percentage on curveball pitches.
scW-Swing_pct numeric Statcast swing percentage on offspeed pitches.
scW-Contact_pct numeric Statcast contact percentage on offspeed pitches.
scW-Zone_pct numeric Statcast in-zone percentage on offspeed pitches.
scSI-Swing_pct numeric Statcast swing percentage on sinker pitches.
scSI-Contact_pct numeric Statcast contact percentage on sinker pitches.
scSI-Zone_pct numeric Statcast in-zone percentage on sinker pitches.
scSO-Swing_pct numeric Statcast swing percentage on softly-hit pitches.
scSO-Contact_pct numeric Statcast contact percentage on softly-hit pitches.
scSO-Zone_pct numeric Statcast in-zone percentage on softly-hit pitches.
scO-Swing_pct numeric Statcast swing percentage on out-of-zone pitches.
scO-Contact_pct numeric Statcast contact percentage on out-of-zone pitches.
scO-Zone_pct numeric Statcast in-zone percentage on out-of-zone pitches.
scZ-Swing_pct numeric Statcast swing percentage on in-zone pitches.
scZ-Contact_pct numeric Statcast contact percentage on in-zone pitches.
scZ-Zone_pct numeric Statcast in-zone percentage on in-zone pitches.
pi_CH_pct numeric PITCHInfo changeups usage percentage.
pi_CU_pct numeric PITCHInfo curveballs usage percentage.
pi_FA_pct numeric PITCHInfo four-seam fastballs usage percentage.
pi_FC_pct numeric PITCHInfo cutters usage percentage.
pi_FS_pct numeric PITCHInfo splitters usage percentage.
pi_SB_pct numeric PITCHInfo slow-balls usage percentage.
pi_SI_pct numeric PITCHInfo sinkers usage percentage.
pi_SL_pct numeric PITCHInfo sliders usage percentage.
pi_vCH numeric PITCHInfo average changeups velocity.
pi_vCU numeric PITCHInfo average curveballs velocity.
pi_vFA numeric PITCHInfo average four-seam fastballs velocity.
pi_vFC numeric PITCHInfo average cutters velocity.
pi_vFS numeric PITCHInfo average splitters velocity.
pi_vSB numeric PITCHInfo average slow-balls velocity.
pi_vSI numeric PITCHInfo average sinkers velocity.
pi_vSL numeric PITCHInfo average sliders velocity.
pi_CH-X numeric PITCHInfo average horizontal movement on changeups.
pi_CU-X numeric PITCHInfo average horizontal movement on curveballs.
pi_FA-X numeric PITCHInfo average horizontal movement on four-seam fastballs.
pi_FC-X numeric PITCHInfo average horizontal movement on cutters.
pi_FS-X numeric PITCHInfo average horizontal movement on splitters.
pi_SB-X numeric PITCHInfo average horizontal movement on slow-balls.
pi_SI-X numeric PITCHInfo average horizontal movement on sinkers.
pi_SL-X numeric PITCHInfo average horizontal movement on sliders.
pi_CH-Z numeric PITCHInfo average vertical movement on changeups.
pi_CU-Z numeric PITCHInfo average vertical movement on curveballs.
pi_FA-Z numeric PITCHInfo average vertical movement on four-seam fastballs.
pi_FC-Z numeric PITCHInfo average vertical movement on cutters.
pi_FS-Z numeric PITCHInfo average vertical movement on splitters.
pi_SB-Z numeric PITCHInfo average vertical movement on slow-balls.
pi_SI-Z numeric PITCHInfo average vertical movement on sinkers.
pi_SL-Z numeric PITCHInfo average vertical movement on sliders.
pi_wCH numeric PITCHInfo changeups linear weight runs.
pi_wCU numeric PITCHInfo curveballs linear weight runs.
pi_wFA numeric PITCHInfo four-seam fastballs linear weight runs.
pi_wFC numeric PITCHInfo cutters linear weight runs.
pi_wFS numeric PITCHInfo splitters linear weight runs.
pi_wSB numeric PITCHInfo slow-balls linear weight runs.
pi_wSI numeric PITCHInfo sinkers linear weight runs.
pi_wSL numeric PITCHInfo sliders linear weight runs.
pi_wCH_C numeric PITCHInfo changeups linear weight runs per 100 pitches.
pi_wCU_C numeric PITCHInfo curveballs linear weight runs per 100 pitches.
pi_wFA_C numeric PITCHInfo four-seam fastballs linear weight runs per 100 pitches.
pi_wFC_C numeric PITCHInfo cutters linear weight runs per 100 pitches.
pi_wFS_C numeric PITCHInfo splitters linear weight runs per 100 pitches.
pi_wSB_C numeric PITCHInfo slow-balls linear weight runs per 100 pitches.
pi_wSI_C numeric PITCHInfo sinkers linear weight runs per 100 pitches.
pi_wSL_C numeric PITCHInfo sliders linear weight runs per 100 pitches.
pi_O-Swing_pct numeric PITCHInfo swing percentage on pitches outside the zone.
pi_Z-Swing_pct numeric PITCHInfo swing percentage on pitches inside the zone.
pi_Swing_pct numeric PITCHInfo swing percentage.
pi_O-Contact_pct numeric PITCHInfo contact percentage on pitches outside the zone.
pi_Z-Contact_pct numeric PITCHInfo contact percentage on pitches inside the zone.
pi_Contact_pct numeric PITCHInfo contact percentage.
pi_Zone_pct numeric PITCHInfo percentage of pitches in the strike zone.
pi_Pace numeric PITCHInfo pace (seconds between pitches).
Events integer Batted-ball events with Statcast measurement.
EV numeric Average exit velocity (mph).
LA numeric Average launch angle (degrees).
Barrels integer Barreled batted balls.
Barrel_pct numeric Barrel percentage.
maxEV numeric Maximum exit velocity (mph).
HardHit integer Hard-hit batted balls (95+ mph).
HardHit_pct numeric Hard-hit percentage (95+ mph).
Q numeric Quality of contact / quality score.
TG integer Total games in the span.
TPA integer Total plate appearances in the span.
positionDB character Position code from the database.
position character Position played.
team_name_abb character Team name abbreviation.
teamid integer FanGraphs team ID.
playerTeamId integer FanGraphs player-team ID.
Pos numeric Primary position.
EV90 numeric 90th-percentile exit velocity (mph).
pi_XX_pct numeric PITCHInfo unidentified pitches usage percentage.
pi_vXX numeric PITCHInfo average unidentified pitches velocity.
pi_XX-X numeric PITCHInfo average horizontal movement on unidentified pitches.
pi_XX-Z numeric PITCHInfo average vertical movement on unidentified pitches.
pi_wXX numeric PITCHInfo unidentified pitches linear weight runs.
pi_wXX_C numeric PITCHInfo unidentified pitches linear weight runs per 100 pitches.
phLI numeric Average Leverage Index in pinch-hit appearances.
pi_CS_pct numeric PITCHInfo slow curves usage percentage.
pi_vCS numeric PITCHInfo average slow curves velocity.
pi_CS-X numeric PITCHInfo average horizontal movement on slow curves.
pi_CS-Z numeric PITCHInfo average vertical movement on slow curves.
pi_wCS numeric PITCHInfo slow curves linear weight runs.
pi_wCS_C numeric PITCHInfo slow curves linear weight runs per 100 pitches.
rBTV numeric Regressed base-state team value.
KN_pct numeric Knuckleball percentage (pitch usage).
KNv numeric Average knuckleball velocity.
wKN numeric Knuckleball pitch-type linear weight runs.
wKN_C numeric Knuckleball linear weight runs per 100 pitches.
pfx_KN_pct numeric PITCHf/x knuckleballs usage percentage.
pfx_vKN numeric PITCHf/x average knuckleballs velocity.
pfx_KN-X numeric PITCHf/x average horizontal movement on knuckleballs.
pfx_KN-Z numeric PITCHf/x average vertical movement on knuckleballs.
pfx_wKN numeric PITCHf/x knuckleballs linear weight runs.
pfx_wKN_C numeric PITCHf/x knuckleballs linear weight runs per 100 pitches.
pfx_aaKN numeric PITCHf/x average arsenal value on knuckleballs.
pfx_spKN numeric PITCHf/x Stuff+ value on knuckleballs.
pi_KN_pct numeric PITCHInfo knuckleballs usage percentage.
pi_vKN numeric PITCHInfo average knuckleballs velocity.
pi_KN-X numeric PITCHInfo average horizontal movement on knuckleballs.
pi_KN-Z numeric PITCHInfo average vertical movement on knuckleballs.
pi_wKN numeric PITCHInfo knuckleballs linear weight runs.
pi_wKN_C numeric PITCHInfo knuckleballs linear weight runs per 100 pitches.
rCPTV numeric Regressed catcher pitch-type value.
CFraming numeric Catcher framing runs.
rDGV numeric Regressed defensive game value.
rDSV numeric Regressed defensive stuff value.

Examples

try(fg_batter_leaders(startseason = 2023, endseason = 2023))

Scrape Fielder Leaderboards from FanGraphs

Description

This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.

Usage

fg_fielder_leaders(
  age = "",
  pos = "all",
  stats = "fld",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "1",
  postseason = "",
  sortdir = "default",
  sortstat = "Defense"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "Defense".

Value

A data frame of fielder data.

col_name types description
Season integer Season (YYYY).
team_name character Team name.
xMLBAMID integer MLBAM player ID.
PlayerNameRoute character Player name URL slug used by FanGraphs.
PlayerName character Player name.
playerid integer FanGraphs player ID.
SeasonMin integer First season in the queried span.
SeasonMax integer Last season in the queried span.
Pos character Primary position.
Position character Position played.
G integer Games played.
GS integer Games started.
Inn numeric Innings played in the field.
PO integer Putouts.
A integer Assists.
E integer Errors.
FE integer Fielding errors.
TE integer Throwing errors.
DP integer Double plays.
DPS integer Double plays started.
DPT integer Double plays turned.
DPF integer Double plays finished.
SB integer Stolen bases.
CS integer Caught stealing.
PB integer Passed balls.
WP integer Wild pitches.
FP numeric Fielding percentage.
rSB integer Stolen-base runs (catcher arm).
rGFP integer Good-fielding-play runs.
rSZ numeric Strike-zone (framing) runs.
rCERA integer Catcher-ERA runs.
DRS integer Defensive Runs Saved.
Defense numeric Total defensive value (runs above average).
CStrikes numeric Catcher framing called strikes above average.
CFraming numeric Catcher framing runs.
dFRP integer Double-play component of Fielding Run Prevention.
bFRP integer Bunt component of Fielding Run Prevention.
tFRP integer Throwing component of Fielding Run Prevention.
fFRP integer Framing component of Fielding Run Prevention.
FRP integer Total Fielding Run Prevention.
Q numeric Quality of contact / quality score.
TInn numeric Total innings played in the field.
positionDB character Position code from the database.
teamid integer FanGraphs team ID.
team_name_abb character Team name abbreviation.
playerTeamId integer FanGraphs player-team ID.
rGDP integer Double-play runs.
rPM integer Plus/minus range runs.
BIZ integer Balls hit in defensive zone.
Plays integer Plays made in zone.
RZR numeric Revised Zone Rating.
OOZ integer Plays made out of zone.
DPR numeric Double-play runs (UZR component).
RngR numeric Range runs (UZR component).
ErrR numeric Error runs (UZR component).
UZR numeric Ultimate Zone Rating.
UZR_150 numeric Ultimate Zone Rating per 150 defensive games.
OAA integer Outs Above Average (Statcast).
rFRP integer Range component of Fielding Run Prevention.
aFRP integer Arm component of Fielding Run Prevention.
rARM integer Outfield-arm runs.
ARM numeric Outfield-arm runs (UZR component).
Scp integer Scoops (first-base picks).

Examples

try(fg_fielder_leaders(startseason = 2023, endseason = 2023))

Scrape FanGraphs.com Guts!

Description

Scrape historical FanGraphs Guts! table, wOBA, FIP coefficients and constants

Usage

fg_guts()

Value

Returns a tibble of seasonal constants from FanGraphs

col_name types description
season integer Season (YYYY).
lg_woba numeric League-average wOBA for the season.
woba_scale numeric wOBA scale factor (converts wOBA to runs).
wBB numeric Linear weight (runs) for an unintentional walk.
wHBP numeric Linear weight (runs) for a hit-by-pitch.
w1B numeric Linear weight (runs) for a single.
w2B numeric Linear weight (runs) for a double.
w3B numeric Linear weight (runs) for a triple.
wHR numeric Linear weight (runs) for a home run.
runSB numeric Run value of a stolen base.
runCS numeric Run value of a caught stealing.
lg_r_pa numeric League runs per plate appearance.
lg_r_w numeric League runs per win.
cFIP numeric FIP constant for the season.

Examples

try(fg_guts())

Scrape MiLB game logs for batters from FanGraphs

Description

This function allows you to scrape MiLB game logs for individual batters from FanGraphs.

Usage

fg_milb_batter_game_logs(playerid, year)

Arguments

playerid

The batter's minor league ID from FanGraphs.

year

The season for which game logs should be returned.

Value

Returns a tibble of Minor League batter game logs, one row per game, with the following columns:

col_name types description
Date character Calendar date of the game (YYYY-MM-DD).
Team character Minor league team the batter played for.
Level character Minor league classification level (e.g. (AA), (AAA)).
Opp character Opponent team; leading @ indicates a road game.
G numeric Games played (1 per row).
AB numeric At-bats.
PA numeric Plate appearances.
H numeric Hits.
1B numeric Singles.
2B numeric Doubles.
3B numeric Triples.
HR numeric Home runs.
R numeric Runs scored.
RBI numeric Runs batted in.
BB numeric Walks (bases on balls).
IBB numeric Intentional walks.
SO numeric Strikeouts.
HBP numeric Times hit by pitch.
SF numeric Sacrifice flies.
SH numeric Sacrifice hits (bunts).
GDP numeric Grounded into double plays.
SB numeric Stolen bases.
CS numeric Times caught stealing.
AVG numeric Batting average (H/AB).
BB% numeric Walk rate (BB per plate appearance).
K% numeric Strikeout rate (SO per plate appearance).
BB/K numeric Walk-to-strikeout ratio.
OBP numeric On-base percentage.
SLG numeric Slugging percentage.
OPS numeric On-base plus slugging.
ISO numeric Isolated power (SLG minus AVG).
Spd numeric Bill James Speed Score.
BABIP numeric Batting average on balls in play.
wRC numeric Weighted runs created.
wRAA numeric Weighted runs above average.
wOBA numeric Weighted on-base average.
wRC+ numeric Weighted runs created plus (league/park adjusted, 100=avg).
wBsR numeric Weighted base running runs.
gamedate character Game date as parsed from the source feed.
dh integer Doubleheader game indicator (0 = single game).

Examples

try(fg_milb_batter_game_logs(playerid = "sa3019999", year=2023))

Scrape MiLB game logs for pitchers from FanGraphs

Description

This function allows you to scrape MiLB game logs for individual batters from FanGraphs.com.

Usage

fg_milb_pitcher_game_logs(playerid, year)

Arguments

playerid

The pitcher's minor league ID from FanGraphs.com.

year

The season for which game logs should be returned.

Value

Returns a tibble of Minor League pitcher game logs, one row per game, with the following columns:

col_name types description
Date character Calendar date of the game (YYYY-MM-DD).
Team character Minor league team the pitcher played for.
Level character Minor league classification level (e.g. (AA), (AAA)).
Opp character Opponent team; leading @ indicates a road game.
W numeric Wins.
L numeric Losses.
ERA numeric Earned run average (per 9 innings).
G numeric Games pitched (1 per row).
GS numeric Games started.
QS numeric Quality starts (6+ IP, 3 or fewer earned runs).
CG numeric Complete games.
ShO numeric Shutouts.
SV numeric Saves.
IP numeric Innings pitched.
TBF numeric Total batters faced.
H numeric Hits allowed.
R numeric Runs allowed.
ER numeric Earned runs allowed.
HR numeric Home runs allowed.
BB numeric Walks allowed.
IBB numeric Intentional walks allowed.
HBP numeric Batters hit by pitch.
WP numeric Wild pitches.
BK numeric Balks.
SO numeric Strikeouts.
K/9 numeric Strikeouts per 9 innings.
BB/9 numeric Walks per 9 innings.
K/BB numeric Strikeout-to-walk ratio.
HR/9 numeric Home runs allowed per 9 innings.
K% numeric Strikeout rate (per batter faced).
K-BB% numeric Strikeout rate minus walk rate.
BB% numeric Walk rate (per batter faced).
AVG numeric Opponent batting average allowed.
WHIP numeric Walks plus hits per inning pitched.
BABIP numeric Batting average on balls in play allowed.
LOB% numeric Left-on-base percentage (strand rate).
FIP numeric Fielding independent pitching.
ERA- numeric ERA scaled to league/park (100 = average, lower better).
FIP- numeric FIP scaled to league/park (100 = average, lower better).
xFIP- numeric Expected FIP scaled to league/park (100 = average).
gamedate character Game date as parsed from the source feed.
dh integer Doubleheader game indicator (0 = single game).

Examples

try(fg_milb_pitcher_game_logs(playerid = "sa3020682", year=2023))

Scrape Park Factors from FanGraphs

Description

This function allows you to scrape park factors for a given season from FanGraphs.com.

This function allows you to scrape park factors by handedness from FanGraphs.com for a given single year.

Usage

fg_park(yr)

fg_park_hand(yr)

Arguments

yr

Season for which you want to scrape the park factors.

Value

Returns a tibble of park factors.

col_name types description
season integer Season (YYYY).
home_team character Home team name.
basic_5yr integer Basic 5-year park factor (100 = neutral).
3yr integer 3-year park factor (100 = neutral).
1yr integer 1-year park factor (100 = neutral).
single integer Park factor for singles.
double integer Park factor for doubles.
triple integer Park factor for triples.
hr integer Park factor for home runs.
so integer Park factor for strikeouts.
UIBB integer Park factor for unintentional walks.
GB integer Park factor for ground balls.
FB integer Park factor for fly balls.
LD integer Park factor for line drives.
IFFB integer Park factor for infield fly balls.
FIP integer Park factor applied to FIP.

Returns a tibble of park factors by handedness.

col_name types description
season integer Season (YYYY).
home_team character Home team name.
single_as_LHH integer Singles park factor for left-handed hitters.
single_as_RHH integer Singles park factor for right-handed hitters.
double_as_LHH integer Doubles park factor for left-handed hitters.
double_as_RHH integer Doubles park factor for right-handed hitters.
triple_as_LHH integer Triples park factor for left-handed hitters.
triple_as_RHH integer Triples park factor for right-handed hitters.
hr_as_LHH integer Home run park factor for left-handed hitters.
hr_as_RHH integer Home run park factor for right-handed hitters.

Examples

try(fg_park(2013))


  try(fg_park_hand(2013))

(legacy) Scrape Pitcher Leaderboards from FanGraphs

Description

(legacy) Scrape Pitcher Leaderboards from FanGraphs

Usage

fg_pitch_leaders(
  age = "",
  pos = "all",
  stats = "pit",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of pitcher data.


Scrape Pitcher Game Logs from FanGraphs

Description

This function allows you to scrape game logs by year for a pitcher from FanGraphs.com.

Usage

fg_pitcher_game_logs(playerid, year)

Arguments

playerid

This is the playerid used by FanGraphs for a given player

year

The season for which game logs should be returned (use the YYYY format)

Value

A data frame of pitcher game logs, one row per game, with the following columns:

col_name types description
PlayerName character Player name.
playerid integer FanGraphs player ID.
Date character Calendar date of the game (YYYY-MM-DD).
Opp character Opponent team; leading @ indicates a road game.
teamid integer FanGraphs team ID.
season integer Season year.
Team character Team the player appeared for.
HomeAway character Home/away indicator for the game.
Age integer Player age during the season.
W numeric Wins.
L numeric Losses.
ERA numeric Earned run average.
G numeric Games (1 per row).
GS numeric Games started.
QS numeric Quality starts.
CG numeric Complete games.
ShO numeric Shutouts.
SV numeric Saves.
HLD numeric Holds.
BS numeric Blown saves.
IP numeric Innings pitched.
TBF numeric Total batters faced.
H numeric Hits.
R numeric Runs scored.
ER numeric Earned runs allowed.
HR numeric Home runs.
BB numeric Walks (bases on balls).
IBB numeric Intentional walks.
HBP numeric Times hit by pitch.
WP numeric Wild pitches.
BK numeric Balks.
SO numeric Strikeouts.
K/9 numeric Strikeouts per 9 innings.
BB/9 numeric Walks per 9 innings.
H/9 numeric Hits per 9 innings.
K/BB numeric Strikeout-to-walk ratio.
IFH% numeric Infield-hit rate.
BUH% numeric Bunt-hit rate.
GB numeric Ground balls.
FB numeric Fly balls.
LD numeric Line drives.
IFFB numeric Infield fly balls.
IFH numeric Infield hits.
BU numeric Bunts.
BUH numeric Bunt hits.
K% numeric Strikeout rate.
BB% numeric Walk rate.
K-BB% numeric Strikeout rate minus walk rate.
SIERA numeric Skill-interactive ERA.
HR/9 numeric Home runs per 9 innings.
AVG numeric Batting average.
WHIP numeric Walks plus hits per inning pitched.
BABIP numeric Batting average on balls in play.
LOB% numeric Left-on-base percentage (strand rate).
FIP numeric Fielding independent pitching.
E-F numeric ERA minus FIP.
xFIP numeric Expected fielding independent pitching.
ERA- numeric ERA scaled to league/park (100 = average).
FIP- numeric FIP scaled to league/park (100 = average).
xFIP- numeric xFIP scaled to league/park (100 = average).
GB/FB numeric Ground-ball to fly-ball ratio.
LD% numeric Line-drive rate.
GB% numeric Ground-ball rate.
FB% numeric Fly-ball rate.
IFFB% numeric Infield-fly-ball rate.
HR/FB numeric Home-run-per-fly-ball rate.
RS numeric Run support.
RS/9 numeric Run support per 9 innings.
Balls numeric Balls.
Strikes numeric Strikes.
Pitches numeric Pitches seen.
WPA numeric Win probability added.
-WPA numeric Negative win probability added.
+WPA numeric Positive win probability added.
RE24 numeric Run expectancy based on 24 base-out states.
REW numeric Run expectancy wins.
pLI numeric Average leverage index.
inLI numeric Average leverage index entering games.
gmLI numeric Average leverage index at game entry.
exLI numeric Average leverage index exiting games.
Pulls numeric Times pulled from games.
Games numeric Games appeared in.
WPA/LI numeric Context-neutral win probability added.
Clutch numeric Clutch performance score.
SD numeric Shutdowns.
MD numeric Meltdowns.
FB%1 numeric Fastball usage rate.
FBv numeric Average four-seam fastball velocity (mph).
SL% numeric slider usage rate.
SLv numeric Average slider velocity (mph).
CT% numeric cutter usage rate.
CTv numeric Average cutter velocity (mph).
CB% numeric curveball usage rate.
CBv numeric Average curveball velocity (mph).
SF% numeric split-finger fastball usage rate.
SFv numeric Average split-finger fastball velocity (mph).
XX% numeric unknown/other pitch usage rate.
wFB numeric Total runs above average on the fastball.
wSL numeric Total runs above average on the slider.
wCT numeric Total runs above average on the cutter.
wCB numeric Total runs above average on the curveball.
wSF numeric Total runs above average on the split-finger fastball.
wFB/C numeric Runs above average per 100 fastballs.
wSL/C numeric Runs above average per 100 sliders.
wCT/C numeric Runs above average per 100 cutters.
wCB/C numeric Runs above average per 100 curveballs.
wSF/C numeric Runs above average per 100 split-finger fastballs.
O-Swing% numeric Swing rate on pitches outside the zone.
Z-Swing% numeric Swing rate on pitches in the zone.
Swing% numeric Overall swing rate.
O-Contact% numeric Contact rate on pitches outside the zone.
Z-Contact% numeric Contact rate on pitches in the zone.
Contact% numeric Overall contact rate.
Zone% numeric Rate of pitches in the strike zone.
F-Strike% numeric First-pitch strike rate.
SwStr% numeric Swinging-strike rate.
Pull numeric Pulled batted balls.
Cent numeric Batted balls hit up the middle.
Oppo numeric Opposite-field batted balls.
Soft numeric Soft-hit batted balls.
Med numeric Medium-hit batted balls.
Hard numeric Hard-hit batted balls.
bipCount numeric Balls in play.
Pull% numeric Pulled batted-ball rate.
Cent% numeric Up-the-middle batted-ball rate.
Oppo% numeric Opposite-field batted-ball rate.
Soft% numeric Soft-contact rate.
Med% numeric Medium-contact rate.
Hard% numeric Hard-contact rate.
tERA numeric True ERA (batted-ball based).
GSv2 numeric Game Score (version 2).
pb_o_CU numeric PitchingBot overall grade for the curveball.
pb_s_CU numeric PitchingBot stuff grade for the curveball.
pb_c_CU numeric PitchingBot command grade for the curveball.
pb_o_FF numeric PitchingBot overall grade for the four-seam fastball.
pb_s_FF numeric PitchingBot stuff grade for the four-seam fastball.
pb_c_FF numeric PitchingBot command grade for the four-seam fastball.
pb_o_SI numeric PitchingBot overall grade for the sinker.
pb_s_SI numeric PitchingBot stuff grade for the sinker.
pb_c_SI numeric PitchingBot command grade for the sinker.
pb_o_SL numeric PitchingBot overall grade for the slider.
pb_s_SL numeric PitchingBot stuff grade for the slider.
pb_c_SL numeric PitchingBot command grade for the slider.
pb_o_FC numeric PitchingBot overall grade for the cutter.
pb_s_FC numeric PitchingBot stuff grade for the cutter.
pb_c_FC numeric PitchingBot command grade for the cutter.
pb_o_FS numeric PitchingBot overall grade for the splitter.
pb_s_FS numeric PitchingBot stuff grade for the splitter.
pb_c_FS numeric PitchingBot command grade for the splitter.
pb_overall numeric PitchingBot overall grade.
pb_stuff numeric PitchingBot stuff grade.
pb_command numeric PitchingBot command grade.
pb_xRV100 numeric PitchingBot expected run value per 100 pitches.
pb_ERA numeric PitchingBot ERA estimate.
sp_s_CU numeric Stuff+ grade for the curveball (100 = average).
sp_l_CU numeric Location+ grade for the curveball (100 = average).
sp_p_CU numeric Pitching+ grade for the curveball (100 = average).
sp_s_FF numeric Stuff+ grade for the four-seam fastball (100 = average).
sp_l_FF numeric Location+ grade for the four-seam fastball (100 = average).
sp_p_FF numeric Pitching+ grade for the four-seam fastball (100 = average).
sp_s_SI numeric Stuff+ grade for the sinker (100 = average).
sp_l_SI numeric Location+ grade for the sinker (100 = average).
sp_p_SI numeric Pitching+ grade for the sinker (100 = average).
sp_s_SL numeric Stuff+ grade for the slider (100 = average).
sp_l_SL numeric Location+ grade for the slider (100 = average).
sp_p_SL numeric Pitching+ grade for the slider (100 = average).
sp_s_FC numeric Stuff+ grade for the cutter (100 = average).
sp_l_FC numeric Location+ grade for the cutter (100 = average).
sp_p_FC numeric Pitching+ grade for the cutter (100 = average).
sp_s_FS numeric Stuff+ grade for the splitter (100 = average).
sp_l_FS numeric Location+ grade for the splitter (100 = average).
sp_p_FS numeric Pitching+ grade for the splitter (100 = average).
sp_stuff numeric Overall Stuff+ grade (100 = average).
sp_location numeric Overall Location+ grade (100 = average).
sp_pitching numeric Overall Pitching+ grade (100 = average).
PPTV numeric Pitch-type and framing run value component.
CPTV numeric Pitch-type and framing run value component.
BPTV numeric Pitch-type and framing run value component.
DSV numeric Pitch-type and framing run value component.
DGV numeric Pitch-type and framing run value component.
BTV numeric Pitch-type and framing run value component.
rPPTV numeric Pitch-type and framing run value component.
rBPTV numeric Pitch-type and framing run value component.
EBV numeric Pitch-type and framing run value component.
ESV numeric Pitch-type and framing run value component.
rFTeamV numeric Pitch-type and framing run value component.
rBTeamV numeric Pitch-type and framing run value component.
rTV numeric Pitch-type and framing run value component.
xERA numeric Expected ERA.
pfxFA% numeric PITCHf/x four-seam fastball usage rate.
pfxFC% numeric PITCHf/x cutter usage rate.
pfxFS% numeric PITCHf/x splitter usage rate.
pfxSI% numeric PITCHf/x sinker usage rate.
pfxSL% numeric PITCHf/x slider usage rate.
pfxCU% numeric PITCHf/x curveball usage rate.
pfxSLO% numeric PITCHf/x slurve usage rate.
pfxST% numeric PITCHf/x sweeper usage rate.
pfxCUO% numeric PITCHf/x other curve usage rate.
pfxvFA numeric PITCHf/x average four-seam fastball velocity (mph).
pfxvFC numeric PITCHf/x average cutter velocity (mph).
pfxvFS numeric PITCHf/x average splitter velocity (mph).
pfxvSI numeric PITCHf/x average sinker velocity (mph).
pfxvSL numeric PITCHf/x average slider velocity (mph).
pfxvCU numeric PITCHf/x average curveball velocity (mph).
pfxvSLO numeric PITCHf/x average slurve velocity (mph).
pfxvST numeric PITCHf/x average sweeper velocity (mph).
pfxvCUO numeric PITCHf/x average other curve velocity (mph).
pfxFA-X numeric PITCHf/x horizontal movement of the four-seam fastball (inches).
pfxFC-X numeric PITCHf/x horizontal movement of the cutter (inches).
pfxFS-X numeric PITCHf/x horizontal movement of the splitter (inches).
pfxSI-X numeric PITCHf/x horizontal movement of the sinker (inches).
pfxSL-X numeric PITCHf/x horizontal movement of the slider (inches).
pfxCU-X numeric PITCHf/x horizontal movement of the curveball (inches).
pfxSLO-X numeric PITCHf/x horizontal movement of the slurve (inches).
pfxST-X numeric PITCHf/x horizontal movement of the sweeper (inches).
pfxCUO-X numeric PITCHf/x horizontal movement of the other curve (inches).
pfxFA-Z numeric PITCHf/x vertical movement of the four-seam fastball (inches).
pfxFC-Z numeric PITCHf/x vertical movement of the cutter (inches).
pfxFS-Z numeric PITCHf/x vertical movement of the splitter (inches).
pfxSI-Z numeric PITCHf/x vertical movement of the sinker (inches).
pfxSL-Z numeric PITCHf/x vertical movement of the slider (inches).
pfxCU-Z numeric PITCHf/x vertical movement of the curveball (inches).
pfxSLO-Z numeric PITCHf/x vertical movement of the slurve (inches).
pfxST-Z numeric PITCHf/x vertical movement of the sweeper (inches).
pfxCUO-Z numeric PITCHf/x vertical movement of the other curve (inches).
pfxwFA numeric PITCHf/x total runs above average on the four-seam fastball.
pfxwFC numeric PITCHf/x total runs above average on the cutter.
pfxwFS numeric PITCHf/x total runs above average on the splitter.
pfxwSI numeric PITCHf/x total runs above average on the sinker.
pfxwSL numeric PITCHf/x total runs above average on the slider.
pfxwCU numeric PITCHf/x total runs above average on the curveball.
pfxwSLO numeric PITCHf/x total runs above average on the slurve.
pfxwST numeric PITCHf/x total runs above average on the sweeper.
pfxwCUO numeric PITCHf/x total runs above average on the other curve.
pfxwFA/C numeric PITCHf/x runs above average per 100 four-seam fastballs.
pfxwFC/C numeric PITCHf/x runs above average per 100 cutters.
pfxwFS/C numeric PITCHf/x runs above average per 100 splitters.
pfxwSI/C numeric PITCHf/x runs above average per 100 sinkers.
pfxwSL/C numeric PITCHf/x runs above average per 100 sliders.
pfxwCU/C numeric PITCHf/x runs above average per 100 curveballs.
pfxwSLO/C numeric PITCHf/x runs above average per 100 slurves.
pfxwST/C numeric PITCHf/x runs above average per 100 sweepers.
pfxwCUO/C numeric PITCHf/x runs above average per 100 other curves.
pfxaaFA numeric PITCHf/x average spin/active component on the four-seam fastball.
pfxaaFC numeric PITCHf/x average spin/active component on the cutter.
pfxaaFS numeric PITCHf/x average spin/active component on the splitter.
pfxaaSI numeric PITCHf/x average spin/active component on the sinker.
pfxaaSL numeric PITCHf/x average spin/active component on the slider.
pfxaaCU numeric PITCHf/x average spin/active component on the curveball.
pfxaaSLO numeric PITCHf/x average spin/active component on the slurve.
pfxaaST numeric PITCHf/x average spin/active component on the sweeper.
pfxaaCUO numeric PITCHf/x average spin/active component on the other curve.
pfxspFA numeric PITCHf/x average spin rate on the four-seam fastball (rpm).
pfxspFC numeric PITCHf/x average spin rate on the cutter (rpm).
pfxspFS numeric PITCHf/x average spin rate on the splitter (rpm).
pfxspSI numeric PITCHf/x average spin rate on the sinker (rpm).
pfxspSL numeric PITCHf/x average spin rate on the slider (rpm).
pfxspCU numeric PITCHf/x average spin rate on the curveball (rpm).
pfxspSLO numeric PITCHf/x average spin rate on the slurve (rpm).
pfxspST numeric PITCHf/x average spin rate on the sweeper (rpm).
pfxspCUO numeric PITCHf/x average spin rate on the other curve (rpm).
pfxO-Swing% numeric PITCHf/x Swing rate on pitches outside the zone.
pfxZ-Swing% numeric PITCHf/x Swing rate on pitches in the zone.
pfxSwing% numeric PITCHf/x Overall swing rate.
pfxO-Contact% numeric PITCHf/x Contact rate on pitches outside the zone.
pfxZ-Contact% numeric PITCHf/x Contact rate on pitches in the zone.
pfxContact% numeric PITCHf/x Overall contact rate.
pfxZone% numeric PITCHf/x Rate of pitches in the strike zone.
pfxPace numeric PITCHf/x Average seconds between pitches.
AvgBatSpeed numeric Average bat speed (mph).
FastSwing% numeric Rate of fast swings.
SwingLength numeric Average swing length (feet).
SquaredUpContact% numeric Squared-up rate per contact.
SquaredUpSwing% numeric Squared-up rate per swing.
BlastContact% numeric Blast rate per contact.
BlastSwing% numeric Blast rate per swing.
Swords numeric Swords (especially ugly swinging strikeouts).
CompetitiveSwings numeric Competitive swings.
Tilt numeric Average swing tilt (degrees).
AttackAngle numeric Average attack angle (degrees).
AttackDirection numeric Average attack direction (degrees).
IdealAttackAngle% numeric Rate of swings in the ideal attack-angle range.
DepthInBox numeric Average depth in the batter's box (inches).
DistanceOffPlate numeric Average distance off the plate (inches).
scH-Swing% numeric Statcast heart-zone swing rate.
scH-Contact% numeric Statcast heart-zone contact rate.
scH-Zone% numeric Statcast heart-zone zone rate.
scS-Swing% numeric Statcast shadow-zone swing rate.
scS-Contact% numeric Statcast shadow-zone contact rate.
scS-Zone% numeric Statcast shadow-zone zone rate.
scC-Swing% numeric Statcast chase-zone swing rate.
scC-Contact% numeric Statcast chase-zone contact rate.
scC-Zone% numeric Statcast chase-zone zone rate.
scW-Swing% numeric Statcast waste-zone swing rate.
scW-Contact% numeric Statcast waste-zone contact rate.
scW-Zone% numeric Statcast waste-zone zone rate.
scSI-Swing% numeric Statcast in-zone strike-zone swing rate.
scSI-Contact% numeric Statcast in-zone strike-zone contact rate.
scSI-Zone% numeric Statcast in-zone strike-zone zone rate.
scSO-Swing% numeric Statcast out-of-zone strike-zone swing rate.
scSO-Contact% numeric Statcast out-of-zone strike-zone contact rate.
scSO-Zone% numeric Statcast out-of-zone strike-zone zone rate.
scO-Swing% numeric Statcast out-of-zone-zone swing rate.
scO-Contact% numeric Statcast out-of-zone-zone contact rate.
scO-Zone% numeric Statcast out-of-zone-zone zone rate.
scZ-Swing% numeric Statcast in-zone-zone swing rate.
scZ-Contact% numeric Statcast in-zone-zone contact rate.
scZ-Zone% numeric Statcast in-zone-zone zone rate.
piCU% numeric PITCHInfo curveball usage rate.
piFA% numeric PITCHInfo four-seam fastball usage rate.
piFC% numeric PITCHInfo cutter usage rate.
piFS% numeric PITCHInfo splitter usage rate.
piSI% numeric PITCHInfo sinker usage rate.
piSL% numeric PITCHInfo slider usage rate.
piXX% numeric PITCHInfo unknown/other pitch usage rate.
pivCU numeric PITCHInfo average curveball velocity (mph).
pivFA numeric PITCHInfo average four-seam fastball velocity (mph).
pivFC numeric PITCHInfo average cutter velocity (mph).
pivFS numeric PITCHInfo average splitter velocity (mph).
pivSI numeric PITCHInfo average sinker velocity (mph).
pivSL numeric PITCHInfo average slider velocity (mph).
pivXX numeric PITCHInfo average unknown/other pitch velocity (mph).
piCU-X numeric PITCHInfo horizontal movement of the curveball (inches).
piFA-X numeric PITCHInfo horizontal movement of the four-seam fastball (inches).
piFC-X numeric PITCHInfo horizontal movement of the cutter (inches).
piFS-X numeric PITCHInfo horizontal movement of the splitter (inches).
piSI-X numeric PITCHInfo horizontal movement of the sinker (inches).
piSL-X numeric PITCHInfo horizontal movement of the slider (inches).
piXX-X numeric PITCHInfo horizontal movement of the unknown/other pitch (inches).
piCU-Z numeric PITCHInfo vertical movement of the curveball (inches).
piFA-Z numeric PITCHInfo vertical movement of the four-seam fastball (inches).
piFC-Z numeric PITCHInfo vertical movement of the cutter (inches).
piFS-Z numeric PITCHInfo vertical movement of the splitter (inches).
piSI-Z numeric PITCHInfo vertical movement of the sinker (inches).
piSL-Z numeric PITCHInfo vertical movement of the slider (inches).
piXX-Z numeric PITCHInfo vertical movement of the unknown/other pitch (inches).
piwCU numeric PITCHInfo total runs above average on the curveball.
piwFA numeric PITCHInfo total runs above average on the four-seam fastball.
piwFC numeric PITCHInfo total runs above average on the cutter.
piwFS numeric PITCHInfo total runs above average on the splitter.
piwSI numeric PITCHInfo total runs above average on the sinker.
piwSL numeric PITCHInfo total runs above average on the slider.
piwXX numeric PITCHInfo total runs above average on the unknown/other pitch.
piwCU/C numeric PITCHInfo runs above average per 100 curveballs.
piwFA/C numeric PITCHInfo runs above average per 100 four-seam fastballs.
piwFC/C numeric PITCHInfo runs above average per 100 cutters.
piwFS/C numeric PITCHInfo runs above average per 100 splitters.
piwSI/C numeric PITCHInfo runs above average per 100 sinkers.
piwSL/C numeric PITCHInfo runs above average per 100 sliders.
piwXX/C numeric PITCHInfo runs above average per 100 unknown/other pitchs.
piO-Swing% numeric PITCHInfo Swing rate on pitches outside the zone.
piZ-Swing% numeric PITCHInfo Swing rate on pitches in the zone.
piSwing% numeric PITCHInfo Overall swing rate.
piO-Contact% numeric PITCHInfo Contact rate on pitches outside the zone.
piZ-Contact% numeric PITCHInfo Contact rate on pitches in the zone.
piContact% numeric PITCHInfo Overall contact rate.
piZone% numeric PITCHInfo Rate of pitches in the strike zone.
Events numeric Batted-ball events with Statcast data.
EV numeric Average exit velocity (mph).
LA numeric Average launch angle (degrees).
Barrels numeric Barreled batted balls.
Barrel% numeric Barrel rate (per batted-ball event).
maxEV numeric Maximum exit velocity (mph).
HardHit numeric Hard-hit batted balls (95+ mph).
HardHit% numeric Hard-hit rate (95+ mph).
gamedate character Game date as parsed from the source feed.
dh integer Doubleheader game indicator (0 = single game).

Examples

try(fg_pitcher_game_logs(playerid = "19755", year = 2023))

Scrape Pitcher Leaderboards from FanGraphs

Description

Scrape Pitcher Leaderboards from FanGraphs

Usage

fg_pitcher_leaders(
  age = "",
  pos = "all",
  stats = "pit",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of pitcher data.

col_name types description
Season integer Season (YYYY).
team_name character Team name.
Throws character Throwing handedness (L/R).
xMLBAMID integer MLBAM player ID.
PlayerNameRoute character Player name URL slug used by FanGraphs.
PlayerName character Player name.
playerid integer FanGraphs player ID.
Age integer Player age.
AgeRng character Player age range across the span.
SeasonMin integer First season in the queried span.
SeasonMax integer Last season in the queried span.
W integer Wins.
L integer Losses.
ERA numeric Earned run average.
G integer Games played.
GS integer Games started.
QS integer Quality starts.
CG integer Complete games.
ShO integer Shutouts.
SV integer Saves.
BS integer Blown saves.
IP numeric Innings pitched.
TBF integer Total batters faced.
H integer Hits.
R integer Runs scored.
ER integer Earned runs allowed.
HR integer Home runs.
BB integer Walks (bases on balls).
IBB integer Intentional walks.
HBP integer Hit by pitch.
WP integer Wild pitches.
BK integer Balks.
SO integer Strikeouts.
GB integer Ground balls.
FB integer Fly balls.
LD integer Line drives.
IFFB integer Infield fly balls.
Pitches integer Total pitches seen or thrown.
Balls integer Total balls.
Strikes integer Total strikes.
RS integer Run support.
IFH integer Infield hits.
BU integer Bunts.
BUH integer Bunt hits.
K_9 numeric Strikeouts per nine innings.
BB_9 numeric Walks per nine innings.
K_BB numeric Strikeout-to-walk ratio.
H_9 numeric Hits allowed per nine innings.
HR_9 numeric Home runs allowed per nine innings.
AVG numeric Batting average (or opponent average for pitchers).
WHIP numeric Walks plus hits per inning pitched.
BABIP numeric Batting average on balls in play.
LOB_pct numeric Left-on-base percentage (strand rate).
FIP numeric Fielding Independent Pitching.
GB_FB numeric Ground-ball to fly-ball ratio.
LD_pct numeric Line-drive percentage.
GB_pct numeric Ground-ball percentage.
FB_pct numeric Fly-ball percentage.
IFFB_pct numeric Infield-fly-ball percentage.
HR_FB numeric Home-run-per-fly-ball rate.
IFH_pct numeric Infield-hit percentage.
BUH_pct numeric Bunt-hit percentage.
TTO_pct numeric Three-true-outcomes percentage (BB, K, HR).
CFraming numeric Catcher framing runs.
Starting numeric Starting-pitcher value (runs).
Start_IP numeric Innings pitched as a starter.
RAR numeric Runs Above Replacement.
WAR numeric Wins Above Replacement.
Dollars numeric Estimated market value of production.
RA9-Wins numeric Wins based on runs allowed per nine.
LOB-Wins numeric Wins attributable to strand rate.
BIP-Wins numeric Wins attributable to balls in play.
BS-Wins numeric Wins attributable to sequencing.
tERA numeric True ERA (batted-ball-based ERA estimator).
xFIP numeric Expected Fielding Independent Pitching.
WPA numeric Win Probability Added.
WPA_minus numeric Negative Win Probability Added.
WPA_plus numeric Positive Win Probability Added.
RE24 numeric Run Expectancy based on the 24 base-out states.
REW numeric Run Expectancy Wins.
pLI numeric Average Leverage Index.
inLI numeric Average Leverage Index entering the game.
gmLI numeric Average Leverage Index at game entry.
exLI numeric Average Leverage Index when exiting the game.
Pulls integer Times pulled from the game.
Games integer Games (relief context).
WPA_LI numeric Situational Win Probability Added (WPA divided by Leverage Index).
Clutch numeric Clutch performance relative to context-neutral performance.
FB_pct1 numeric Overall fastball percentage (pitch usage).
FBv numeric Average fastball velocity.
SL_pct numeric Slider percentage (pitch usage).
SLv numeric Average slider velocity.
CT_pct numeric Cutter percentage (pitch usage).
CTv numeric Average cutter velocity.
CB_pct numeric Curveball percentage (pitch usage).
CBv numeric Average curveball velocity.
SF_pct numeric Splitter percentage (pitch usage).
SFv numeric Average splitter velocity.
XX_pct numeric Unidentified-pitch percentage (pitch usage).
wFB numeric Fastball pitch-type linear weight runs.
wSL numeric Slider pitch-type linear weight runs.
wCT numeric Cutter pitch-type linear weight runs.
wCB numeric Curveball pitch-type linear weight runs.
wSF numeric Splitter pitch-type linear weight runs.
wFB_C numeric Fastball linear weight runs per 100 pitches.
wSL_C numeric Slider linear weight runs per 100 pitches.
wCT_C numeric Cutter linear weight runs per 100 pitches.
wCB_C numeric Curveball linear weight runs per 100 pitches.
wSF_C numeric Splitter linear weight runs per 100 pitches.
O-Swing_pct numeric Swing percentage on pitches outside the zone (chase rate).
Z-Swing_pct numeric Swing percentage on pitches inside the zone.
Swing_pct numeric Overall swing percentage.
O-Contact_pct numeric Contact percentage on pitches outside the zone.
Z-Contact_pct numeric Contact percentage on pitches inside the zone.
Contact_pct numeric Overall contact percentage.
Zone_pct numeric Percentage of pitches in the strike zone.
F-Strike_pct numeric First-pitch strike percentage.
SwStr_pct numeric Swinging-strike percentage.
CStr_pct numeric Called-strike percentage.
C+SwStr_pct numeric Combined called- plus swinging-strike percentage.
HLD integer Holds.
SD integer Shutdowns (relief appearances that improved win probability).
MD integer Meltdowns (relief appearances that hurt win probability).
ERA- numeric Park/league-adjusted ERA (100 = average, lower is better).
FIP- numeric Park/league-adjusted FIP (100 = average, lower is better).
xFIP- numeric Park/league-adjusted xFIP (100 = average, lower is better).
K_pct numeric Strikeout rate.
BB_pct numeric Walk rate.
K-BB_pct numeric Strikeout rate minus walk rate.
SIERA numeric Skill-Interactive ERA.
kwERA numeric Strikeout/walk-based ERA estimator.
RS_9 numeric Run support per nine innings.
E-F numeric Difference between ERA and FIP.
Pull integer Balls in play hit to the pull field.
Cent integer Balls in play hit up the middle.
Oppo integer Balls in play hit to the opposite field.
Soft integer Soft-contact balls in play.
Med integer Medium-contact balls in play.
Hard integer Hard-contact balls in play.
bipCount integer Count of balls in play with contact-quality data.
Pull_pct numeric Pull-field percentage.
Cent_pct numeric Up-the-middle percentage.
Oppo_pct numeric Opposite-field percentage.
Soft_pct numeric Soft-contact percentage.
Med_pct numeric Medium-contact percentage.
Hard_pct numeric Hard-contact percentage.
K_9+ numeric Park/league-adjusted strikeouts per nine (100 = average).
BB_9+ numeric Park/league-adjusted walks per nine (100 = average).
K_BB+ numeric Park/league-adjusted strikeout-to-walk ratio (100 = average).
H_9+ numeric Park/league-adjusted hits per nine (100 = average).
HR_9+ numeric Park/league-adjusted home runs per nine (100 = average).
AVG+ numeric Park/league-adjusted batting average (100 = average).
WHIP+ numeric Park/league-adjusted WHIP (100 = average).
BABIP+ numeric Park/league-adjusted BABIP (100 = average).
LOB_pct+ numeric Park/league-adjusted strand rate (100 = average).
K_pct+ numeric Park/league-adjusted strikeout rate (100 = average).
BB_pct+ numeric Park/league-adjusted walk rate (100 = average).
LD_pct+ numeric Park/league-adjusted line-drive rate (100 = average).
GB_pct+ numeric Park/league-adjusted ground-ball rate (100 = average).
FB_pct+ numeric Park/league-adjusted fly-ball rate (100 = average).
HRFB_pct+ numeric Park/league-adjusted home-run-per-fly-ball rate (100 = average).
Pull_pct+ numeric Park/league-adjusted pull rate (100 = average).
Cent_pct+ numeric Park/league-adjusted up-the-middle rate (100 = average).
Oppo_pct+ numeric Park/league-adjusted opposite-field rate (100 = average).
Soft_pct+ numeric Park/league-adjusted soft-contact rate (100 = average).
Med_pct+ numeric Park/league-adjusted medium-contact rate (100 = average).
Hard_pct+ numeric Park/league-adjusted hard-contact rate (100 = average).
xERA numeric Expected ERA (Statcast-based).
pb_o_CH numeric PitchingBot overall grade on changeups.
pb_s_CH numeric PitchingBot stuff grade on changeups.
pb_c_CH numeric PitchingBot command grade on changeups.
pb_o_CU numeric PitchingBot overall grade on curveballs.
pb_s_CU numeric PitchingBot stuff grade on curveballs.
pb_c_CU numeric PitchingBot command grade on curveballs.
pb_o_FF numeric PitchingBot overall grade on four-seam fastballs.
pb_s_FF numeric PitchingBot stuff grade on four-seam fastballs.
pb_c_FF numeric PitchingBot command grade on four-seam fastballs.
pb_o_SI numeric PitchingBot overall grade on sinkers.
pb_s_SI numeric PitchingBot stuff grade on sinkers.
pb_c_SI numeric PitchingBot command grade on sinkers.
pb_o_SL numeric PitchingBot overall grade on sliders.
pb_s_SL numeric PitchingBot stuff grade on sliders.
pb_c_SL numeric PitchingBot command grade on sliders.
pb_o_FC numeric PitchingBot overall grade on cutters.
pb_s_FC numeric PitchingBot stuff grade on cutters.
pb_c_FC numeric PitchingBot command grade on cutters.
pb_overall numeric PitchingBot overall grade.
pb_stuff numeric PitchingBot stuff grade.
pb_command numeric PitchingBot command grade.
pb_xRV100 numeric PitchingBot expected run value per 100 pitches.
pb_ERA numeric PitchingBot-modeled ERA.
sp_s_CH numeric Stuff+ grade on changeups (100 = average).
sp_l_CH numeric Location+ grade on changeups (100 = average).
sp_p_CH numeric Pitching+ grade on changeups (100 = average).
sp_s_CU numeric Stuff+ grade on curveballs (100 = average).
sp_l_CU numeric Location+ grade on curveballs (100 = average).
sp_p_CU numeric Pitching+ grade on curveballs (100 = average).
sp_s_FF numeric Stuff+ grade on four-seam fastballs (100 = average).
sp_l_FF numeric Location+ grade on four-seam fastballs (100 = average).
sp_p_FF numeric Pitching+ grade on four-seam fastballs (100 = average).
sp_s_SI numeric Stuff+ grade on sinkers (100 = average).
sp_l_SI numeric Location+ grade on sinkers (100 = average).
sp_p_SI numeric Pitching+ grade on sinkers (100 = average).
sp_s_SL numeric Stuff+ grade on sliders (100 = average).
sp_l_SL numeric Location+ grade on sliders (100 = average).
sp_p_SL numeric Pitching+ grade on sliders (100 = average).
sp_s_FC numeric Stuff+ grade on cutters (100 = average).
sp_l_FC numeric Location+ grade on cutters (100 = average).
sp_p_FC numeric Pitching+ grade on cutters (100 = average).
sp_stuff numeric Stuff+ overall grade (pitch quality, 100 = average).
sp_location numeric Location+ overall grade (command, 100 = average).
sp_pitching numeric Pitching+ overall grade (Stuff+ and Location+ combined, 100 = average).
PPTV integer Pitch-type pitch values (raw component).
CPTV integer Catcher pitch-type value (raw component).
BPTV integer Batter pitch-type value (raw component).
DSV integer Defensive stuff value (raw component).
DGV integer Defensive game value (raw component).
BTV integer Base-state team value (raw component).
rPPTV numeric Regressed pitch-type pitch values.
rBPTV numeric Regressed batter pitch-type value.
EBV integer Earned-base value (raw component).
ESV integer Earned-strike value (raw component).
rFTeamV numeric Regressed fielding team value.
rBTeamV numeric Regressed base-running team value.
rTV numeric Regressed total team value.
pfx_FA_pct numeric PITCHf/x four-seam fastballs usage percentage.
pfx_FC_pct numeric PITCHf/x cutters usage percentage.
pfx_SI_pct numeric PITCHf/x sinkers usage percentage.
pfx_SL_pct numeric PITCHf/x sliders usage percentage.
pfx_CU_pct numeric PITCHf/x curveballs usage percentage.
pfx_CH_pct numeric PITCHf/x changeups usage percentage.
pfx_ST_pct numeric PITCHf/x sweepers usage percentage.
pfx_CUO_pct numeric PITCHf/x slurves usage percentage.
pfx_vFA numeric PITCHf/x average four-seam fastballs velocity.
pfx_vFC numeric PITCHf/x average cutters velocity.
pfx_vSI numeric PITCHf/x average sinkers velocity.
pfx_vSL numeric PITCHf/x average sliders velocity.
pfx_vCU numeric PITCHf/x average curveballs velocity.
pfx_vCH numeric PITCHf/x average changeups velocity.
pfx_vST numeric PITCHf/x average sweepers velocity.
pfx_vCUO numeric PITCHf/x average slurves velocity.
pfx_FA-X numeric PITCHf/x average horizontal movement on four-seam fastballs.
pfx_FC-X numeric PITCHf/x average horizontal movement on cutters.
pfx_SI-X numeric PITCHf/x average horizontal movement on sinkers.
pfx_SL-X numeric PITCHf/x average horizontal movement on sliders.
pfx_CU-X numeric PITCHf/x average horizontal movement on curveballs.
pfx_CH-X numeric PITCHf/x average horizontal movement on changeups.
pfx_ST-X numeric PITCHf/x average horizontal movement on sweepers.
pfx_CUO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_FA-Z numeric PITCHf/x average vertical movement on four-seam fastballs.
pfx_FC-Z numeric PITCHf/x average vertical movement on cutters.
pfx_SI-Z numeric PITCHf/x average vertical movement on sinkers.
pfx_SL-Z numeric PITCHf/x average vertical movement on sliders.
pfx_CU-Z numeric PITCHf/x average vertical movement on curveballs.
pfx_CH-Z numeric PITCHf/x average vertical movement on changeups.
pfx_ST-Z numeric PITCHf/x average vertical movement on sweepers.
pfx_CUO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_wFA numeric PITCHf/x four-seam fastballs linear weight runs.
pfx_wFC numeric PITCHf/x cutters linear weight runs.
pfx_wSI numeric PITCHf/x sinkers linear weight runs.
pfx_wSL numeric PITCHf/x sliders linear weight runs.
pfx_wCU numeric PITCHf/x curveballs linear weight runs.
pfx_wCH numeric PITCHf/x changeups linear weight runs.
pfx_wST numeric PITCHf/x sweepers linear weight runs.
pfx_wCUO numeric PITCHf/x slurves linear weight runs.
pfx_wFA_C numeric PITCHf/x four-seam fastballs linear weight runs per 100 pitches.
pfx_wFC_C numeric PITCHf/x cutters linear weight runs per 100 pitches.
pfx_wSI_C numeric PITCHf/x sinkers linear weight runs per 100 pitches.
pfx_wSL_C numeric PITCHf/x sliders linear weight runs per 100 pitches.
pfx_wCU_C numeric PITCHf/x curveballs linear weight runs per 100 pitches.
pfx_wCH_C numeric PITCHf/x changeups linear weight runs per 100 pitches.
pfx_wST_C numeric PITCHf/x sweepers linear weight runs per 100 pitches.
pfx_wCUO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_aaFA numeric PITCHf/x average arsenal value on four-seam fastballs.
pfx_aaFC numeric PITCHf/x average arsenal value on cutters.
pfx_aaSI numeric PITCHf/x average arsenal value on sinkers.
pfx_aaSL numeric PITCHf/x average arsenal value on sliders.
pfx_aaCU numeric PITCHf/x average arsenal value on curveballs.
pfx_aaCH numeric PITCHf/x average arsenal value on changeups.
pfx_aaST numeric PITCHf/x average arsenal value on sweepers.
pfx_aaCUO numeric PITCHf/x average arsenal value on slurves.
pfx_spFA numeric PITCHf/x Stuff+ value on four-seam fastballs.
pfx_spFC numeric PITCHf/x Stuff+ value on cutters.
pfx_spSI numeric PITCHf/x Stuff+ value on sinkers.
pfx_spSL numeric PITCHf/x Stuff+ value on sliders.
pfx_spCU numeric PITCHf/x Stuff+ value on curveballs.
pfx_spCH numeric PITCHf/x Stuff+ value on changeups.
pfx_spST numeric PITCHf/x Stuff+ value on sweepers.
pfx_spCUO numeric PITCHf/x Stuff+ value on slurves.
pfx_O-Swing_pct numeric PITCHf/x swing percentage on pitches outside the zone.
pfx_Z-Swing_pct numeric PITCHf/x swing percentage on pitches inside the zone.
pfx_Swing_pct numeric PITCHf/x swing percentage.
pfx_O-Contact_pct numeric PITCHf/x contact percentage on pitches outside the zone.
pfx_Z-Contact_pct numeric PITCHf/x contact percentage on pitches inside the zone.
pfx_Contact_pct numeric PITCHf/x contact percentage.
pfx_Zone_pct numeric PITCHf/x percentage of pitches in the strike zone.
pfx_Pace numeric PITCHf/x pace (seconds between pitches).
AvgBatSpeed numeric Average bat speed (mph).
FastSwing_pct numeric Fast-swing percentage (75+ mph bat speed).
SwingLength numeric Average swing length (feet).
SquaredUpContact_pct numeric Squared-up percentage per batted-ball contact.
SquaredUpSwing_pct numeric Squared-up percentage per swing.
BlastContact_pct numeric Blast percentage per batted-ball contact.
BlastSwing_pct numeric Blast percentage per swing.
Swords integer Swords (awkward, defensive swinging strikes induced).
CompetitiveSwings integer Competitive swings tracked.
Tilt numeric Average swing tilt (degrees).
AttackAngle numeric Average attack angle (degrees).
AttackDirection numeric Average attack direction (degrees).
IdealAttackAngle_pct numeric Percentage of swings in the ideal attack-angle range.
DepthInBox numeric Average batter depth in the box (inches).
DistanceOffPlate numeric Average batter distance off the plate (inches).
scH-Swing_pct numeric Statcast swing percentage on hard-hit pitches.
scH-Contact_pct numeric Statcast contact percentage on hard-hit pitches.
scH-Zone_pct numeric Statcast in-zone percentage on hard-hit pitches.
scS-Swing_pct numeric Statcast swing percentage on slider pitches.
scS-Contact_pct numeric Statcast contact percentage on slider pitches.
scS-Zone_pct numeric Statcast in-zone percentage on slider pitches.
scC-Swing_pct numeric Statcast swing percentage on curveball pitches.
scC-Contact_pct numeric Statcast contact percentage on curveball pitches.
scC-Zone_pct numeric Statcast in-zone percentage on curveball pitches.
scW-Swing_pct numeric Statcast swing percentage on offspeed pitches.
scW-Contact_pct numeric Statcast contact percentage on offspeed pitches.
scW-Zone_pct numeric Statcast in-zone percentage on offspeed pitches.
scSI-Swing_pct numeric Statcast swing percentage on sinker pitches.
scSI-Contact_pct numeric Statcast contact percentage on sinker pitches.
scSI-Zone_pct numeric Statcast in-zone percentage on sinker pitches.
scSO-Swing_pct numeric Statcast swing percentage on softly-hit pitches.
scSO-Contact_pct numeric Statcast contact percentage on softly-hit pitches.
scSO-Zone_pct numeric Statcast in-zone percentage on softly-hit pitches.
scO-Swing_pct numeric Statcast swing percentage on out-of-zone pitches.
scO-Contact_pct numeric Statcast contact percentage on out-of-zone pitches.
scO-Zone_pct numeric Statcast in-zone percentage on out-of-zone pitches.
scZ-Swing_pct numeric Statcast swing percentage on in-zone pitches.
scZ-Contact_pct numeric Statcast contact percentage on in-zone pitches.
scZ-Zone_pct numeric Statcast in-zone percentage on in-zone pitches.
pi_CH_pct numeric PITCHInfo changeups usage percentage.
pi_CU_pct numeric PITCHInfo curveballs usage percentage.
pi_FA_pct numeric PITCHInfo four-seam fastballs usage percentage.
pi_SI_pct numeric PITCHInfo sinkers usage percentage.
pi_SL_pct numeric PITCHInfo sliders usage percentage.
pi_vCH numeric PITCHInfo average changeups velocity.
pi_vCU numeric PITCHInfo average curveballs velocity.
pi_vFA numeric PITCHInfo average four-seam fastballs velocity.
pi_vSI numeric PITCHInfo average sinkers velocity.
pi_vSL numeric PITCHInfo average sliders velocity.
pi_CH-X numeric PITCHInfo average horizontal movement on changeups.
pi_CU-X numeric PITCHInfo average horizontal movement on curveballs.
pi_FA-X numeric PITCHInfo average horizontal movement on four-seam fastballs.
pi_SI-X numeric PITCHInfo average horizontal movement on sinkers.
pi_SL-X numeric PITCHInfo average horizontal movement on sliders.
pi_CH-Z numeric PITCHInfo average vertical movement on changeups.
pi_CU-Z numeric PITCHInfo average vertical movement on curveballs.
pi_FA-Z numeric PITCHInfo average vertical movement on four-seam fastballs.
pi_SI-Z numeric PITCHInfo average vertical movement on sinkers.
pi_SL-Z numeric PITCHInfo average vertical movement on sliders.
pi_wCH numeric PITCHInfo changeups linear weight runs.
pi_wCU numeric PITCHInfo curveballs linear weight runs.
pi_wFA numeric PITCHInfo four-seam fastballs linear weight runs.
pi_wSI numeric PITCHInfo sinkers linear weight runs.
pi_wSL numeric PITCHInfo sliders linear weight runs.
pi_wCH_C numeric PITCHInfo changeups linear weight runs per 100 pitches.
pi_wCU_C numeric PITCHInfo curveballs linear weight runs per 100 pitches.
pi_wFA_C numeric PITCHInfo four-seam fastballs linear weight runs per 100 pitches.
pi_wSI_C numeric PITCHInfo sinkers linear weight runs per 100 pitches.
pi_wSL_C numeric PITCHInfo sliders linear weight runs per 100 pitches.
pi_O-Swing_pct numeric PITCHInfo swing percentage on pitches outside the zone.
pi_Z-Swing_pct numeric PITCHInfo swing percentage on pitches inside the zone.
pi_Swing_pct numeric PITCHInfo swing percentage.
pi_O-Contact_pct numeric PITCHInfo contact percentage on pitches outside the zone.
pi_Z-Contact_pct numeric PITCHInfo contact percentage on pitches inside the zone.
pi_Contact_pct numeric PITCHInfo contact percentage.
pi_Zone_pct numeric PITCHInfo percentage of pitches in the strike zone.
pi_Pace numeric PITCHInfo pace (seconds between pitches).
Events integer Batted-ball events with Statcast measurement.
EV numeric Average exit velocity (mph).
LA numeric Average launch angle (degrees).
Barrels integer Barreled batted balls.
Barrel_pct numeric Barrel percentage.
maxEV numeric Maximum exit velocity (mph).
HardHit integer Hard-hit batted balls (95+ mph).
HardHit_pct numeric Hard-hit percentage (95+ mph).
Q numeric Quality of contact / quality score.
TG integer Total games in the span.
TIP numeric Total innings pitched in the span.
positionDB character Position code from the database.
position character Position played.
team_name_abb character Team name abbreviation.
teamid integer FanGraphs team ID.
playerTeamId integer FanGraphs player-team ID.
EV90 numeric 90th-percentile exit velocity (mph).
CH_pct numeric Changeup percentage (pitch usage).
CHv numeric Average changeup velocity.
wCH numeric Changeup pitch-type linear weight runs.
wCH_C numeric Changeup linear weight runs per 100 pitches.
pfx_SLO_pct numeric PITCHf/x slurves usage percentage.
pfx_vSLO numeric PITCHf/x average slurves velocity.
pfx_SLO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_SLO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_wSLO numeric PITCHf/x slurves linear weight runs.
pfx_wSLO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_aaSLO numeric PITCHf/x average arsenal value on slurves.
pfx_spSLO numeric PITCHf/x Stuff+ value on slurves.
pfx_KC_pct numeric PITCHf/x knuckle-curves usage percentage.
pfx_vKC numeric PITCHf/x average knuckle-curves velocity.
pfx_KC-X numeric PITCHf/x average horizontal movement on knuckle-curves.
pfx_KC-Z numeric PITCHf/x average vertical movement on knuckle-curves.
pfx_wKC numeric PITCHf/x knuckle-curves linear weight runs.
pfx_wKC_C numeric PITCHf/x knuckle-curves linear weight runs per 100 pitches.
pfx_aaKC numeric PITCHf/x average arsenal value on knuckle-curves.
pfx_spKC numeric PITCHf/x Stuff+ value on knuckle-curves.
pi_FC_pct numeric PITCHInfo cutters usage percentage.
pi_vFC numeric PITCHInfo average cutters velocity.
pi_FC-X numeric PITCHInfo average horizontal movement on cutters.
pi_FC-Z numeric PITCHInfo average vertical movement on cutters.
pi_wFC numeric PITCHInfo cutters linear weight runs.
pi_wFC_C numeric PITCHInfo cutters linear weight runs per 100 pitches.
pb_o_KC numeric PitchingBot overall grade on knuckle-curves.
pb_s_KC numeric PitchingBot stuff grade on knuckle-curves.
pb_c_KC numeric PitchingBot command grade on knuckle-curves.
sp_s_KC numeric Stuff+ grade on knuckle-curves (100 = average).
sp_l_KC numeric Location+ grade on knuckle-curves (100 = average).
sp_p_KC numeric Pitching+ grade on knuckle-curves (100 = average).
rBTV numeric Regressed base-state team value.
pb_o_FS numeric PitchingBot overall grade on splitters.
pb_s_FS numeric PitchingBot stuff grade on splitters.
pb_c_FS numeric PitchingBot command grade on splitters.
sp_s_FS numeric Stuff+ grade on splitters (100 = average).
sp_l_FS numeric Location+ grade on splitters (100 = average).
sp_p_FS numeric Pitching+ grade on splitters (100 = average).
pfx_FS_pct numeric PITCHf/x splitters usage percentage.
pfx_vFS numeric PITCHf/x average splitters velocity.
pfx_FS-X numeric PITCHf/x average horizontal movement on splitters.
pfx_FS-Z numeric PITCHf/x average vertical movement on splitters.
pfx_wFS numeric PITCHf/x splitters linear weight runs.
pfx_wFS_C numeric PITCHf/x splitters linear weight runs per 100 pitches.
pfx_aaFS numeric PITCHf/x average arsenal value on splitters.
pfx_spFS numeric PITCHf/x Stuff+ value on splitters.
pi_FS_pct numeric PITCHInfo splitters usage percentage.
pi_vFS numeric PITCHInfo average splitters velocity.
pi_FS-X numeric PITCHInfo average horizontal movement on splitters.
pi_FS-Z numeric PITCHInfo average vertical movement on splitters.
pi_wFS numeric PITCHInfo splitters linear weight runs.
pi_wFS_C numeric PITCHInfo splitters linear weight runs per 100 pitches.
rCPTV numeric Regressed catcher pitch-type value.
KN_pct numeric Knuckleball percentage (pitch usage).
KNv numeric Average knuckleball velocity.
wKN numeric Knuckleball pitch-type linear weight runs.
wKN_C numeric Knuckleball linear weight runs per 100 pitches.
pfx_KN_pct numeric PITCHf/x knuckleballs usage percentage.
pfx_vKN numeric PITCHf/x average knuckleballs velocity.
pfx_KN-X numeric PITCHf/x average horizontal movement on knuckleballs.
pfx_KN-Z numeric PITCHf/x average vertical movement on knuckleballs.
pfx_wKN numeric PITCHf/x knuckleballs linear weight runs.
pfx_wKN_C numeric PITCHf/x knuckleballs linear weight runs per 100 pitches.
pfx_aaKN numeric PITCHf/x average arsenal value on knuckleballs.
pfx_spKN numeric PITCHf/x Stuff+ value on knuckleballs.
pi_KN_pct numeric PITCHInfo knuckleballs usage percentage.
pi_XX_pct numeric PITCHInfo unidentified pitches usage percentage.
pi_vKN numeric PITCHInfo average knuckleballs velocity.
pi_vXX numeric PITCHInfo average unidentified pitches velocity.
pi_KN-X numeric PITCHInfo average horizontal movement on knuckleballs.
pi_XX-X numeric PITCHInfo average horizontal movement on unidentified pitches.
pi_KN-Z numeric PITCHInfo average vertical movement on knuckleballs.
pi_XX-Z numeric PITCHInfo average vertical movement on unidentified pitches.
pi_wKN numeric PITCHInfo knuckleballs linear weight runs.
pi_wXX numeric PITCHInfo unidentified pitches linear weight runs.
pi_wKN_C numeric PITCHInfo knuckleballs linear weight runs per 100 pitches.
pi_wXX_C numeric PITCHInfo unidentified pitches linear weight runs per 100 pitches.
sp_s_FO numeric Stuff+ grade on forkballs/pitch-outs (100 = average).
sp_l_FO numeric Location+ grade on forkballs/pitch-outs (100 = average).
sp_p_FO numeric Pitching+ grade on forkballs/pitch-outs (100 = average).
pfx_FO_pct numeric PITCHf/x forkballs/pitch-outs usage percentage.
pfx_vFO numeric PITCHf/x average forkballs/pitch-outs velocity.
pfx_FO-X numeric PITCHf/x average horizontal movement on forkballs/pitch-outs.
pfx_FO-Z numeric PITCHf/x average vertical movement on forkballs/pitch-outs.
pfx_wFO numeric PITCHf/x forkballs/pitch-outs linear weight runs.
pfx_wFO_C numeric PITCHf/x forkballs/pitch-outs linear weight runs per 100 pitches.
pfx_aaFO numeric PITCHf/x average arsenal value on forkballs/pitch-outs.
pfx_spFO numeric PITCHf/x Stuff+ value on forkballs/pitch-outs.
rDGV numeric Regressed defensive game value.
Relieving numeric Relief-pitcher value (runs).
Relief_IP numeric Innings pitched in relief.
pi_CS_pct numeric PITCHInfo slow curves usage percentage.
pi_vCS numeric PITCHInfo average slow curves velocity.
pi_CS-X numeric PITCHInfo average horizontal movement on slow curves.
pi_CS-Z numeric PITCHInfo average vertical movement on slow curves.
pi_wCS numeric PITCHInfo slow curves linear weight runs.
pi_wCS_C numeric PITCHInfo slow curves linear weight runs per 100 pitches.
pfx_CV_pct numeric PITCHf/x slow curves usage percentage.
pfx_vCV numeric PITCHf/x average slow curves velocity.
pfx_CV-X numeric PITCHf/x average horizontal movement on slow curves.
pfx_CV-Z numeric PITCHf/x average vertical movement on slow curves.
pfx_wCV numeric PITCHf/x slow curves linear weight runs.
pfx_wCV_C numeric PITCHf/x slow curves linear weight runs per 100 pitches.
pfx_aaCV numeric PITCHf/x average arsenal value on slow curves.
pfx_spCV numeric PITCHf/x Stuff+ value on slow curves.
rDSV numeric Regressed defensive stuff value.
pfx_EP_pct numeric PITCHf/x eephus pitches usage percentage.
pfx_vEP numeric PITCHf/x average eephus pitches velocity.
pfx_EP-X numeric PITCHf/x average horizontal movement on eephus pitches.
pfx_EP-Z numeric PITCHf/x average vertical movement on eephus pitches.
pfx_wEP numeric PITCHf/x eephus pitches linear weight runs.
pfx_wEP_C numeric PITCHf/x eephus pitches linear weight runs per 100 pitches.
pfx_aaEP numeric PITCHf/x average arsenal value on eephus pitches.
pfx_spEP numeric PITCHf/x Stuff+ value on eephus pitches.
pfx_SC_pct numeric PITCHf/x screwballs usage percentage.
pfx_vSC numeric PITCHf/x average screwballs velocity.
pfx_SC-X numeric PITCHf/x average horizontal movement on screwballs.
pfx_SC-Z numeric PITCHf/x average vertical movement on screwballs.
pfx_wSC numeric PITCHf/x screwballs linear weight runs.
pfx_wSC_C numeric PITCHf/x screwballs linear weight runs per 100 pitches.
pfx_aaSC numeric PITCHf/x average arsenal value on screwballs.
pfx_spSC numeric PITCHf/x Stuff+ value on screwballs.
pi_SB_pct numeric PITCHInfo slow-balls usage percentage.
pi_vSB numeric PITCHInfo average slow-balls velocity.
pi_SB-X numeric PITCHInfo average horizontal movement on slow-balls.
pi_SB-Z numeric PITCHInfo average vertical movement on slow-balls.
pi_wSB numeric PITCHInfo slow-balls linear weight runs.
pi_wSB_C numeric PITCHInfo slow-balls linear weight runs per 100 pitches.

Examples

try(fg_pitcher_leaders(startseason = 2023, endseason = 2023))

Scrape Team Batter Leaderboards from FanGraphs

Description

This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.

Usage

fg_team_batter(
  age = "",
  pos = "all",
  stats = "bat",
  lg = "all",
  qual = "y",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0,ts",
  pageitems = "1000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of batter data.

col_name types description
Season integer Season (YYYY).
team_name character Team name.
SeasonMin integer First season in the queried span.
SeasonMax integer Last season in the queried span.
G integer Games played.
AB integer At-bats.
PA integer Plate appearances.
H integer Hits.
1B integer Singles.
2B integer Doubles.
3B integer Triples.
HR integer Home runs.
R integer Runs scored.
RBI integer Runs batted in.
BB integer Walks (bases on balls).
IBB integer Intentional walks.
SO integer Strikeouts.
HBP integer Hit by pitch.
SF integer Sacrifice flies.
SH integer Sacrifice hits (bunts).
GDP integer Grounded into double plays.
SB integer Stolen bases.
CS integer Caught stealing.
AVG numeric Batting average (or opponent average for pitchers).
GB integer Ground balls.
FB integer Fly balls.
LD integer Line drives.
IFFB integer Infield fly balls.
Pitches integer Total pitches seen or thrown.
Balls integer Total balls.
Strikes integer Total strikes.
IFH integer Infield hits.
BU integer Bunts.
BUH integer Bunt hits.
BB_pct numeric Walk rate.
K_pct numeric Strikeout rate.
BB_K numeric Walk-to-strikeout ratio.
OBP numeric On-base percentage.
SLG numeric Slugging percentage.
OPS numeric On-base plus slugging.
ISO numeric Isolated power.
BABIP numeric Batting average on balls in play.
GB_FB numeric Ground-ball to fly-ball ratio.
LD_pct numeric Line-drive percentage.
GB_pct numeric Ground-ball percentage.
FB_pct numeric Fly-ball percentage.
IFFB_pct numeric Infield-fly-ball percentage.
HR_FB numeric Home-run-per-fly-ball rate.
IFH_pct numeric Infield-hit percentage.
BUH_pct numeric Bunt-hit percentage.
TTO_pct numeric Three-true-outcomes percentage (BB, K, HR).
wOBA numeric Weighted On-Base Average.
wRAA numeric Weighted Runs Above Average.
wRC numeric Weighted Runs Created.
Batting numeric Batting runs above average.
Fielding numeric Fielding runs above average.
Replacement numeric Replacement-level runs.
Positional numeric Positional adjustment runs.
wLeague numeric League adjustment runs.
CFraming numeric Catcher framing runs.
Defense numeric Total defensive value (runs above average).
Offense numeric Total offensive value (runs above average).
RAR numeric Runs Above Replacement.
WAR numeric Wins Above Replacement.
WAROld numeric Wins Above Replacement (legacy formulation).
Dollars numeric Estimated market value of production.
BaseRunning numeric Base-running runs above average.
Spd numeric Speed Score.
wRC_plus numeric Weighted Runs Created Plus (park/league-adjusted, 100 = average).
wBsR numeric Weighted Base Running runs.
WPA numeric Win Probability Added.
WPA_minus numeric Negative Win Probability Added.
WPA_plus numeric Positive Win Probability Added.
RE24 numeric Run Expectancy based on the 24 base-out states.
REW numeric Run Expectancy Wins.
pLI numeric Average Leverage Index.
phLI numeric Average Leverage Index in pinch-hit appearances.
PH integer Pinch-hit appearances.
WPA_LI numeric Situational Win Probability Added (WPA divided by Leverage Index).
Clutch numeric Clutch performance relative to context-neutral performance.
FBall_pct numeric Overall fastball percentage.
FBv numeric Average fastball velocity.
SL_pct numeric Slider percentage (pitch usage).
SLv numeric Average slider velocity.
CT_pct numeric Cutter percentage (pitch usage).
CTv numeric Average cutter velocity.
CB_pct numeric Curveball percentage (pitch usage).
CBv numeric Average curveball velocity.
CH_pct numeric Changeup percentage (pitch usage).
CHv numeric Average changeup velocity.
SF_pct numeric Splitter percentage (pitch usage).
SFv numeric Average splitter velocity.
XX_pct numeric Unidentified-pitch percentage (pitch usage).
wFB numeric Fastball pitch-type linear weight runs.
wSL numeric Slider pitch-type linear weight runs.
wCT numeric Cutter pitch-type linear weight runs.
wCB numeric Curveball pitch-type linear weight runs.
wCH numeric Changeup pitch-type linear weight runs.
wSF numeric Splitter pitch-type linear weight runs.
wFB_C numeric Fastball linear weight runs per 100 pitches.
wSL_C numeric Slider linear weight runs per 100 pitches.
wCT_C numeric Cutter linear weight runs per 100 pitches.
wCB_C numeric Curveball linear weight runs per 100 pitches.
wCH_C numeric Changeup linear weight runs per 100 pitches.
wSF_C numeric Splitter linear weight runs per 100 pitches.
O-Swing_pct numeric Swing percentage on pitches outside the zone (chase rate).
Z-Swing_pct numeric Swing percentage on pitches inside the zone.
Swing_pct numeric Overall swing percentage.
O-Contact_pct numeric Contact percentage on pitches outside the zone.
Z-Contact_pct numeric Contact percentage on pitches inside the zone.
Contact_pct numeric Overall contact percentage.
Zone_pct numeric Percentage of pitches in the strike zone.
F-Strike_pct numeric First-pitch strike percentage.
SwStr_pct numeric Swinging-strike percentage.
CStr_pct numeric Called-strike percentage.
C+SwStr_pct numeric Combined called- plus swinging-strike percentage.
Pull integer Balls in play hit to the pull field.
Cent integer Balls in play hit up the middle.
Oppo integer Balls in play hit to the opposite field.
Soft integer Soft-contact balls in play.
Med integer Medium-contact balls in play.
Hard integer Hard-contact balls in play.
bipCount integer Count of balls in play with contact-quality data.
Pull_pct numeric Pull-field percentage.
Cent_pct numeric Up-the-middle percentage.
Oppo_pct numeric Opposite-field percentage.
Soft_pct numeric Soft-contact percentage.
Med_pct numeric Medium-contact percentage.
Hard_pct numeric Hard-contact percentage.
UBR numeric Ultimate Base Running runs.
GDPRuns numeric Runs from grounded-into-double-play avoidance.
AVG+ numeric Park/league-adjusted batting average (100 = average).
BB_pct+ numeric Park/league-adjusted walk rate (100 = average).
K_pct+ numeric Park/league-adjusted strikeout rate (100 = average).
OBP+ numeric Park/league-adjusted on-base percentage (100 = average).
SLG+ numeric Park/league-adjusted slugging percentage (100 = average).
ISO+ numeric Park/league-adjusted isolated power (100 = average).
BABIP+ numeric Park/league-adjusted BABIP (100 = average).
LD_pct+ numeric Park/league-adjusted line-drive rate (100 = average).
GB_pct+ numeric Park/league-adjusted ground-ball rate (100 = average).
FB_pct+ numeric Park/league-adjusted fly-ball rate (100 = average).
HRFB_pct+ numeric Park/league-adjusted home-run-per-fly-ball rate (100 = average).
Pull_pct+ numeric Park/league-adjusted pull rate (100 = average).
Cent_pct+ numeric Park/league-adjusted up-the-middle rate (100 = average).
Oppo_pct+ numeric Park/league-adjusted opposite-field rate (100 = average).
Soft_pct+ numeric Park/league-adjusted soft-contact rate (100 = average).
Med_pct+ numeric Park/league-adjusted medium-contact rate (100 = average).
Hard_pct+ numeric Park/league-adjusted hard-contact rate (100 = average).
xwOBA numeric Expected Weighted On-Base Average (Statcast).
xAVG numeric Expected batting average (Statcast).
xSLG numeric Expected slugging percentage (Statcast).
XBR numeric Extra bases taken on the bases, runs above average.
PPTV integer Pitch-type pitch values (raw component).
CPTV integer Catcher pitch-type value (raw component).
BPTV integer Batter pitch-type value (raw component).
DSV integer Defensive stuff value (raw component).
DGV integer Defensive game value (raw component).
BTV integer Base-state team value (raw component).
rPPTV numeric Regressed pitch-type pitch values.
rCPTV numeric Regressed catcher pitch-type value.
rBPTV numeric Regressed batter pitch-type value.
rDGV numeric Regressed defensive game value.
rBTV numeric Regressed base-state team value.
EBV integer Earned-base value (raw component).
ESV integer Earned-strike value (raw component).
rFTeamV numeric Regressed fielding team value.
rBTeamV numeric Regressed base-running team value.
rTV numeric Regressed total team value.
pfx_FA_pct numeric PITCHf/x four-seam fastballs usage percentage.
pfx_FC_pct numeric PITCHf/x cutters usage percentage.
pfx_FS_pct numeric PITCHf/x splitters usage percentage.
pfx_FO_pct numeric PITCHf/x forkballs/pitch-outs usage percentage.
pfx_SI_pct numeric PITCHf/x sinkers usage percentage.
pfx_SL_pct numeric PITCHf/x sliders usage percentage.
pfx_CU_pct numeric PITCHf/x curveballs usage percentage.
pfx_KC_pct numeric PITCHf/x knuckle-curves usage percentage.
pfx_EP_pct numeric PITCHf/x eephus pitches usage percentage.
pfx_CH_pct numeric PITCHf/x changeups usage percentage.
pfx_SC_pct numeric PITCHf/x screwballs usage percentage.
pfx_SLO_pct numeric PITCHf/x slurves usage percentage.
pfx_ST_pct numeric PITCHf/x sweepers usage percentage.
pfx_CUO_pct numeric PITCHf/x slurves usage percentage.
pfx_CV_pct numeric PITCHf/x slow curves usage percentage.
pfx_vFA numeric PITCHf/x average four-seam fastballs velocity.
pfx_vFC numeric PITCHf/x average cutters velocity.
pfx_vFS numeric PITCHf/x average splitters velocity.
pfx_vFO numeric PITCHf/x average forkballs/pitch-outs velocity.
pfx_vSI numeric PITCHf/x average sinkers velocity.
pfx_vSL numeric PITCHf/x average sliders velocity.
pfx_vCU numeric PITCHf/x average curveballs velocity.
pfx_vKC numeric PITCHf/x average knuckle-curves velocity.
pfx_vEP numeric PITCHf/x average eephus pitches velocity.
pfx_vCH numeric PITCHf/x average changeups velocity.
pfx_vSC numeric PITCHf/x average screwballs velocity.
pfx_vSLO numeric PITCHf/x average slurves velocity.
pfx_vST numeric PITCHf/x average sweepers velocity.
pfx_vCUO numeric PITCHf/x average slurves velocity.
pfx_vCV numeric PITCHf/x average slow curves velocity.
pfx_FA-X numeric PITCHf/x average horizontal movement on four-seam fastballs.
pfx_FC-X numeric PITCHf/x average horizontal movement on cutters.
pfx_FS-X numeric PITCHf/x average horizontal movement on splitters.
pfx_FO-X numeric PITCHf/x average horizontal movement on forkballs/pitch-outs.
pfx_SI-X numeric PITCHf/x average horizontal movement on sinkers.
pfx_SL-X numeric PITCHf/x average horizontal movement on sliders.
pfx_CU-X numeric PITCHf/x average horizontal movement on curveballs.
pfx_KC-X numeric PITCHf/x average horizontal movement on knuckle-curves.
pfx_EP-X numeric PITCHf/x average horizontal movement on eephus pitches.
pfx_CH-X numeric PITCHf/x average horizontal movement on changeups.
pfx_SC-X numeric PITCHf/x average horizontal movement on screwballs.
pfx_SLO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_ST-X numeric PITCHf/x average horizontal movement on sweepers.
pfx_CUO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_CV-X numeric PITCHf/x average horizontal movement on slow curves.
pfx_FA-Z numeric PITCHf/x average vertical movement on four-seam fastballs.
pfx_FC-Z numeric PITCHf/x average vertical movement on cutters.
pfx_FS-Z numeric PITCHf/x average vertical movement on splitters.
pfx_FO-Z numeric PITCHf/x average vertical movement on forkballs/pitch-outs.
pfx_SI-Z numeric PITCHf/x average vertical movement on sinkers.
pfx_SL-Z numeric PITCHf/x average vertical movement on sliders.
pfx_CU-Z numeric PITCHf/x average vertical movement on curveballs.
pfx_KC-Z numeric PITCHf/x average vertical movement on knuckle-curves.
pfx_EP-Z numeric PITCHf/x average vertical movement on eephus pitches.
pfx_CH-Z numeric PITCHf/x average vertical movement on changeups.
pfx_SC-Z numeric PITCHf/x average vertical movement on screwballs.
pfx_SLO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_ST-Z numeric PITCHf/x average vertical movement on sweepers.
pfx_CUO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_CV-Z numeric PITCHf/x average vertical movement on slow curves.
pfx_wFA numeric PITCHf/x four-seam fastballs linear weight runs.
pfx_wFC numeric PITCHf/x cutters linear weight runs.
pfx_wFS numeric PITCHf/x splitters linear weight runs.
pfx_wFO numeric PITCHf/x forkballs/pitch-outs linear weight runs.
pfx_wSI numeric PITCHf/x sinkers linear weight runs.
pfx_wSL numeric PITCHf/x sliders linear weight runs.
pfx_wCU numeric PITCHf/x curveballs linear weight runs.
pfx_wKC numeric PITCHf/x knuckle-curves linear weight runs.
pfx_wEP numeric PITCHf/x eephus pitches linear weight runs.
pfx_wCH numeric PITCHf/x changeups linear weight runs.
pfx_wSC numeric PITCHf/x screwballs linear weight runs.
pfx_wSLO numeric PITCHf/x slurves linear weight runs.
pfx_wST numeric PITCHf/x sweepers linear weight runs.
pfx_wCUO numeric PITCHf/x slurves linear weight runs.
pfx_wCV numeric PITCHf/x slow curves linear weight runs.
pfx_wFA_C numeric PITCHf/x four-seam fastballs linear weight runs per 100 pitches.
pfx_wFC_C numeric PITCHf/x cutters linear weight runs per 100 pitches.
pfx_wFS_C numeric PITCHf/x splitters linear weight runs per 100 pitches.
pfx_wFO_C numeric PITCHf/x forkballs/pitch-outs linear weight runs per 100 pitches.
pfx_wSI_C numeric PITCHf/x sinkers linear weight runs per 100 pitches.
pfx_wSL_C numeric PITCHf/x sliders linear weight runs per 100 pitches.
pfx_wCU_C numeric PITCHf/x curveballs linear weight runs per 100 pitches.
pfx_wKC_C numeric PITCHf/x knuckle-curves linear weight runs per 100 pitches.
pfx_wEP_C numeric PITCHf/x eephus pitches linear weight runs per 100 pitches.
pfx_wCH_C numeric PITCHf/x changeups linear weight runs per 100 pitches.
pfx_wSC_C numeric PITCHf/x screwballs linear weight runs per 100 pitches.
pfx_wSLO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_wST_C numeric PITCHf/x sweepers linear weight runs per 100 pitches.
pfx_wCUO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_wCV_C numeric PITCHf/x slow curves linear weight runs per 100 pitches.
pfx_aaFA numeric PITCHf/x average arsenal value on four-seam fastballs.
pfx_aaFC numeric PITCHf/x average arsenal value on cutters.
pfx_aaFS numeric PITCHf/x average arsenal value on splitters.
pfx_aaFO numeric PITCHf/x average arsenal value on forkballs/pitch-outs.
pfx_aaSI numeric PITCHf/x average arsenal value on sinkers.
pfx_aaSL numeric PITCHf/x average arsenal value on sliders.
pfx_aaCU numeric PITCHf/x average arsenal value on curveballs.
pfx_aaKC numeric PITCHf/x average arsenal value on knuckle-curves.
pfx_aaEP numeric PITCHf/x average arsenal value on eephus pitches.
pfx_aaCH numeric PITCHf/x average arsenal value on changeups.
pfx_aaSC numeric PITCHf/x average arsenal value on screwballs.
pfx_aaSLO numeric PITCHf/x average arsenal value on slurves.
pfx_aaST numeric PITCHf/x average arsenal value on sweepers.
pfx_aaCUO numeric PITCHf/x average arsenal value on slurves.
pfx_aaCV numeric PITCHf/x average arsenal value on slow curves.
pfx_spFA numeric PITCHf/x Stuff+ value on four-seam fastballs.
pfx_spFC numeric PITCHf/x Stuff+ value on cutters.
pfx_spFS numeric PITCHf/x Stuff+ value on splitters.
pfx_spFO numeric PITCHf/x Stuff+ value on forkballs/pitch-outs.
pfx_spSI numeric PITCHf/x Stuff+ value on sinkers.
pfx_spSL numeric PITCHf/x Stuff+ value on sliders.
pfx_spCU numeric PITCHf/x Stuff+ value on curveballs.
pfx_spKC numeric PITCHf/x Stuff+ value on knuckle-curves.
pfx_spEP numeric PITCHf/x Stuff+ value on eephus pitches.
pfx_spCH numeric PITCHf/x Stuff+ value on changeups.
pfx_spSC numeric PITCHf/x Stuff+ value on screwballs.
pfx_spSLO numeric PITCHf/x Stuff+ value on slurves.
pfx_spST numeric PITCHf/x Stuff+ value on sweepers.
pfx_spCUO numeric PITCHf/x Stuff+ value on slurves.
pfx_spCV numeric PITCHf/x Stuff+ value on slow curves.
pfx_O-Swing_pct numeric PITCHf/x swing percentage on pitches outside the zone.
pfx_Z-Swing_pct numeric PITCHf/x swing percentage on pitches inside the zone.
pfx_Swing_pct numeric PITCHf/x swing percentage.
pfx_O-Contact_pct numeric PITCHf/x contact percentage on pitches outside the zone.
pfx_Z-Contact_pct numeric PITCHf/x contact percentage on pitches inside the zone.
pfx_Contact_pct numeric PITCHf/x contact percentage.
pfx_Zone_pct numeric PITCHf/x percentage of pitches in the strike zone.
pfx_Pace numeric PITCHf/x pace (seconds between pitches).
AvgBatSpeed numeric Average bat speed (mph).
FastSwing_pct numeric Fast-swing percentage (75+ mph bat speed).
SwingLength numeric Average swing length (feet).
SquaredUpContact_pct numeric Squared-up percentage per batted-ball contact.
SquaredUpSwing_pct numeric Squared-up percentage per swing.
BlastContact_pct numeric Blast percentage per batted-ball contact.
BlastSwing_pct numeric Blast percentage per swing.
Swords integer Swords (awkward, defensive swinging strikes induced).
CompetitiveSwings integer Competitive swings tracked.
Tilt numeric Average swing tilt (degrees).
AttackAngle numeric Average attack angle (degrees).
AttackDirection numeric Average attack direction (degrees).
IdealAttackAngle_pct numeric Percentage of swings in the ideal attack-angle range.
DepthInBox numeric Average batter depth in the box (inches).
DistanceOffPlate numeric Average batter distance off the plate (inches).
scH-Swing_pct numeric Statcast swing percentage on hard-hit pitches.
scH-Contact_pct numeric Statcast contact percentage on hard-hit pitches.
scH-Zone_pct numeric Statcast in-zone percentage on hard-hit pitches.
scS-Swing_pct numeric Statcast swing percentage on slider pitches.
scS-Contact_pct numeric Statcast contact percentage on slider pitches.
scS-Zone_pct numeric Statcast in-zone percentage on slider pitches.
scC-Swing_pct numeric Statcast swing percentage on curveball pitches.
scC-Contact_pct numeric Statcast contact percentage on curveball pitches.
scC-Zone_pct numeric Statcast in-zone percentage on curveball pitches.
scW-Swing_pct numeric Statcast swing percentage on offspeed pitches.
scW-Contact_pct numeric Statcast contact percentage on offspeed pitches.
scW-Zone_pct numeric Statcast in-zone percentage on offspeed pitches.
scSI-Swing_pct numeric Statcast swing percentage on sinker pitches.
scSI-Contact_pct numeric Statcast contact percentage on sinker pitches.
scSI-Zone_pct numeric Statcast in-zone percentage on sinker pitches.
scSO-Swing_pct numeric Statcast swing percentage on softly-hit pitches.
scSO-Contact_pct numeric Statcast contact percentage on softly-hit pitches.
scSO-Zone_pct numeric Statcast in-zone percentage on softly-hit pitches.
scO-Swing_pct numeric Statcast swing percentage on out-of-zone pitches.
scO-Contact_pct numeric Statcast contact percentage on out-of-zone pitches.
scO-Zone_pct numeric Statcast in-zone percentage on out-of-zone pitches.
scZ-Swing_pct numeric Statcast swing percentage on in-zone pitches.
scZ-Contact_pct numeric Statcast contact percentage on in-zone pitches.
scZ-Zone_pct numeric Statcast in-zone percentage on in-zone pitches.
pi_CH_pct numeric PITCHInfo changeups usage percentage.
pi_CU_pct numeric PITCHInfo curveballs usage percentage.
pi_FA_pct numeric PITCHInfo four-seam fastballs usage percentage.
pi_FC_pct numeric PITCHInfo cutters usage percentage.
pi_FS_pct numeric PITCHInfo splitters usage percentage.
pi_SB_pct numeric PITCHInfo slow-balls usage percentage.
pi_SI_pct numeric PITCHInfo sinkers usage percentage.
pi_SL_pct numeric PITCHInfo sliders usage percentage.
pi_vCH numeric PITCHInfo average changeups velocity.
pi_vCU numeric PITCHInfo average curveballs velocity.
pi_vFA numeric PITCHInfo average four-seam fastballs velocity.
pi_vFC numeric PITCHInfo average cutters velocity.
pi_vFS numeric PITCHInfo average splitters velocity.
pi_vSB numeric PITCHInfo average slow-balls velocity.
pi_vSI numeric PITCHInfo average sinkers velocity.
pi_vSL numeric PITCHInfo average sliders velocity.
pi_CH-X numeric PITCHInfo average horizontal movement on changeups.
pi_CU-X numeric PITCHInfo average horizontal movement on curveballs.
pi_FA-X numeric PITCHInfo average horizontal movement on four-seam fastballs.
pi_FC-X numeric PITCHInfo average horizontal movement on cutters.
pi_FS-X numeric PITCHInfo average horizontal movement on splitters.
pi_SB-X numeric PITCHInfo average horizontal movement on slow-balls.
pi_SI-X numeric PITCHInfo average horizontal movement on sinkers.
pi_SL-X numeric PITCHInfo average horizontal movement on sliders.
pi_CH-Z numeric PITCHInfo average vertical movement on changeups.
pi_CU-Z numeric PITCHInfo average vertical movement on curveballs.
pi_FA-Z numeric PITCHInfo average vertical movement on four-seam fastballs.
pi_FC-Z numeric PITCHInfo average vertical movement on cutters.
pi_FS-Z numeric PITCHInfo average vertical movement on splitters.
pi_SB-Z numeric PITCHInfo average vertical movement on slow-balls.
pi_SI-Z numeric PITCHInfo average vertical movement on sinkers.
pi_SL-Z numeric PITCHInfo average vertical movement on sliders.
pi_wCH numeric PITCHInfo changeups linear weight runs.
pi_wCU numeric PITCHInfo curveballs linear weight runs.
pi_wFA numeric PITCHInfo four-seam fastballs linear weight runs.
pi_wFC numeric PITCHInfo cutters linear weight runs.
pi_wFS numeric PITCHInfo splitters linear weight runs.
pi_wSB numeric PITCHInfo slow-balls linear weight runs.
pi_wSI numeric PITCHInfo sinkers linear weight runs.
pi_wSL numeric PITCHInfo sliders linear weight runs.
pi_wCH_C numeric PITCHInfo changeups linear weight runs per 100 pitches.
pi_wCU_C numeric PITCHInfo curveballs linear weight runs per 100 pitches.
pi_wFA_C numeric PITCHInfo four-seam fastballs linear weight runs per 100 pitches.
pi_wFC_C numeric PITCHInfo cutters linear weight runs per 100 pitches.
pi_wFS_C numeric PITCHInfo splitters linear weight runs per 100 pitches.
pi_wSB_C numeric PITCHInfo slow-balls linear weight runs per 100 pitches.
pi_wSI_C numeric PITCHInfo sinkers linear weight runs per 100 pitches.
pi_wSL_C numeric PITCHInfo sliders linear weight runs per 100 pitches.
pi_O-Swing_pct numeric PITCHInfo swing percentage on pitches outside the zone.
pi_Z-Swing_pct numeric PITCHInfo swing percentage on pitches inside the zone.
pi_Swing_pct numeric PITCHInfo swing percentage.
pi_O-Contact_pct numeric PITCHInfo contact percentage on pitches outside the zone.
pi_Z-Contact_pct numeric PITCHInfo contact percentage on pitches inside the zone.
pi_Contact_pct numeric PITCHInfo contact percentage.
pi_Zone_pct numeric PITCHInfo percentage of pitches in the strike zone.
pi_Pace numeric PITCHInfo pace (seconds between pitches).
Events integer Batted-ball events with Statcast measurement.
EV numeric Average exit velocity (mph).
LA numeric Average launch angle (degrees).
Barrels integer Barreled batted balls.
Barrel_pct numeric Barrel percentage.
maxEV numeric Maximum exit velocity (mph).
HardHit integer Hard-hit batted balls (95+ mph).
HardHit_pct numeric Hard-hit percentage (95+ mph).
Q numeric Quality of contact / quality score.
TG integer Total games in the span.
TPA integer Total plate appearances in the span.
positionDB character Position code from the database.
position character Position played.
team_name_abb character Team name abbreviation.
teamid integer FanGraphs team ID.
playerTeamId integer FanGraphs player-team ID.
Pos numeric Primary position.
EV90 numeric 90th-percentile exit velocity (mph).
KN_pct numeric Knuckleball percentage (pitch usage).
KNv numeric Average knuckleball velocity.
wKN numeric Knuckleball pitch-type linear weight runs.
wKN_C numeric Knuckleball linear weight runs per 100 pitches.
pfx_KN_pct numeric PITCHf/x knuckleballs usage percentage.
pfx_vKN numeric PITCHf/x average knuckleballs velocity.
pfx_KN-X numeric PITCHf/x average horizontal movement on knuckleballs.
pfx_KN-Z numeric PITCHf/x average vertical movement on knuckleballs.
pfx_wKN numeric PITCHf/x knuckleballs linear weight runs.
pfx_wKN_C numeric PITCHf/x knuckleballs linear weight runs per 100 pitches.
pfx_aaKN numeric PITCHf/x average arsenal value on knuckleballs.
pfx_spKN numeric PITCHf/x Stuff+ value on knuckleballs.
pi_KN_pct numeric PITCHInfo knuckleballs usage percentage.
pi_XX_pct numeric PITCHInfo unidentified pitches usage percentage.
pi_vKN numeric PITCHInfo average knuckleballs velocity.
pi_vXX numeric PITCHInfo average unidentified pitches velocity.
pi_KN-X numeric PITCHInfo average horizontal movement on knuckleballs.
pi_XX-X numeric PITCHInfo average horizontal movement on unidentified pitches.
pi_KN-Z numeric PITCHInfo average vertical movement on knuckleballs.
pi_XX-Z numeric PITCHInfo average vertical movement on unidentified pitches.
pi_wKN numeric PITCHInfo knuckleballs linear weight runs.
pi_wXX numeric PITCHInfo unidentified pitches linear weight runs.
pi_wKN_C numeric PITCHInfo knuckleballs linear weight runs per 100 pitches.
pi_wXX_C numeric PITCHInfo unidentified pitches linear weight runs per 100 pitches.
pi_CS_pct numeric PITCHInfo slow curves usage percentage.
pi_vCS numeric PITCHInfo average slow curves velocity.
pi_CS-X numeric PITCHInfo average horizontal movement on slow curves.
pi_CS-Z numeric PITCHInfo average vertical movement on slow curves.
pi_wCS numeric PITCHInfo slow curves linear weight runs.
pi_wCS_C numeric PITCHInfo slow curves linear weight runs per 100 pitches.
rDSV numeric Regressed defensive stuff value.

Examples

try(fg_team_batter(startseason = 2015, endseason = 2015, qual = 200))

Scrape Team Fielder Leaderboards from FanGraphs

Description

Scrape Team Fielder Leaderboards from FanGraphs

Usage

fg_team_fielder(
  age = "",
  pos = "all",
  stats = "fld",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0,ts",
  pageitems = "1000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "1",
  postseason = "",
  sortdir = "default",
  sortstat = "Defense"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "Defense".

Value

A data frame of fielder data.

col_name types description
Season integer Season (YYYY).
team_name character Team name.
SeasonMin integer First season in the queried span.
SeasonMax integer Last season in the queried span.
Pos character Primary position.
Position character Position played.
G integer Games played.
GS integer Games started.
Inn integer Innings played in the field.
PO integer Putouts.
A integer Assists.
E integer Errors.
FE integer Fielding errors.
TE integer Throwing errors.
DP integer Double plays.
DPS integer Double plays started.
DPT integer Double plays turned.
DPF integer Double plays finished.
Scp integer Scoops (first-base picks).
SB integer Stolen bases.
CS integer Caught stealing.
PB integer Passed balls.
WP integer Wild pitches.
FP numeric Fielding percentage.
rSB integer Stolen-base runs (catcher arm).
rGDP integer Double-play runs.
rARM integer Outfield-arm runs.
rGFP integer Good-fielding-play runs.
rPM integer Plus/minus range runs.
rSZ numeric Strike-zone (framing) runs.
rTS integer Team-stolen-base runs.
rCERA integer Catcher-ERA runs.
DRS integer Defensive Runs Saved.
BIZ integer Balls hit in defensive zone.
Plays integer Plays made in zone.
RZR numeric Revised Zone Rating.
OOZ integer Plays made out of zone.
ARM numeric Outfield-arm runs (UZR component).
DPR numeric Double-play runs (UZR component).
RngR numeric Range runs (UZR component).
ErrR numeric Error runs (UZR component).
UZR numeric Ultimate Zone Rating.
UZR_150 numeric Ultimate Zone Rating per 150 defensive games.
Defense numeric Total defensive value (runs above average).
CStrikes numeric Catcher framing called strikes above average.
CFraming numeric Catcher framing runs.
OAA integer Outs Above Average (Statcast).
rFRP integer Range component of Fielding Run Prevention.
aFRP integer Arm component of Fielding Run Prevention.
dFRP integer Double-play component of Fielding Run Prevention.
bFRP integer Bunt component of Fielding Run Prevention.
tFRP integer Throwing component of Fielding Run Prevention.
fFRP integer Framing component of Fielding Run Prevention.
FRP integer Total Fielding Run Prevention.
Q numeric Quality of contact / quality score.
TInn numeric Total innings played in the field.
positionDB character Position code from the database.
teamid integer FanGraphs team ID.
team_name_abb character Team name abbreviation.
playerTeamId integer FanGraphs player-team ID.

Examples

try(fg_team_fielder(startseason = 2023, endseason = 2023, qual = 150))

Scrape Team Pitcher Leaderboards from FanGraphs

Description

Scrape Team Pitcher Leaderboards from FanGraphs

Usage

fg_team_pitcher(
  age = "",
  pos = "all",
  stats = "pit",
  lg = "all",
  qual = "y",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0,ts",
  pageitems = "1000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of pitcher data.

col_name types description
Season integer Season (YYYY).
team_name character Team name.
SeasonMin integer First season in the queried span.
SeasonMax integer Last season in the queried span.
W integer Wins.
L integer Losses.
ERA numeric Earned run average.
G integer Games played.
GS integer Games started.
QS integer Quality starts.
CG integer Complete games.
ShO integer Shutouts.
SV integer Saves.
BS integer Blown saves.
IP numeric Innings pitched.
TBF integer Total batters faced.
H integer Hits.
R integer Runs scored.
ER integer Earned runs allowed.
HR integer Home runs.
BB integer Walks (bases on balls).
IBB integer Intentional walks.
HBP integer Hit by pitch.
WP integer Wild pitches.
BK integer Balks.
SO integer Strikeouts.
GB integer Ground balls.
FB integer Fly balls.
LD integer Line drives.
IFFB integer Infield fly balls.
Pitches integer Total pitches seen or thrown.
Balls integer Total balls.
Strikes integer Total strikes.
RS integer Run support.
IFH integer Infield hits.
BU integer Bunts.
BUH integer Bunt hits.
K_9 numeric Strikeouts per nine innings.
BB_9 numeric Walks per nine innings.
K_BB numeric Strikeout-to-walk ratio.
H_9 numeric Hits allowed per nine innings.
HR_9 numeric Home runs allowed per nine innings.
AVG numeric Batting average (or opponent average for pitchers).
WHIP numeric Walks plus hits per inning pitched.
BABIP numeric Batting average on balls in play.
LOB_pct numeric Left-on-base percentage (strand rate).
FIP numeric Fielding Independent Pitching.
GB_FB numeric Ground-ball to fly-ball ratio.
LD_pct numeric Line-drive percentage.
GB_pct numeric Ground-ball percentage.
FB_pct numeric Fly-ball percentage.
IFFB_pct numeric Infield-fly-ball percentage.
HR_FB numeric Home-run-per-fly-ball rate.
IFH_pct numeric Infield-hit percentage.
BUH_pct numeric Bunt-hit percentage.
TTO_pct numeric Three-true-outcomes percentage (BB, K, HR).
CFraming numeric Catcher framing runs.
Starting numeric Starting-pitcher value (runs).
Start_IP numeric Innings pitched as a starter.
Relieving numeric Relief-pitcher value (runs).
Relief_IP numeric Innings pitched in relief.
RAR numeric Runs Above Replacement.
WAR numeric Wins Above Replacement.
Dollars numeric Estimated market value of production.
RA9-Wins numeric Wins based on runs allowed per nine.
LOB-Wins numeric Wins attributable to strand rate.
BIP-Wins numeric Wins attributable to balls in play.
BS-Wins numeric Wins attributable to sequencing.
tERA numeric True ERA (batted-ball-based ERA estimator).
xFIP numeric Expected Fielding Independent Pitching.
WPA numeric Win Probability Added.
WPA_minus numeric Negative Win Probability Added.
WPA_plus numeric Positive Win Probability Added.
RE24 numeric Run Expectancy based on the 24 base-out states.
REW numeric Run Expectancy Wins.
pLI numeric Average Leverage Index.
inLI numeric Average Leverage Index entering the game.
gmLI numeric Average Leverage Index at game entry.
exLI numeric Average Leverage Index when exiting the game.
Pulls integer Times pulled from the game.
Games integer Games (relief context).
WPA_LI numeric Situational Win Probability Added (WPA divided by Leverage Index).
Clutch numeric Clutch performance relative to context-neutral performance.
FBall_pct numeric Overall fastball percentage.
FBv numeric Average fastball velocity.
SL_pct numeric Slider percentage (pitch usage).
SLv numeric Average slider velocity.
CT_pct numeric Cutter percentage (pitch usage).
CTv numeric Average cutter velocity.
CB_pct numeric Curveball percentage (pitch usage).
CBv numeric Average curveball velocity.
CH_pct numeric Changeup percentage (pitch usage).
CHv numeric Average changeup velocity.
SF_pct numeric Splitter percentage (pitch usage).
SFv numeric Average splitter velocity.
XX_pct numeric Unidentified-pitch percentage (pitch usage).
wFB numeric Fastball pitch-type linear weight runs.
wSL numeric Slider pitch-type linear weight runs.
wCT numeric Cutter pitch-type linear weight runs.
wCB numeric Curveball pitch-type linear weight runs.
wCH numeric Changeup pitch-type linear weight runs.
wSF numeric Splitter pitch-type linear weight runs.
wFB_C numeric Fastball linear weight runs per 100 pitches.
wSL_C numeric Slider linear weight runs per 100 pitches.
wCT_C numeric Cutter linear weight runs per 100 pitches.
wCB_C numeric Curveball linear weight runs per 100 pitches.
wCH_C numeric Changeup linear weight runs per 100 pitches.
wSF_C numeric Splitter linear weight runs per 100 pitches.
O-Swing_pct numeric Swing percentage on pitches outside the zone (chase rate).
Z-Swing_pct numeric Swing percentage on pitches inside the zone.
Swing_pct numeric Overall swing percentage.
O-Contact_pct numeric Contact percentage on pitches outside the zone.
Z-Contact_pct numeric Contact percentage on pitches inside the zone.
Contact_pct numeric Overall contact percentage.
Zone_pct numeric Percentage of pitches in the strike zone.
F-Strike_pct numeric First-pitch strike percentage.
SwStr_pct numeric Swinging-strike percentage.
CStr_pct numeric Called-strike percentage.
C+SwStr_pct numeric Combined called- plus swinging-strike percentage.
HLD integer Holds.
SD integer Shutdowns (relief appearances that improved win probability).
MD integer Meltdowns (relief appearances that hurt win probability).
ERA- numeric Park/league-adjusted ERA (100 = average, lower is better).
FIP- numeric Park/league-adjusted FIP (100 = average, lower is better).
xFIP- numeric Park/league-adjusted xFIP (100 = average, lower is better).
K_pct numeric Strikeout rate.
BB_pct numeric Walk rate.
K-BB_pct numeric Strikeout rate minus walk rate.
SIERA numeric Skill-Interactive ERA.
kwERA numeric Strikeout/walk-based ERA estimator.
RS_9 numeric Run support per nine innings.
E-F numeric Difference between ERA and FIP.
Pull integer Balls in play hit to the pull field.
Cent integer Balls in play hit up the middle.
Oppo integer Balls in play hit to the opposite field.
Soft integer Soft-contact balls in play.
Med integer Medium-contact balls in play.
Hard integer Hard-contact balls in play.
bipCount integer Count of balls in play with contact-quality data.
Pull_pct numeric Pull-field percentage.
Cent_pct numeric Up-the-middle percentage.
Oppo_pct numeric Opposite-field percentage.
Soft_pct numeric Soft-contact percentage.
Med_pct numeric Medium-contact percentage.
Hard_pct numeric Hard-contact percentage.
K_9+ numeric Park/league-adjusted strikeouts per nine (100 = average).
BB_9+ numeric Park/league-adjusted walks per nine (100 = average).
K_BB+ numeric Park/league-adjusted strikeout-to-walk ratio (100 = average).
H_9+ numeric Park/league-adjusted hits per nine (100 = average).
HR_9+ numeric Park/league-adjusted home runs per nine (100 = average).
AVG+ numeric Park/league-adjusted batting average (100 = average).
WHIP+ numeric Park/league-adjusted WHIP (100 = average).
BABIP+ numeric Park/league-adjusted BABIP (100 = average).
LOB_pct+ numeric Park/league-adjusted strand rate (100 = average).
K_pct+ numeric Park/league-adjusted strikeout rate (100 = average).
BB_pct+ numeric Park/league-adjusted walk rate (100 = average).
LD_pct+ numeric Park/league-adjusted line-drive rate (100 = average).
GB_pct+ numeric Park/league-adjusted ground-ball rate (100 = average).
FB_pct+ numeric Park/league-adjusted fly-ball rate (100 = average).
HRFB_pct+ numeric Park/league-adjusted home-run-per-fly-ball rate (100 = average).
Pull_pct+ numeric Park/league-adjusted pull rate (100 = average).
Cent_pct+ numeric Park/league-adjusted up-the-middle rate (100 = average).
Oppo_pct+ numeric Park/league-adjusted opposite-field rate (100 = average).
Soft_pct+ numeric Park/league-adjusted soft-contact rate (100 = average).
Med_pct+ numeric Park/league-adjusted medium-contact rate (100 = average).
Hard_pct+ numeric Park/league-adjusted hard-contact rate (100 = average).
xERA numeric Expected ERA (Statcast-based).
pb_o_CH numeric PitchingBot overall grade on changeups.
pb_s_CH numeric PitchingBot stuff grade on changeups.
pb_c_CH numeric PitchingBot command grade on changeups.
pb_o_CU numeric PitchingBot overall grade on curveballs.
pb_s_CU numeric PitchingBot stuff grade on curveballs.
pb_c_CU numeric PitchingBot command grade on curveballs.
pb_o_FF numeric PitchingBot overall grade on four-seam fastballs.
pb_s_FF numeric PitchingBot stuff grade on four-seam fastballs.
pb_c_FF numeric PitchingBot command grade on four-seam fastballs.
pb_o_SI numeric PitchingBot overall grade on sinkers.
pb_s_SI numeric PitchingBot stuff grade on sinkers.
pb_c_SI numeric PitchingBot command grade on sinkers.
pb_o_SL numeric PitchingBot overall grade on sliders.
pb_s_SL numeric PitchingBot stuff grade on sliders.
pb_c_SL numeric PitchingBot command grade on sliders.
pb_o_KC numeric PitchingBot overall grade on knuckle-curves.
pb_s_KC numeric PitchingBot stuff grade on knuckle-curves.
pb_c_KC numeric PitchingBot command grade on knuckle-curves.
pb_o_FC numeric PitchingBot overall grade on cutters.
pb_s_FC numeric PitchingBot stuff grade on cutters.
pb_c_FC numeric PitchingBot command grade on cutters.
pb_o_FS numeric PitchingBot overall grade on splitters.
pb_s_FS numeric PitchingBot stuff grade on splitters.
pb_c_FS numeric PitchingBot command grade on splitters.
pb_overall numeric PitchingBot overall grade.
pb_stuff numeric PitchingBot stuff grade.
pb_command numeric PitchingBot command grade.
pb_xRV100 numeric PitchingBot expected run value per 100 pitches.
pb_ERA numeric PitchingBot-modeled ERA.
sp_s_CH numeric Stuff+ grade on changeups (100 = average).
sp_l_CH numeric Location+ grade on changeups (100 = average).
sp_p_CH numeric Pitching+ grade on changeups (100 = average).
sp_s_CU numeric Stuff+ grade on curveballs (100 = average).
sp_l_CU numeric Location+ grade on curveballs (100 = average).
sp_p_CU numeric Pitching+ grade on curveballs (100 = average).
sp_s_FF numeric Stuff+ grade on four-seam fastballs (100 = average).
sp_l_FF numeric Location+ grade on four-seam fastballs (100 = average).
sp_p_FF numeric Pitching+ grade on four-seam fastballs (100 = average).
sp_s_SI numeric Stuff+ grade on sinkers (100 = average).
sp_l_SI numeric Location+ grade on sinkers (100 = average).
sp_p_SI numeric Pitching+ grade on sinkers (100 = average).
sp_s_SL numeric Stuff+ grade on sliders (100 = average).
sp_l_SL numeric Location+ grade on sliders (100 = average).
sp_p_SL numeric Pitching+ grade on sliders (100 = average).
sp_s_KC numeric Stuff+ grade on knuckle-curves (100 = average).
sp_l_KC numeric Location+ grade on knuckle-curves (100 = average).
sp_p_KC numeric Pitching+ grade on knuckle-curves (100 = average).
sp_s_FC numeric Stuff+ grade on cutters (100 = average).
sp_l_FC numeric Location+ grade on cutters (100 = average).
sp_p_FC numeric Pitching+ grade on cutters (100 = average).
sp_s_FS numeric Stuff+ grade on splitters (100 = average).
sp_l_FS numeric Location+ grade on splitters (100 = average).
sp_p_FS numeric Pitching+ grade on splitters (100 = average).
sp_stuff numeric Stuff+ overall grade (pitch quality, 100 = average).
sp_location numeric Location+ overall grade (command, 100 = average).
sp_pitching numeric Pitching+ overall grade (Stuff+ and Location+ combined, 100 = average).
PPTV integer Pitch-type pitch values (raw component).
CPTV integer Catcher pitch-type value (raw component).
BPTV integer Batter pitch-type value (raw component).
DSV integer Defensive stuff value (raw component).
DGV integer Defensive game value (raw component).
BTV integer Base-state team value (raw component).
rPPTV numeric Regressed pitch-type pitch values.
rBPTV numeric Regressed batter pitch-type value.
rDGV numeric Regressed defensive game value.
rBTV numeric Regressed base-state team value.
EBV integer Earned-base value (raw component).
ESV integer Earned-strike value (raw component).
rFTeamV numeric Regressed fielding team value.
rBTeamV numeric Regressed base-running team value.
rTV numeric Regressed total team value.
pfx_FA_pct numeric PITCHf/x four-seam fastballs usage percentage.
pfx_FC_pct numeric PITCHf/x cutters usage percentage.
pfx_FS_pct numeric PITCHf/x splitters usage percentage.
pfx_SI_pct numeric PITCHf/x sinkers usage percentage.
pfx_SL_pct numeric PITCHf/x sliders usage percentage.
pfx_CU_pct numeric PITCHf/x curveballs usage percentage.
pfx_KC_pct numeric PITCHf/x knuckle-curves usage percentage.
pfx_EP_pct numeric PITCHf/x eephus pitches usage percentage.
pfx_CH_pct numeric PITCHf/x changeups usage percentage.
pfx_SLO_pct numeric PITCHf/x slurves usage percentage.
pfx_ST_pct numeric PITCHf/x sweepers usage percentage.
pfx_CUO_pct numeric PITCHf/x slurves usage percentage.
pfx_vFA numeric PITCHf/x average four-seam fastballs velocity.
pfx_vFC numeric PITCHf/x average cutters velocity.
pfx_vFS numeric PITCHf/x average splitters velocity.
pfx_vSI numeric PITCHf/x average sinkers velocity.
pfx_vSL numeric PITCHf/x average sliders velocity.
pfx_vCU numeric PITCHf/x average curveballs velocity.
pfx_vKC numeric PITCHf/x average knuckle-curves velocity.
pfx_vEP numeric PITCHf/x average eephus pitches velocity.
pfx_vCH numeric PITCHf/x average changeups velocity.
pfx_vSLO numeric PITCHf/x average slurves velocity.
pfx_vST numeric PITCHf/x average sweepers velocity.
pfx_vCUO numeric PITCHf/x average slurves velocity.
pfx_FA-X numeric PITCHf/x average horizontal movement on four-seam fastballs.
pfx_FC-X numeric PITCHf/x average horizontal movement on cutters.
pfx_FS-X numeric PITCHf/x average horizontal movement on splitters.
pfx_SI-X numeric PITCHf/x average horizontal movement on sinkers.
pfx_SL-X numeric PITCHf/x average horizontal movement on sliders.
pfx_CU-X numeric PITCHf/x average horizontal movement on curveballs.
pfx_KC-X numeric PITCHf/x average horizontal movement on knuckle-curves.
pfx_EP-X numeric PITCHf/x average horizontal movement on eephus pitches.
pfx_CH-X numeric PITCHf/x average horizontal movement on changeups.
pfx_SLO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_ST-X numeric PITCHf/x average horizontal movement on sweepers.
pfx_CUO-X numeric PITCHf/x average horizontal movement on slurves.
pfx_FA-Z numeric PITCHf/x average vertical movement on four-seam fastballs.
pfx_FC-Z numeric PITCHf/x average vertical movement on cutters.
pfx_FS-Z numeric PITCHf/x average vertical movement on splitters.
pfx_SI-Z numeric PITCHf/x average vertical movement on sinkers.
pfx_SL-Z numeric PITCHf/x average vertical movement on sliders.
pfx_CU-Z numeric PITCHf/x average vertical movement on curveballs.
pfx_KC-Z numeric PITCHf/x average vertical movement on knuckle-curves.
pfx_EP-Z numeric PITCHf/x average vertical movement on eephus pitches.
pfx_CH-Z numeric PITCHf/x average vertical movement on changeups.
pfx_SLO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_ST-Z numeric PITCHf/x average vertical movement on sweepers.
pfx_CUO-Z numeric PITCHf/x average vertical movement on slurves.
pfx_wFA numeric PITCHf/x four-seam fastballs linear weight runs.
pfx_wFC numeric PITCHf/x cutters linear weight runs.
pfx_wFS numeric PITCHf/x splitters linear weight runs.
pfx_wSI numeric PITCHf/x sinkers linear weight runs.
pfx_wSL numeric PITCHf/x sliders linear weight runs.
pfx_wCU numeric PITCHf/x curveballs linear weight runs.
pfx_wKC numeric PITCHf/x knuckle-curves linear weight runs.
pfx_wEP numeric PITCHf/x eephus pitches linear weight runs.
pfx_wCH numeric PITCHf/x changeups linear weight runs.
pfx_wSLO numeric PITCHf/x slurves linear weight runs.
pfx_wST numeric PITCHf/x sweepers linear weight runs.
pfx_wCUO numeric PITCHf/x slurves linear weight runs.
pfx_wFA_C numeric PITCHf/x four-seam fastballs linear weight runs per 100 pitches.
pfx_wFC_C numeric PITCHf/x cutters linear weight runs per 100 pitches.
pfx_wFS_C numeric PITCHf/x splitters linear weight runs per 100 pitches.
pfx_wSI_C numeric PITCHf/x sinkers linear weight runs per 100 pitches.
pfx_wSL_C numeric PITCHf/x sliders linear weight runs per 100 pitches.
pfx_wCU_C numeric PITCHf/x curveballs linear weight runs per 100 pitches.
pfx_wKC_C numeric PITCHf/x knuckle-curves linear weight runs per 100 pitches.
pfx_wEP_C numeric PITCHf/x eephus pitches linear weight runs per 100 pitches.
pfx_wCH_C numeric PITCHf/x changeups linear weight runs per 100 pitches.
pfx_wSLO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_wST_C numeric PITCHf/x sweepers linear weight runs per 100 pitches.
pfx_wCUO_C numeric PITCHf/x slurves linear weight runs per 100 pitches.
pfx_aaFA numeric PITCHf/x average arsenal value on four-seam fastballs.
pfx_aaFC numeric PITCHf/x average arsenal value on cutters.
pfx_aaFS numeric PITCHf/x average arsenal value on splitters.
pfx_aaSI numeric PITCHf/x average arsenal value on sinkers.
pfx_aaSL numeric PITCHf/x average arsenal value on sliders.
pfx_aaCU numeric PITCHf/x average arsenal value on curveballs.
pfx_aaKC numeric PITCHf/x average arsenal value on knuckle-curves.
pfx_aaEP numeric PITCHf/x average arsenal value on eephus pitches.
pfx_aaCH numeric PITCHf/x average arsenal value on changeups.
pfx_aaSLO numeric PITCHf/x average arsenal value on slurves.
pfx_aaST numeric PITCHf/x average arsenal value on sweepers.
pfx_aaCUO numeric PITCHf/x average arsenal value on slurves.
pfx_spFA numeric PITCHf/x Stuff+ value on four-seam fastballs.
pfx_spFC numeric PITCHf/x Stuff+ value on cutters.
pfx_spFS numeric PITCHf/x Stuff+ value on splitters.
pfx_spSI numeric PITCHf/x Stuff+ value on sinkers.
pfx_spSL numeric PITCHf/x Stuff+ value on sliders.
pfx_spCU numeric PITCHf/x Stuff+ value on curveballs.
pfx_spKC numeric PITCHf/x Stuff+ value on knuckle-curves.
pfx_spEP numeric PITCHf/x Stuff+ value on eephus pitches.
pfx_spCH numeric PITCHf/x Stuff+ value on changeups.
pfx_spSLO numeric PITCHf/x Stuff+ value on slurves.
pfx_spST numeric PITCHf/x Stuff+ value on sweepers.
pfx_spCUO numeric PITCHf/x Stuff+ value on slurves.
pfx_O-Swing_pct numeric PITCHf/x swing percentage on pitches outside the zone.
pfx_Z-Swing_pct numeric PITCHf/x swing percentage on pitches inside the zone.
pfx_Swing_pct numeric PITCHf/x swing percentage.
pfx_O-Contact_pct numeric PITCHf/x contact percentage on pitches outside the zone.
pfx_Z-Contact_pct numeric PITCHf/x contact percentage on pitches inside the zone.
pfx_Contact_pct numeric PITCHf/x contact percentage.
pfx_Zone_pct numeric PITCHf/x percentage of pitches in the strike zone.
pfx_Pace numeric PITCHf/x pace (seconds between pitches).
AvgBatSpeed numeric Average bat speed (mph).
FastSwing_pct numeric Fast-swing percentage (75+ mph bat speed).
SwingLength numeric Average swing length (feet).
SquaredUpContact_pct numeric Squared-up percentage per batted-ball contact.
SquaredUpSwing_pct numeric Squared-up percentage per swing.
BlastContact_pct numeric Blast percentage per batted-ball contact.
BlastSwing_pct numeric Blast percentage per swing.
Swords integer Swords (awkward, defensive swinging strikes induced).
CompetitiveSwings integer Competitive swings tracked.
Tilt numeric Average swing tilt (degrees).
AttackAngle numeric Average attack angle (degrees).
AttackDirection numeric Average attack direction (degrees).
IdealAttackAngle_pct numeric Percentage of swings in the ideal attack-angle range.
DepthInBox numeric Average batter depth in the box (inches).
DistanceOffPlate numeric Average batter distance off the plate (inches).
scH-Swing_pct numeric Statcast swing percentage on hard-hit pitches.
scH-Contact_pct numeric Statcast contact percentage on hard-hit pitches.
scH-Zone_pct numeric Statcast in-zone percentage on hard-hit pitches.
scS-Swing_pct numeric Statcast swing percentage on slider pitches.
scS-Contact_pct numeric Statcast contact percentage on slider pitches.
scS-Zone_pct numeric Statcast in-zone percentage on slider pitches.
scC-Swing_pct numeric Statcast swing percentage on curveball pitches.
scC-Contact_pct numeric Statcast contact percentage on curveball pitches.
scC-Zone_pct numeric Statcast in-zone percentage on curveball pitches.
scW-Swing_pct numeric Statcast swing percentage on offspeed pitches.
scW-Contact_pct numeric Statcast contact percentage on offspeed pitches.
scW-Zone_pct numeric Statcast in-zone percentage on offspeed pitches.
scSI-Swing_pct numeric Statcast swing percentage on sinker pitches.
scSI-Contact_pct numeric Statcast contact percentage on sinker pitches.
scSI-Zone_pct numeric Statcast in-zone percentage on sinker pitches.
scSO-Swing_pct numeric Statcast swing percentage on softly-hit pitches.
scSO-Contact_pct numeric Statcast contact percentage on softly-hit pitches.
scSO-Zone_pct numeric Statcast in-zone percentage on softly-hit pitches.
scO-Swing_pct numeric Statcast swing percentage on out-of-zone pitches.
scO-Contact_pct numeric Statcast contact percentage on out-of-zone pitches.
scO-Zone_pct numeric Statcast in-zone percentage on out-of-zone pitches.
scZ-Swing_pct numeric Statcast swing percentage on in-zone pitches.
scZ-Contact_pct numeric Statcast contact percentage on in-zone pitches.
scZ-Zone_pct numeric Statcast in-zone percentage on in-zone pitches.
pi_CH_pct numeric PITCHInfo changeups usage percentage.
pi_CU_pct numeric PITCHInfo curveballs usage percentage.
pi_FA_pct numeric PITCHInfo four-seam fastballs usage percentage.
pi_FC_pct numeric PITCHInfo cutters usage percentage.
pi_FS_pct numeric PITCHInfo splitters usage percentage.
pi_SI_pct numeric PITCHInfo sinkers usage percentage.
pi_SL_pct numeric PITCHInfo sliders usage percentage.
pi_XX_pct numeric PITCHInfo unidentified pitches usage percentage.
pi_vCH numeric PITCHInfo average changeups velocity.
pi_vCU numeric PITCHInfo average curveballs velocity.
pi_vFA numeric PITCHInfo average four-seam fastballs velocity.
pi_vFC numeric PITCHInfo average cutters velocity.
pi_vFS numeric PITCHInfo average splitters velocity.
pi_vSI numeric PITCHInfo average sinkers velocity.
pi_vSL numeric PITCHInfo average sliders velocity.
pi_vXX numeric PITCHInfo average unidentified pitches velocity.
pi_CH-X numeric PITCHInfo average horizontal movement on changeups.
pi_CU-X numeric PITCHInfo average horizontal movement on curveballs.
pi_FA-X numeric PITCHInfo average horizontal movement on four-seam fastballs.
pi_FC-X numeric PITCHInfo average horizontal movement on cutters.
pi_FS-X numeric PITCHInfo average horizontal movement on splitters.
pi_SI-X numeric PITCHInfo average horizontal movement on sinkers.
pi_SL-X numeric PITCHInfo average horizontal movement on sliders.
pi_XX-X numeric PITCHInfo average horizontal movement on unidentified pitches.
pi_CH-Z numeric PITCHInfo average vertical movement on changeups.
pi_CU-Z numeric PITCHInfo average vertical movement on curveballs.
pi_FA-Z numeric PITCHInfo average vertical movement on four-seam fastballs.
pi_FC-Z numeric PITCHInfo average vertical movement on cutters.
pi_FS-Z numeric PITCHInfo average vertical movement on splitters.
pi_SI-Z numeric PITCHInfo average vertical movement on sinkers.
pi_SL-Z numeric PITCHInfo average vertical movement on sliders.
pi_XX-Z numeric PITCHInfo average vertical movement on unidentified pitches.
pi_wCH numeric PITCHInfo changeups linear weight runs.
pi_wCU numeric PITCHInfo curveballs linear weight runs.
pi_wFA numeric PITCHInfo four-seam fastballs linear weight runs.
pi_wFC numeric PITCHInfo cutters linear weight runs.
pi_wFS numeric PITCHInfo splitters linear weight runs.
pi_wSI numeric PITCHInfo sinkers linear weight runs.
pi_wSL numeric PITCHInfo sliders linear weight runs.
pi_wXX numeric PITCHInfo unidentified pitches linear weight runs.
pi_wCH_C numeric PITCHInfo changeups linear weight runs per 100 pitches.
pi_wCU_C numeric PITCHInfo curveballs linear weight runs per 100 pitches.
pi_wFA_C numeric PITCHInfo four-seam fastballs linear weight runs per 100 pitches.
pi_wFC_C numeric PITCHInfo cutters linear weight runs per 100 pitches.
pi_wFS_C numeric PITCHInfo splitters linear weight runs per 100 pitches.
pi_wSI_C numeric PITCHInfo sinkers linear weight runs per 100 pitches.
pi_wSL_C numeric PITCHInfo sliders linear weight runs per 100 pitches.
pi_wXX_C numeric PITCHInfo unidentified pitches linear weight runs per 100 pitches.
pi_O-Swing_pct numeric PITCHInfo swing percentage on pitches outside the zone.
pi_Z-Swing_pct numeric PITCHInfo swing percentage on pitches inside the zone.
pi_Swing_pct numeric PITCHInfo swing percentage.
pi_O-Contact_pct numeric PITCHInfo contact percentage on pitches outside the zone.
pi_Z-Contact_pct numeric PITCHInfo contact percentage on pitches inside the zone.
pi_Contact_pct numeric PITCHInfo contact percentage.
pi_Zone_pct numeric PITCHInfo percentage of pitches in the strike zone.
pi_Pace numeric PITCHInfo pace (seconds between pitches).
Events integer Batted-ball events with Statcast measurement.
EV numeric Average exit velocity (mph).
LA numeric Average launch angle (degrees).
Barrels integer Barreled batted balls.
Barrel_pct numeric Barrel percentage.
maxEV numeric Maximum exit velocity (mph).
HardHit integer Hard-hit batted balls (95+ mph).
HardHit_pct numeric Hard-hit percentage (95+ mph).
Q numeric Quality of contact / quality score.
TG integer Total games in the span.
TIP numeric Total innings pitched in the span.
positionDB character Position code from the database.
position character Position played.
team_name_abb character Team name abbreviation.
teamid integer FanGraphs team ID.
playerTeamId integer FanGraphs player-team ID.
EV90 numeric 90th-percentile exit velocity (mph).
KN_pct numeric Knuckleball percentage (pitch usage).
KNv numeric Average knuckleball velocity.
wKN numeric Knuckleball pitch-type linear weight runs.
wKN_C numeric Knuckleball linear weight runs per 100 pitches.
rCPTV numeric Regressed catcher pitch-type value.
pfx_CV_pct numeric PITCHf/x slow curves usage percentage.
pfx_vCV numeric PITCHf/x average slow curves velocity.
pfx_CV-X numeric PITCHf/x average horizontal movement on slow curves.
pfx_CV-Z numeric PITCHf/x average vertical movement on slow curves.
pfx_wCV numeric PITCHf/x slow curves linear weight runs.
pfx_wCV_C numeric PITCHf/x slow curves linear weight runs per 100 pitches.
pfx_aaCV numeric PITCHf/x average arsenal value on slow curves.
pfx_spCV numeric PITCHf/x Stuff+ value on slow curves.
pfx_KN_pct numeric PITCHf/x knuckleballs usage percentage.
pfx_vKN numeric PITCHf/x average knuckleballs velocity.
pfx_KN-X numeric PITCHf/x average horizontal movement on knuckleballs.
pfx_KN-Z numeric PITCHf/x average vertical movement on knuckleballs.
pfx_wKN numeric PITCHf/x knuckleballs linear weight runs.
pfx_wKN_C numeric PITCHf/x knuckleballs linear weight runs per 100 pitches.
pfx_aaKN numeric PITCHf/x average arsenal value on knuckleballs.
pfx_spKN numeric PITCHf/x Stuff+ value on knuckleballs.
pi_KN_pct numeric PITCHInfo knuckleballs usage percentage.
pi_vKN numeric PITCHInfo average knuckleballs velocity.
pi_KN-X numeric PITCHInfo average horizontal movement on knuckleballs.
pi_KN-Z numeric PITCHInfo average vertical movement on knuckleballs.
pi_wKN numeric PITCHInfo knuckleballs linear weight runs.
pi_wKN_C numeric PITCHInfo knuckleballs linear weight runs per 100 pitches.
rDSV numeric Regressed defensive stuff value.
pfx_SC_pct numeric PITCHf/x screwballs usage percentage.
pfx_vSC numeric PITCHf/x average screwballs velocity.
pfx_SC-X numeric PITCHf/x average horizontal movement on screwballs.
pfx_SC-Z numeric PITCHf/x average vertical movement on screwballs.
pfx_wSC numeric PITCHf/x screwballs linear weight runs.
pfx_wSC_C numeric PITCHf/x screwballs linear weight runs per 100 pitches.
pfx_aaSC numeric PITCHf/x average arsenal value on screwballs.
pfx_spSC numeric PITCHf/x Stuff+ value on screwballs.
pi_SB_pct numeric PITCHInfo slow-balls usage percentage.
pi_vSB numeric PITCHInfo average slow-balls velocity.
pi_SB-X numeric PITCHInfo average horizontal movement on slow-balls.
pi_SB-Z numeric PITCHInfo average vertical movement on slow-balls.
pi_wSB numeric PITCHInfo slow-balls linear weight runs.
pi_wSB_C numeric PITCHInfo slow-balls linear weight runs per 100 pitches.
pi_CS_pct numeric PITCHInfo slow curves usage percentage.
pi_vCS numeric PITCHInfo average slow curves velocity.
pi_CS-X numeric PITCHInfo average horizontal movement on slow curves.
pi_CS-Z numeric PITCHInfo average vertical movement on slow curves.
pi_wCS numeric PITCHInfo slow curves linear weight runs.
pi_wCS_C numeric PITCHInfo slow curves linear weight runs per 100 pitches.
sp_s_FO numeric Stuff+ grade on forkballs/pitch-outs (100 = average).
sp_l_FO numeric Location+ grade on forkballs/pitch-outs (100 = average).
sp_p_FO numeric Pitching+ grade on forkballs/pitch-outs (100 = average).
pfx_FO_pct numeric PITCHf/x forkballs/pitch-outs usage percentage.
pfx_vFO numeric PITCHf/x average forkballs/pitch-outs velocity.
pfx_FO-X numeric PITCHf/x average horizontal movement on forkballs/pitch-outs.
pfx_FO-Z numeric PITCHf/x average vertical movement on forkballs/pitch-outs.
pfx_wFO numeric PITCHf/x forkballs/pitch-outs linear weight runs.
pfx_wFO_C numeric PITCHf/x forkballs/pitch-outs linear weight runs per 100 pitches.
pfx_aaFO numeric PITCHf/x average arsenal value on forkballs/pitch-outs.
pfx_spFO numeric PITCHf/x Stuff+ value on forkballs/pitch-outs.

Examples

try(fg_team_pitcher(startseason = 2015, endseason = 2015, qual = 150))

Calculate FIP and related metrics for any set of data

Description

This function allows you to calculate FIP and related metrics for any given set of data, provided the right variables are in the data set. The function currently returns both FIP per inning pitched, wOBA against (based on batters faced), and wOBA against per instance of fair contact.

Usage

fip_plus(df)

Arguments

df

A data frame of statistics that includes, at a minimum, the following columns: IP (innings pitched), BF (batters faced), uBB (unintentional walks), HBP (Hit By Pitch), x1B (singles), x2B (doubles), x3B (triples), HR (home runs), AB (at-bats), SH (sacrifice hits), SO (strike outs), and season.

Value

Returns a tibble with the following columns:

col_name types
bbref_id character
season integer
Name character
Age numeric
Level character
Team character
G numeric
GS numeric
W numeric
L numeric
SV numeric
IP numeric
H numeric
R numeric
ER numeric
uBB numeric
BB numeric
SO numeric
HR numeric
HBP numeric
ERA numeric
AB numeric
X1B numeric
X2B numeric
X3B numeric
IBB numeric
GDP numeric
SF numeric
SB numeric
CS numeric
PO numeric
BF numeric
Pit numeric
Str numeric
StL numeric
StS numeric
GB.FB numeric
LD numeric
PU numeric
WHIP numeric
BAbip numeric
SO9 numeric
SO.W numeric
SO_perc numeric
uBB_perc numeric
SO_uBB numeric
FIP numeric
wOBA_against numeric
wOBA_CON_against numeric

Examples

try({
    df <- bref_daily_pitcher("2015-04-05", "2015-04-30")
    fip_plus(df)
  })

(legacy) Retrieve batting orders for a given MLB game

Description

(legacy) Retrieve batting orders for a given MLB game

Usage

get_batting_orders(game_pk, type = "starting")

Arguments

game_pk

The unique game_pk identifier for the game

type

Whether to just return the starting lineup ('starting') or all batters that appeared ('all')

Value

Returns a tibble that includes probable starting pitchers and the home plate umpire for the game_pk requested


(legacy) Retrieve draft pick information by year

Description

(legacy) Retrieve draft pick information by year

Usage

get_draft_mlb(year)

Arguments

year

The year for which to return data

Value

Returns a tibble with information for every draft pick in every round for the year requested


(legacy) Retrieve additional game information for major and minor league games

Description

(legacy) Retrieve additional game information for major and minor league games

Usage

get_game_info_mlb(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble that includes supplemental information, such as weather, official scorer, attendance, etc., for the game_pk provided


(legacy) Download a data frame of supplemental data about MLB games since 2008.

Description

(legacy) Download a data frame of supplemental data about MLB games since 2008.

Usage

get_game_info_sup_petti()

Value

Function returns a tibble with various columns, including:

  • game_pk

  • game_date

  • venue id

  • attendance

  • game temperature

  • wind speed

  • direction

  • start time

  • end time


(legacy) Get MLB Game Info by Date and Level

Description

(legacy) Get MLB Game Info by Date and Level

Usage

get_game_pks_mlb(date, level_ids = c(1))

Arguments

date

The date for which you want to find game_pk values for MLB games

level_ids

A numeric vector with ids for each level where game_pks are desired. See below for a reference of level ids.

Value

Returns a tibble that includes game_pk values and additional information for games scheduled or played


(legacy) Get Play-By-Play Data for NCAA Baseball Games

Description

(legacy) Get Play-By-Play Data for NCAA Baseball Games

(legacy) Get Play-By-Play Data for NCAA Baseball Games

Usage

get_ncaa_baseball_pbp(
  game_info_url = NA_character_,
  game_pbp_url = NA_character_,
  raw_html_to_disk = FALSE,
  raw_html_path = "/",
  read_from_file = FALSE,
  file = NA_character_,
  ...
)

ncaa_baseball_pbp(
  game_info_url = NA_character_,
  game_pbp_url = NA_character_,
  raw_html_to_disk = FALSE,
  raw_html_path = "/",
  read_from_file = FALSE,
  file = NA_character_,
  ...
)

Arguments

game_info_url

The url for the game's boxscore data. This can be found using the ncaa_schedule_info function.

game_pbp_url

The url for the game's play-by-play data. This can be found using the ncaa_schedule_info function.

raw_html_to_disk

Write raw html to disk (saves as {game_pbp_id}.html in raw_html_path directory)

raw_html_path

Directory path to write raw html

read_from_file

Read from raw html on disk

file

File with full path to read raw html

...

Additional arguments passed to an underlying function like httr.

Value

A data frame with play-by-play data for an individual game.

A data frame with play-by-play data for an individual game.


(legacy) Get NCAA Baseball Game Logs

Description

(legacy) Get NCAA Baseball Game Logs

Usage

get_ncaa_game_logs(player_id, year, type = "batting", span = "game", ...)

Arguments

player_id

A player's unique id. Can be found using the get_ncaa_baseball_roster function.

year

The year of interest.

type

The kind of statistics you want to return. Current options are 'batting' or 'pitching'.

span

The span of time; can either be 'game' for game logs in a season, or 'career' which returns seasonal stats for a player's career.

...

Additional arguments passed to an underlying function like httr.

Value

A data frame containing player and school information as well as game by game statistics


(legacy) Retrieve lineups for a given NCAA game via its game_info_url

Description

(legacy) Retrieve lineups for a given NCAA game via its game_info_url

Usage

get_ncaa_lineups(game_info_url = NULL, ...)

Arguments

game_info_url

The unique game info url

...

Additional arguments passed to an underlying function like httr.

Value

Returns a tibble of each school's starting lineup and starting pitcher


(legacy) Get Park Effects for NCAA Baseball Teams

Description

(legacy) Get Park Effects for NCAA Baseball Teams

Usage

get_ncaa_park_factor(team_id, years, type = "conference", ...)

Arguments

team_id

The team's unique NCAA id.

years

The season or seasons (i.e. use 2016 for the 2015-2016 season, etc., limited to just 2013-2023 seasons).

type

default is conference. the conference parameter adjusts for the conference the school plays in, the division parameter calculates based on the division the school plays in 1,2,or 3. Defaults to 'conference'.

...

Additional arguments passed to an underlying function like httr.

Value

A data frame with the following fields: school, home_game, away_game, runs_scored_home, runs_allowed_home, run_scored_away, runs_allowed_away, base_pf (base park factor), home_game_adj (an adjustment for the percentage of home games played) final_pf (park factor after adjustments)


(legacy) Get Schedule and Results for NCAA Baseball Teams

Description

(legacy) Get Schedule and Results for NCAA Baseball Teams

Usage

get_ncaa_schedule_info(team_id = NULL, year = NULL, pbp_links = FALSE, ...)

Arguments

team_id

The team's unique NCAA id.

year

The season (i.e. use 2016 for the 2015-2016 season, etc.)

pbp_links

Logical parameter to run process for scraping play_by_play urls for each game

...

Additional arguments passed to an underlying function like httr.

Value

A data frame with the following fields: date, opponent, result, score, innings (if more than regulation), and the url for the game itself.


(legacy) Acquire pitch-by-pitch data for Major and Minor League games

Description

(legacy) Acquire pitch-by-pitch data for Major and Minor League games

(legacy) Acquire pitch-by-pitch data for Major and Minor League games

Usage

get_pbp_mlb(game_pk)

get_pbp_mlb(game_pk)

Arguments

game_pk

The date for which you want to find game_pk values for MLB games

Value

Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch level.

Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch level.


(legacy) Retrieve probable starters for a given MLB game

Description

(legacy) Retrieve probable starters for a given MLB game

Usage

get_probables_mlb(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble that includes probable starting pitchers and the home plate umpire for the game_pk requested


(legacy) Get, Parse, and Format Retrosheet Event and Roster Files

Description

(legacy) Get, Parse, and Format Retrosheet Event and Roster Files

Usage

get_retrosheet_data(
  path_to_directory = NULL,
  years_to_acquire = most_recent_mlb_season() - 1,
  sequence_years = FALSE
)

Arguments

path_to_directory

(default: NULL) A file path that if set, either:

  1. creates a new directory, or

  2. uses the path to an existing directory

years_to_acquire

(format: YYYY) The seasons to collect. Single, multiple, and sequential years can be passed. If passing multiple years, enclose in a vector (i.e. c(2017,2018)). Defaults to most_recent_mlb_season().

sequence_years

(logical, default: FALSE): If the seasons passed in the years_to_acquire parameter should be sequenced so that the function returns all years including and between the vector passed, set the argument to TRUE. Defaults to FALSE.

Value

If path_to_directory is not set (default), the process will return a named list of tibbles: 'events' and 'rosters' for each season provided to years_to_acquire If path_to_directory is set, will also write two csv files to the unzipped directory: 1) a combined csv of the event data for a given year and 2) a combined csv of each team's roster for each year provided to years_to_acquire


(legacy) Download a data frame of all umpires and their MLBAM IDs for games since 2008

Description

(legacy) Download a data frame of all umpires and their MLBAM IDs for games since 2008

Usage

get_umpire_ids_petti()

Value

Function returns a tibble with the following columns:

  • id

  • position,

  • name

  • game_pk

  • game_date


Generate spray charts with ggplot2

Description

This function allows you to create spray charts with ggplots given a data frame with batted ball location coordinates.

Usage

ggspraychart(
  data,
  x_value = "hc_x",
  y_value = "-hc_y",
  fill_value = NULL,
  fill_palette = NULL,
  fill_legend_title = NULL,
  density = FALSE,
  bin_size = 15,
  point_alpha = 0.75,
  point_size = 2,
  frame = NULL
)

Arguments

data

A data frame that includes batted ball coordinates. Typically, this coordinates will come from the GameDay xml feed or downloads from baseballsavant.com

x_value

The x coordindate. Typically hc_x.

y_value

The y coordinate. Typically hc_y. You generally need the inverse or negative of the hc_y values, so it is recommended you calculate before plotting.

fill_value

The categorical variable that you want the geom_points to base the fill on. Pass as a string. If left blank, defaults to blue.

fill_palette

An object containing a customer palette to be used with ggplot2::scale_fill_manual.

fill_legend_title

A string containing a custom legend title to be used with ggplot2::scale_fill_manual.

density

Chooses between a 2d density plot or a point plot. Defaults to FALSE.

bin_size

Size of bins used when building a density plot. Defaults to 15.

point_alpha

Alpha value whenever geom_point is used. Defaults to .75. Recommend .3 for density plots. To remove points on density points set use point_alpha = 0.

point_size

Set the size of geom_point if used.

frame

Variable to use as the frame argument if using gganimate to create animated plots. For density plots be sure your variable is a factor.

Details

ggspraychart(df, x_value = "hc_x", y_value = "-hc_y", fill_value = "events")

Value

A plot of the spraychart for the supplied dataset


Label Statcast data as imputed

Description

Based on a series of heuristics, this function attempts to label Statcast data for which the launch angle and speed have been imputed.

Usage

label_statcast_imputed_data(
  statcast_df,
  impute_file = NULL,
  inverse_precision = 10000
)

Arguments

statcast_df

A dataframe containing Statcast batted ball data

impute_file

A CSV file giving the launch angle, launch speed, bb_type, events fields to label as imputed. if NULL then it's read from the extdata folder of the package.

inverse_precision

inverse of how many digits to truncate the launch angle and speed to for comparison. Default is 10000, i.e. keep 4 digits of precision.

Value

A copy of the input dataframe with the same Statcast pitch-level columns produced by statcast_search() (see that function's return value for the full column-by-column reference), with three columns appended:

col_name types description
ila integer Launch angle truncated to integer precision (launch_angle * inverse_precision), used as a join key against the impute table.
ils integer Launch speed truncated to integer precision (launch_speed * inverse_precision), used as a join key against the impute table.
imputed numeric 1 if the launch angle and launch speed are likely imputed, 0 otherwise.

Examples

try({
    statcast_df <- statcast_search("2017-05-01", "2017-05-02")
    sc_df <- label_statcast_imputed_data(statcast_df)
    mean(sc_df$imputed)
  })

Generate linear weight values for events using Baseball Savant data

Description

This function allows a user to generate linear weight values for events using Baseball Savant data. Output includes both linear weights above average and linear weights above outs for home runs, triples, doubles, singles, walks, hit by pitches, and outs.

Usage

linear_weights_savant(df, level = "plate appearance")

Arguments

df

A data frame generated from Baseball Savant that has been run through the run_expectancy_code() function.

level

Whether to calculate linear weights the plate appearance or pitch level. Defaults to 'plate appearance'.

Value

Returns a tibble with the following columns:

col_name types description
events character Event type (e.g. home_run, triple, double, single, walk, hit_by_pitch, outs).
linear_weights_above_average numeric Average change in run expectancy (RE24) for the event, i.e. linear weight above average.
linear_weights_above_outs numeric Linear weight expressed above the value of an out (above-average value plus the absolute out value).

Examples

try({
   df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15", 
                         playerid = 621043, player_type = 'batter') 
   df <- run_expectancy_code(df, level = "plate appearances")
   linear_weights_savant(df, level = "plate appearance")
 })

baseballr Data Loader Overview

Description

  • load_umpire_ids(): Download a data frame of all umpires and their mlbamids for games since 2008.

  • load_game_info_sup(): Download a data frame of supplemental data about MLB games since 2008.

  • load_ncaa_baseball_pbp(): Load cleaned NCAA baseball play-by-play data from the baseballr data repo.

  • load_ncaa_baseball_schedule(): Load cleaned NCAA baseball schedule from the baseballr data repo.

  • load_ncaa_baseball_season_ids(): Load cleaned NCAA men's college baseball season IDs from the baseballr data repo.

  • load_ncaa_baseball_teams(): Load cleaned NCAA men's college baseball teams from the baseballr data repo.

Details

baseballr Data

These functions load cleaned MLB and NCAA baseball data from the baseballr data repository.


Download a data frame of supplemental data about MLB games since 2008.

Description

Download a data frame of supplemental data about MLB games since 2008.

Usage

load_game_info_sup()

Value

Function returns a tibble with various columns, including:

  • game_pk

  • game_date

  • venue id

  • attendance

  • game temperature

  • wind speed

  • direction

  • start time

  • end time

Examples

try(load_game_info_sup())

Load cleaned NCAA baseball play-by-play data from the baseballr data repo

Description

helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots

Usage

load_ncaa_baseball_pbp(
  seasons = most_recent_ncaa_baseball_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

A vector of 4-digit years associated with given NCAA college baseball seasons. (Min: 2022)

...

Additional arguments passed to an underlying function that writes the season data into a database.

dbConnection

A DBIConnection object, as returned by

tablename

The name of the schedule data table within the database

Value

Returns a tibble

Examples

try(load_ncaa_baseball_pbp(seasons = 2021))

Load cleaned NCAA baseball schedule from the baseballr data repo

Description

helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots

Usage

load_ncaa_baseball_schedule(
  seasons = most_recent_ncaa_baseball_season(),
  ...,
  dbConnection = NULL,
  tablename = NULL
)

Arguments

seasons

A vector of 4-digit years associated with given NCAA college baseball seasons. (Min: 2012)

...

Additional arguments passed to an underlying function that writes the season data into a database.

dbConnection

A DBIConnection object, as returned by

tablename

The name of the schedule data table within the database

Value

Returns a tibble

Examples

try(load_ncaa_baseball_schedule(seasons = 2022))

Load cleaned NCAA men's college baseball season IDs from the baseballr data repo

Description

helper that loads multiple seasons of season IDs from the data repo either into memory or writes it into a db using some forwarded arguments in the dots

Usage

load_ncaa_baseball_season_ids(..., dbConnection = NULL, tablename = NULL)

Arguments

...

Additional arguments passed to an underlying function that writes the season data into a database.

dbConnection

A DBIConnection object, as returned by

tablename

The name of the data table within the database

Value

Returns a tibble

Examples

try(load_ncaa_baseball_season_ids())

Load cleaned NCAA men's college baseball teams from the baseballr data repo

Description

helper that loads multiple seasons of teams from the data repo either into memory or writes it into a db using some forwarded arguments in the dots

Usage

load_ncaa_baseball_teams(..., dbConnection = NULL, tablename = NULL)

Arguments

...

Additional arguments passed to an underlying function that writes the season data into a database.

dbConnection

A DBIConnection object, as returned by

tablename

The name of the data table within the database

Value

Returns a tibble

Examples

try(load_ncaa_baseball_teams())

Download a data frame of all umpires and their mlbamids for games since 2008

Description

Download a data frame of all umpires and their mlbamids for games since 2008

Usage

load_umpire_ids()

Value

Function returns a tibble with the following columns:

  • id

  • position

  • name

  • game_pk

  • game_date

Examples

try(load_umpire_ids())

Metrics Functions Overview

Description

  • fip_plus(): Calculate FIP and related metrics for any set of data.

  • woba_plus(): Calculate wOBA and related metrics for any set of data.

  • team_consistency(): Calculate Team-level Consistency.

  • label_statcast_imputed_data(): Label Statcast data as imputed.

  • run_expectancy_code(): Generate run expectancy and related measures from Baseball Savant data.

  • linear_weights_savant(): Generate linear weight values for events using Baseball Savant data.

Details

Calculate Team-level Consistency

  team_consistency(year=2015)

Calculate FIP and related metrics for any set of data

  fips_plus(df)

Calculate wOBA and related metrics for any set of data

  woba_plus(df)

Label Statcast data as imputed

  statcast_df <- scrape_statcast_savant("2017-05-01", "2017-05-02")
  sc_df <- label_statcast_imputed_data(statcast_df)
  mean(sc_df$imputed)

Generate run expectancy and related measures from Baseball Savant data

  df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15", 
                        playerid = 621043, player_type = 'batter') 
  run_expectancy_code(df, level = "plate appearances")

Generate linear weight values for events using Baseball Savant data

  df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15", 
                        playerid = 621043, player_type = 'batter') 
  df <- run_expectancy_code(df, level = "plate appearances")
  linear_weights_savant(df, level = "plate appearance")

(legacy) Scrape MiLB game logs for batters from FanGraphs

Description

(legacy) Scrape MiLB game logs for batters from FanGraphs

Usage

milb_batter_game_logs_fg(playerid, year)

Arguments

playerid

The batter's minor league ID from FanGraphs.

year

The season for which game logs should be returned.

Value

Returns a tibble of Minor League batter game logs.


(legacy) Scrape MiLB game logs for pitchers from FanGraphs

Description

(legacy) Scrape MiLB game logs for pitchers from FanGraphs

Usage

milb_pitcher_game_logs_fg(playerid, year)

Arguments

playerid

The pitcher's minor league ID from FanGraphs.com.

year

The season for which game logs should be returned.

Value

Returns a tibble of Minor League pitcher game logs.


MLB Functions Overview

Description

  • mlb_batting_orders(): Retrieve batting orders for a given MLB game.

  • mlb_draft(): Retrieve draft pick information by year.

  • mlb_pbp(): Acquire pitch-by-pitch data for Major and Minor League games.

  • mlb_game_info(): Retrieve additional game information for major and minor league games.

  • mlb_game_pks(): Get MLB Game Info by Date and Level.

  • mlb_schedule(): Find game_pk values for professional baseball games (major and minor leagues).

  • mlb_probables(): Retrieve probable starters for a given MLB game.

Details

Retrieve batting orders for a given MLB game

  mlb_batting_orders(game_pk=566001)

Retrieve draft pick information by year

  mlb_draft(year= 2018)

Acquire pitch-by-pitch data for Major and Minor League games

  mlb_pbp(game_pk = 575156)

Retrieve additional game information for major and minor league games

  mlb_game_info(game_pk = 566001)

Get MLB Game Info by Date and Level

  mlb_game_pks("2019-04-29")

Find game_pk values for professional baseball games (major and minor leagues)

  mlb_schedule(season = "2019")

Retrieve probable starters for a given MLB game

  mlb_probables(566001)

MLB All-Star Endpoint Overview

Description

  • mlb_all_star_ballots(): Find MLB All-Star Ballots.

  • mlb_all_star_final_vote(): Find MLB All-Star Final Vote.

  • mlb_all_star_write_ins(): Find MLB All-Star Write-ins.

Details

MLB All-Star

These functions retrieve MLB All-Star ballot, final vote, and write-in information from the MLB Stats API.


Find MLB All-Star Ballots

Description

Find MLB All-Star Ballots

Usage

mlb_all_star_ballots(league_id = NULL, season = NULL)

Arguments

league_id

League ID for league all-star ballot of interest.

season

The season of the all-star ballot.

Value

Returns a tibble with the following columns:

col_name types description
player_id integer MLB player ID.
full_name character Player full name.
link character MLB Stats API relative resource link.
first_name character Player first name.
last_name character Player last name.
primary_number character Player uniform number.
birth_date character Birth date (YYYY-MM-DD).
current_age integer Current age in years.
birth_city character City of birth.
birth_country character Country of birth.
height character Height (feet and inches).
weight integer Weight in pounds.
active logical Whether the player is currently active.
use_name character Preferred first name.
use_last_name character Preferred last name.
middle_name character Player middle name.
boxscore_name character Name as shown in box scores.
nick_name character Player nickname.
gender character Player gender.
name_matrilineal character Maternal family name.
is_player logical Whether the person is a player.
is_verified logical Whether the player profile is verified.
pronunciation character Phonetic name pronunciation.
last_played_date character Date of last MLB game played.
mlb_debut_date character MLB debut date (YYYY-MM-DD).
name_first_last character Name in first-last order.
name_slug character URL-friendly name slug.
first_last_name character First and last name.
last_first_name character Name in last, first order.
last_init_name character Last name with first initial.
init_last_name character First initial with last name.
full_fml_name character Full name (first-middle-last).
full_lfm_name character Full name (last-first-middle).
strike_zone_top numeric Top of the player's strike zone (feet).
strike_zone_bottom numeric Bottom of the player's strike zone (feet).
birth_state_province character State or province of birth.
draft_year integer Year the player was drafted.
name_title character Name title.
name_suffix character Name suffix (e.g. Jr., III).
primary_position_code character Primary fielding position code.
primary_position_name character Primary fielding position name.
primary_position_type character Primary position type (e.g. Infielder).
primary_position_abbreviation character Primary position abbreviation.
bat_side_code character Batting side code (L/R/S).
bat_side_description character Batting side description.
pitch_hand_code character Throwing hand code (L/R).
pitch_hand_description character Throwing hand description.
league_id numeric MLB league ID.
season numeric Season (YYYY).

Examples

try(mlb_all_star_ballots(league_id = 103, season = 2021))

Find MLB All-Star Final Vote

Description

Find MLB All-Star Final Vote

Usage

mlb_all_star_final_vote(league_id = NULL, season = NULL)

Arguments

league_id

League ID for league all-star ballot of interest.

season

The season of the all-star ballot.

Value

Returns a tibble with the following columns:

col_name types description
player_id integer MLB player ID.
full_name character Player full name.
link character MLB Stats API relative resource link.
first_name character Player first name.
last_name character Player last name.
primary_number character Player uniform number.
birth_date character Birth date (YYYY-MM-DD).
current_age integer Current age in years.
birth_city character City of birth.
birth_country character Country of birth.
height character Height (feet and inches).
weight integer Weight in pounds.
active logical Whether the player is currently active.
use_name character Preferred first name.
use_last_name character Preferred last name.
middle_name character Player middle name.
boxscore_name character Name as shown in box scores.
nick_name character Player nickname.
gender character Player gender.
name_matrilineal character Maternal family name.
is_player logical Whether the person is a player.
is_verified logical Whether the player profile is verified.
pronunciation character Phonetic name pronunciation.
last_played_date character Date of last MLB game played.
mlb_debut_date character MLB debut date (YYYY-MM-DD).
name_first_last character Name in first-last order.
name_slug character URL-friendly name slug.
first_last_name character First and last name.
last_first_name character Name in last, first order.
last_init_name character Last name with first initial.
init_last_name character First initial with last name.
full_fml_name character Full name (first-middle-last).
full_lfm_name character Full name (last-first-middle).
strike_zone_top numeric Top of the player's strike zone (feet).
strike_zone_bottom numeric Bottom of the player's strike zone (feet).
birth_state_province character State or province of birth.
name_title character Name title.
name_suffix character Name suffix (e.g. Jr., III).
draft_year integer Year the player was drafted.
primary_position_code character Primary fielding position code.
primary_position_name character Primary fielding position name.
primary_position_type character Primary position type (e.g. Infielder).
primary_position_abbreviation character Primary position abbreviation.
bat_side_code character Batting side code (L/R/S).
bat_side_description character Batting side description.
pitch_hand_code character Throwing hand code (L/R).
pitch_hand_description character Throwing hand description.
league_id numeric MLB league ID.
season numeric Season (YYYY).

Examples

try(mlb_all_star_final_vote(league_id = 103, season = 2021))

Find MLB All-Star Write-ins

Description

Find MLB All-Star Write-ins

Usage

mlb_all_star_write_ins(league_id = NULL, season = NULL)

Arguments

league_id

League ID for league all-star ballot of interest.

season

The season of the all-star ballot.

Value

Returns a tibble with the following columns:

col_name types description
player_id integer MLB player ID.
full_name character Player full name.
link character MLB Stats API relative resource link.
first_name character Player first name.
last_name character Player last name.
primary_number character Player uniform number.
birth_date character Birth date (YYYY-MM-DD).
current_age integer Current age in years.
birth_city character City of birth.
birth_state_province character State or province of birth.
birth_country character Country of birth.
height character Height (feet and inches).
weight integer Weight in pounds.
active logical Whether the player is currently active.
use_name character Preferred first name.
use_last_name character Preferred last name.
middle_name character Player middle name.
boxscore_name character Name as shown in box scores.
nick_name character Player nickname.
gender character Player gender.
is_player logical Whether the person is a player.
is_verified logical Whether the player profile is verified.
draft_year integer Year the player was drafted.
mlb_debut_date character MLB debut date (YYYY-MM-DD).
name_first_last character Name in first-last order.
name_slug character URL-friendly name slug.
first_last_name character First and last name.
last_first_name character Name in last, first order.
last_init_name character Last name with first initial.
init_last_name character First initial with last name.
full_fml_name character Full name (first-middle-last).
full_lfm_name character Full name (last-first-middle).
strike_zone_top numeric Top of the player's strike zone (feet).
strike_zone_bottom numeric Bottom of the player's strike zone (feet).
pronunciation character Phonetic name pronunciation.
last_played_date character Date of last MLB game played.
name_title character Name title.
name_suffix character Name suffix (e.g. Jr., III).
name_matrilineal character Maternal family name.
bat_side_code character Batting side code (L/R/S).
bat_side_description character Batting side description.
pitch_hand_code character Throwing hand code (L/R).
pitch_hand_description character Throwing hand description.
league_id numeric MLB league ID.
season numeric Season (YYYY).

Examples

try(mlb_all_star_write_ins(league_id = 103, season = 2021))

MLB Attendance

Description

MLB Attendance

Usage

mlb_attendance(
  team_id = NULL,
  league_id = NULL,
  season = NULL,
  date = NULL,
  league_list_id = NULL
)

Arguments

team_id

Return attendance information for a particular team_id(s).

league_id

Return attendance information for a particular league_id(s). Format: '103,104'

season

Return attendance information for particular year(s).

date

Return attendance information on a particular date. Format: MM/DD/YYYY

league_list_id

Unique league list identifier to return a directory of attendance for a specific league list_id Valid values include:

  • milb_full

  • milb_short

  • milb_complex

  • milb_all

  • milb_all_nomex

  • milb_all_domestic

  • milb_noncomp

  • milb_noncomp_nomex

  • milb_domcomp

  • milb_intcomp

  • win_noabl

  • win_caribbean

  • win_all

  • abl

  • mlb

  • mlb_hist

  • mlb_milb

  • mlb_milb_hist

  • mlb_milb_win

  • baseball_all

Value

Returns a tibble with the following columns

col_name types description
openings_total integer Total number of openings (games eligible to open).
openings_total_away integer Total away openings.
openings_total_home integer Total home openings.
openings_total_lost integer Openings lost (e.g. to rainouts).
games_total integer Total games played.
games_away_total integer Total away games.
games_home_total integer Total home games.
year character Season year (YYYY).
attendance_average_away integer Average away-game attendance.
attendance_average_home integer Average home-game attendance.
attendance_average_ytd integer Year-to-date average attendance.
attendance_high integer Highest single-game attendance.
attendance_high_date character Date of the highest-attendance game.
attendance_low integer Lowest single-game attendance.
attendance_low_date character Date of the lowest-attendance game.
attendance_opening_average integer Average opening-day attendance.
attendance_total integer Total attendance for the period.
attendance_total_away integer Total away attendance.
attendance_total_home integer Total home attendance.
attendance_high_game_game_pk integer game_pk of the highest-attendance game.
attendance_high_game_link character API link to the highest-attendance game.
attendance_high_game_day_night character Day/night status of the highest-attendance game.
attendance_high_game_content_link character API content link for the highest-attendance game.
attendance_low_game_game_pk integer game_pk of the lowest-attendance game.
attendance_low_game_link character API link to the lowest-attendance game.
attendance_low_game_day_night character Day/night status of the lowest-attendance game.
attendance_low_game_content_link character API content link for the lowest-attendance game.
game_type_id character Game type code (e.g. R for regular season).
game_type_description character Game type description.
team_id integer MLB team ID.
team_name character Team name.
team_link character MLB Stats API relative team link.

Examples

try(mlb_attendance(team_id = 109, season = 2021))

MLB All-Star, Awards, Home Run Derby Functions

Description

  • mlb_all_star_ballots(): Find MLB All-Star Ballots.

  • mlb_all_star_final_vote(): Find MLB All-Star Final Vote.

  • mlb_all_star_write_ins(): Find MLB All-Star Write-ins.

  • mlb_awards(): Find MLB Awards.

  • mlb_awards_recipient(): Find MLB Award Recipients.

  • mlb_homerun_derby(): Retrieve MLB Home Run Derby Data.

  • mlb_homerun_derby_bracket(): Retrieve MLB Home Run Derby Bracket.

  • mlb_homerun_derby_players(): Retrieve MLB Home Run Derby Players.

Details

Find MLB All-Star Ballots

  try(mlb_all_star_ballots(league_id = 103, season = 2021))

Find MLB All-Star Final Vote

  try(mlb_all_star_final_vote(league_id = 103, season = 2021))

Find MLB All-Star Write-ins

  try(mlb_all_star_write_ins(league_id = 103, season = 2021))

Find MLB Awards

  try(mlb_awards())

Find MLB Award Recipients

  try(mlb_awards_recipient(award_id = 'MLBHOF', season = 2020))

Retrieve MLB Home Run Derby Data

  try(mlb_homerun_derby(game_pk = 511101))

Retrieve MLB Home Run Derby Bracket

   try(mlb_homerun_derby_bracket(game_pk = 511101))

Retrieve MLB Home Run Derby Players

   try(mlb_homerun_derby_players(game_pk = 511101))

MLB Awards

Description

MLB Awards

Usage

mlb_awards()

Value

Returns a tibble with the following columns

col_name types description
award_id character Award identifier code.
award_name character Award name.
award_description character Award description.
sort_order integer Display sort order for the award.
active logical Whether the award is currently active.
notes character Additional notes about the award.
sport_id integer MLB sport ID associated with the award.
sport_link character MLB Stats API relative sport link.
league_id integer MLB league ID associated with the award.
league_link character MLB Stats API relative league link.

Examples

try(mlb_awards())

MLB Award Recipients

Description

MLB Award Recipients

Usage

mlb_awards_recipient(
  award_id = NULL,
  sport_id = NULL,
  league_id = NULL,
  season = NULL
)

Arguments

award_id

award_id to return a directory of players for a given award.

sport_id

sport_id to return a directory of players for a given aware in a specific sport.

league_id

league_id(s) to return a directory of players for a given award in a specific league. Format '103,104'

season

Year(s) to return a directory of players for a given award in a given season.

Value

Returns a tibble with the following columns

col_name types description
award_id character Award identifier code.
award_name character Award name.
date character Date the award was given (YYYY-MM-DD).
season character Season the award was given (YYYY).
votes integer Number of votes received.
notes character Additional notes about the recipient.
player_id integer MLB player ID of the recipient.
player_link character MLB Stats API relative player link.
player_name_first_last character Recipient name in first-last order.
player_primary_position_code character Recipient primary fielding position code.
player_primary_position_name character Recipient primary fielding position name.
player_primary_position_type character Recipient primary position type.
player_primary_position_abbreviation character Recipient primary position abbreviation.
team_id integer MLB team ID of the recipient.
team_link character MLB Stats API relative team link.

Examples

try(mlb_awards_recipient(award_id = 'MLBHOF', season = 2020))

MLB Baseball Stats

Description

MLB Baseball Stats

Usage

mlb_baseball_stats()

Value

Returns a tibble with the following columns:

col_name types description
stat_name character Internal stat name.
stat_lookup_param character Lookup parameter/abbreviation for the stat.
is_counting logical Whether the stat is a counting stat.
stat_label character Human-readable stat label.
stat_group character Stat group (e.g. hitting, pitching, fielding).

Examples

try(mlb_baseball_stats())

Retrieve batting orders for a given MLB game

Description

Retrieve batting orders for a given MLB game

Usage

mlb_batting_orders(game_pk, type = "starting")

Arguments

game_pk

The unique game_pk identifier for the game

type

Whether to just return the starting lineup ('starting') or all batters that appeared ('all')

Value

Returns a tibble that includes probable starting pitchers and the home plate umpire for the game_pk requested

col_name types description
id integer MLB player ID.
fullName character Player full name.
abbreviation character Fielding position abbreviation.
batting_order character Spot in the batting order (1-9).
batting_position_num character Sub-position within the lineup spot (0 = starter).
team character Side of the matchup ('home' or 'away').
teamName character Team name.
teamID integer MLB team ID.

Examples

try(mlb_batting_orders(game_pk=566001))

View all PCL conferences

Description

View all PCL conferences

Usage

mlb_conferences(conference_id = NULL, season = NULL)

Arguments

conference_id

Conference ID to return information for.

season

Year to return to return conference information for.

Value

Returns a tibble with the following columns

col_name types description
conference_id integer MLB conference ID.
conference_name character Conference name.
link character MLB Stats API relative conference link.
conference_abbreviation character Conference abbreviation.
has_wildcard logical Whether the conference has a wild card.
conference_name_short character Short conference name.
league_id integer MLB league ID.
league_link character MLB Stats API relative league link.
sport_id integer MLB sport ID.
sport_link character MLB Stats API relative sport link.

Examples

try(mlb_conferences())
  try(mlb_conferences(conference_id =  301, season = 2020))

MLB Divisions

Description

MLB Divisions

Usage

mlb_divisions(division_id = NULL, league_id = NULL, sport_id = NULL)

Arguments

division_id

Return division(s) data for a specific division

league_id

Return division(s) data for all divisions in a specific league

sport_id

Return division(s) for all divisions in a specific sport.

Value

Returns a tibble with the following columns

col_name types description
division_id integer MLB division ID.
division_name character Division name.
season character Season (YYYY).
division_name_short character Short division name.
division_link character MLB Stats API relative division link.
division_abbreviation character Division abbreviation.
has_wildcard logical Whether the division has a wild card.
sort_order integer Display sort order for the division.
num_playoff_teams integer Number of playoff teams from the division.
active logical Whether the division is currently active.
league_id integer MLB league ID.
league_link character MLB Stats API relative league link.
sport_id integer MLB sport ID.
sport_link character MLB Stats API relative sport link.

Examples

try(mlb_divisions(sport_id = 1))

Retrieve draft pick information by year

Description

Retrieve draft pick information by year

Usage

mlb_draft(year)

Arguments

year

The year for which to return data

Value

Returns a tibble with information for every draft pick in every round for the year requested

col_name types description
bis_player_id integer BIS (Baseball Info Solutions) player ID.
pick_round character Draft round.
pick_number integer Overall pick number.
display_pick_number integer Pick number as displayed.
round_pick_number integer Pick number within the round.
rank integer Prospect rank.
pick_value character Assigned slot/pick value (dollars).
signing_bonus character Signing bonus (dollars).
scouting_report character Link to the scouting report.
blurb character Prospect scouting blurb.
headshot_link character URL to the player's headshot image.
is_drafted logical Whether the prospect was drafted.
is_pass logical Whether the pick was a pass.
year character Draft year (YYYY).
home_city character Prospect home city.
home_state character Prospect home state.
home_country character Prospect home country.
school_name character School name.
school_school_class character School class (e.g. 4YR JR, HS SR).
school_country character School country.
school_state character School state.
person_id integer MLB player ID.
person_full_name character Player full name.
person_link character MLB Stats API relative player link.
person_first_name character Player first name.
person_last_name character Player last name.
person_primary_number character Player uniform number.
person_birth_date character Birth date (YYYY-MM-DD).
person_current_age integer Current age in years.
person_birth_city character City of birth.
person_birth_state_province character State or province of birth.
person_birth_country character Country of birth.
person_height character Height (feet and inches).
person_weight integer Weight in pounds.
person_active logical Whether the player is currently active.
person_use_name character Preferred first name.
person_use_last_name character Preferred last name.
person_middle_name character Player middle name.
person_boxscore_name character Name as shown in box scores.
person_gender character Player gender.
person_is_player logical Whether the person is a player.
person_is_verified logical Whether the player profile is verified.
person_draft_year integer Year the player was drafted.
person_mlb_debut_date character MLB debut date (YYYY-MM-DD).
person_name_first_last character Name in first-last order.
person_name_slug character URL-friendly name slug.
person_first_last_name character First and last name.
person_last_first_name character Name in last, first order.
person_last_init_name character Last name with first initial.
person_init_last_name character First initial with last name.
person_full_fml_name character Full name (first-middle-last).
person_full_lfm_name character Full name (last-first-middle).
person_strike_zone_top numeric Top of the player's strike zone (feet).
person_strike_zone_bottom numeric Bottom of the player's strike zone (feet).
person_pronunciation character Phonetic name pronunciation.
person_name_title character Name title.
person_name_suffix character Name suffix (e.g. Jr., III).
person_nick_name character Player nickname.
person_name_matrilineal character Maternal family name.
person_primary_position_code character Primary fielding position code.
person_primary_position_name character Primary fielding position name.
person_primary_position_type character Primary position type (e.g. Infielder).
person_primary_position_abbreviation character Primary position abbreviation.
person_bat_side_code character Batting side code (L/R/S).
person_bat_side_description character Batting side description.
person_pitch_hand_code character Throwing hand code (L/R).
person_pitch_hand_description character Throwing hand description.
team_all_star_status character Team all-star status flag.
team_id integer MLB team ID of the drafting team.
team_name character Drafting team name.
team_link character MLB Stats API relative team link.
team_spring_league_id integer Spring training league ID.
team_spring_league_name character Spring training league name.
team_spring_league_link character MLB Stats API relative spring league link.
team_spring_league_abbreviation character Spring training league abbreviation.
draft_type_code character Draft type code.
draft_type_description character Draft type description.

Examples

try(mlb_draft(year = 2020))

MLB Draft Endpoint Overview

Description

  • mlb_draft(): Retrieve draft pick information by year.

  • mlb_draft_latest(): Retrieve latest draft information by year.

  • mlb_draft_prospects(): Retrieve draft prospect information by year.

Details

MLB Draft

These functions retrieve MLB Draft pick, latest pick, and prospect information from the MLB Stats API.


Retrieve latest draft information by year

Description

Retrieve latest draft information by year

Usage

mlb_draft_latest(year)

Arguments

year

The year for which to return data

Value

Returns a tibble with the latest draft information for the year requested:

col_name types description
pick_round character Draft round.
pick_number integer Overall pick number.
display_pick_number integer Pick number as displayed.
round_pick_number integer Pick number within the round.
pick_value character Assigned slot/pick value (dollars).
signing_bonus character Signing bonus (dollars).
home_city character Prospect home city.
home_state character Prospect home state.
home_country character Prospect home country.
school_name character School name.
school_school_class character School class (e.g. 4YR JR, HS SR).
school_country character School country.
school_state character School state.
headshot_link character URL to the player's headshot image.
person_id integer MLB player ID.
person_full_name character Player full name.
person_link character MLB Stats API relative player link.
person_first_name character Player first name.
person_last_name character Player last name.
person_primary_number character Player uniform number.
person_birth_date character Birth date (YYYY-MM-DD).
person_current_age integer Current age in years.
person_birth_city character City of birth.
person_birth_state_province character State or province of birth.
person_birth_country character Country of birth.
person_height character Height (feet and inches).
person_weight integer Weight in pounds.
person_active logical Whether the player is currently active.
person_primary_position_code character Primary fielding position code.
person_primary_position_name character Primary fielding position name.
person_primary_position_type character Primary position type (e.g. Infielder).
person_primary_position_abbreviation character Primary position abbreviation.
person_use_name character Preferred first name.
person_use_last_name character Preferred last name.
person_middle_name character Player middle name.
person_boxscore_name character Name as shown in box scores.
person_gender character Player gender.
person_is_player logical Whether the person is a player.
person_is_verified logical Whether the player profile is verified.
person_draft_year integer Year the player was drafted.
person_mlb_debut_date character MLB debut date (YYYY-MM-DD).
person_bat_side_code character Batting side code (L/R/S).
person_bat_side_description character Batting side description.
person_pitch_hand_code character Throwing hand code (L/R).
person_pitch_hand_description character Throwing hand description.
person_name_first_last character Name in first-last order.
person_name_slug character URL-friendly name slug.
person_first_last_name character First and last name.
person_last_first_name character Name in last, first order.
person_last_init_name character Last name with first initial.
person_init_last_name character First initial with last name.
person_full_fml_name character Full name (first-middle-last).
person_full_lfm_name character Full name (last-first-middle).
person_strike_zone_top numeric Top of the player's strike zone (feet).
person_strike_zone_bottom numeric Bottom of the player's strike zone (feet).
person_xref_ids_xref_id character Cross-reference ID from an external source.
person_xref_ids_xref_type character Cross-reference source type (e.g. fangraphs).
person_xref_ids_season character Season associated with the cross-reference ID.
team_spring_league_id integer Spring training league ID.
team_spring_league_name character Spring training league name.
team_spring_league_link character MLB Stats API relative spring league link.
team_spring_league_abbreviation character Spring training league abbreviation.
team_all_star_status character Team all-star status flag.
team_id integer MLB team ID of the drafting team.
team_name character Drafting team name.
team_link character MLB Stats API relative team link.
team_season integer Team season (YYYY).
team_venue_id integer Home venue ID.
team_venue_name character Home venue name.
team_venue_link character MLB Stats API relative venue link.
team_spring_venue_id integer Spring training venue ID.
team_spring_venue_link character MLB Stats API relative spring venue link.
team_team_code character Team code.
team_file_code character Team file code.
team_abbreviation character Team abbreviation.
team_team_name character Team nickname.
team_location_name character Team location/city name.
team_first_year_of_play character First year the franchise played.
team_league_id integer MLB league ID.
team_league_name character League name.
team_league_link character MLB Stats API relative league link.
team_division_id integer Division ID.
team_division_name character Division name.
team_division_link character MLB Stats API relative division link.
team_sport_id integer MLB sport ID.
team_sport_link character MLB Stats API relative sport link.
team_sport_name character Sport name.
team_short_name character Team short name.
team_franchise_name character Franchise name.
team_club_name character Club name.
team_active logical Whether the team is currently active.
draft_type_code character Draft type code.
draft_type_description character Draft type description.
is_drafted logical Whether the prospect was drafted.
is_pass logical Whether the pick was a pass.
year character Draft year (YYYY).

Examples

try(mlb_draft_latest(year = 2020))

Retrieve draft prospect information by year

Description

Retrieve draft prospect information by year

Usage

mlb_draft_prospects(year)

Arguments

year

The year for which to return data

Value

Returns a tibble with information for every draft prospect for the year requested:

col_name types description
bis_player_id integer BIS (Baseball Info Solutions) player ID.
headshot_link character URL to the player's headshot image.
is_drafted logical Whether the prospect was drafted.
is_pass logical Whether the pick was a pass.
year character Draft year (YYYY).
pick_round character Draft round.
pick_number integer Overall pick number.
rank integer Prospect rank.
scouting_report character Link to the scouting report.
blurb character Prospect scouting blurb.
home_city character Prospect home city.
home_state character Prospect home state.
home_country character Prospect home country.
school_name character School name.
school_school_class character School class (e.g. 4YR JR, HS SR).
school_country character School country.
school_state character School state.
person_id integer MLB player ID.
person_full_name character Player full name.
person_link character MLB Stats API relative player link.
person_first_name character Player first name.
person_last_name character Player last name.
person_birth_date character Birth date (YYYY-MM-DD).
person_current_age integer Current age in years.
person_birth_city character City of birth.
person_birth_state_province character State or province of birth.
person_birth_country character Country of birth.
person_height character Height (feet and inches).
person_weight integer Weight in pounds.
person_active logical Whether the player is currently active.
person_use_name character Preferred first name.
person_use_last_name character Preferred last name.
person_middle_name character Player middle name.
person_boxscore_name character Name as shown in box scores.
person_gender character Player gender.
person_is_player logical Whether the person is a player.
person_is_verified logical Whether the player profile is verified.
person_draft_year integer Year the player was drafted.
person_name_first_last character Name in first-last order.
person_name_slug character URL-friendly name slug.
person_first_last_name character First and last name.
person_last_first_name character Name in last, first order.
person_last_init_name character Last name with first initial.
person_init_last_name character First initial with last name.
person_full_fml_name character Full name (first-middle-last).
person_full_lfm_name character Full name (last-first-middle).
person_strike_zone_top numeric Top of the player's strike zone (feet).
person_strike_zone_bottom numeric Bottom of the player's strike zone (feet).
person_primary_number character Player uniform number.
person_mlb_debut_date character MLB debut date (YYYY-MM-DD).
person_pronunciation character Phonetic name pronunciation.
person_name_matrilineal character Maternal family name.
person_name_title character Name title.
person_name_suffix character Name suffix (e.g. Jr., III).
person_nick_name character Player nickname.
person_death_date character Date of death (YYYY-MM-DD), if applicable.
person_death_city character City of death, if applicable.
person_death_state_province character State or province of death, if applicable.
person_death_country character Country of death, if applicable.
person_primary_position_code character Primary fielding position code.
person_primary_position_name character Primary fielding position name.
person_primary_position_type character Primary position type (e.g. Infielder).
person_primary_position_abbreviation character Primary position abbreviation.
person_bat_side_code character Batting side code (L/R/S).
person_bat_side_description character Batting side description.
person_pitch_hand_code character Throwing hand code (L/R).
person_pitch_hand_description character Throwing hand description.
draft_type_code character Draft type code.
draft_type_description character Draft type description.
team_all_star_status character Team all-star status flag.
team_id integer MLB team ID associated with the prospect.
team_name character Team name.
team_link character MLB Stats API relative team link.
team_season integer Team season (YYYY).
team_team_code character Team code.
team_file_code character Team file code.
team_abbreviation character Team abbreviation.
team_team_name character Team nickname.
team_location_name character Team location/city name.
team_first_year_of_play character First year the franchise played.
team_short_name character Team short name.
team_franchise_name character Franchise name.
team_club_name character Club name.
team_active logical Whether the team is currently active.
team_spring_league_id integer Spring training league ID.
team_spring_league_name character Spring training league name.
team_spring_league_link character MLB Stats API relative spring league link.
team_spring_league_abbreviation character Spring training league abbreviation.
team_venue_id integer Home venue ID.
team_venue_name character Home venue name.
team_venue_link character MLB Stats API relative venue link.
team_spring_venue_id integer Spring training venue ID.
team_spring_venue_link character MLB Stats API relative spring venue link.
team_league_id integer MLB league ID.
team_league_name character League name.
team_league_link character MLB Stats API relative league link.
team_division_id integer Division ID.
team_division_name character Division name.
team_division_link character MLB Stats API relative division link.
team_sport_id integer MLB sport ID.
team_sport_link character MLB Stats API relative sport link.
team_sport_name character Sport name.

Examples

try(mlb_draft_prospects(year = 2020))

MLB Event Types

Description

MLB Event Types

Usage

mlb_event_types()

Value

Returns a tibble with the following columns

col_name types description
plate_appearance logical Whether the event counts as a plate appearance.
hit logical Whether the event is a hit.
event_code character Event type code.
base_running_event logical Whether the event is a base-running event.
event_description character Human-readable event description.

Examples

try(mlb_event_types())

MLB Fielder Detail Types

Description

MLB Fielder Detail Types

Usage

mlb_fielder_detail_types()

Value

Returns a tibble with the following columns

col_name types description
stat_name character Internal fielder detail stat name.
code character Fielder detail type code.
names list Associated detail names for the type.
chance logical Whether the detail counts as a fielding chance.
error logical Whether the detail counts as an error.

Examples

try(mlb_fielder_detail_types())

Acquire time codes for Major and Minor League games

Description

Acquire time codes for Major and Minor League games

Usage

mlb_game_changes(updated_since, sport_id)

Arguments

updated_since

Updated since date time

sport_id

Return division(s) for all divisions in a specific sport.

Value

Returns a tibble that includes time codes from the game_pk requested

col_name types description
date character Schedule date (YYYY-MM-DD).
total_items integer Total items for the date.
total_events integer Total events for the date.
total_games integer Total games for the date.
total_games_in_progress integer Games currently in progress for the date.
game_pk integer Unique game identifier.
game_guid character Globally unique game identifier.
link character MLB Stats API relative game link.
game_type character Game type code (R, P, D, etc.).
season character Season (YYYY).
game_date character Game date-time (ISO 8601, UTC).
official_date character Official game date (YYYY-MM-DD).
is_tie logical Whether the game ended in a tie.
game_number integer Game number within a doubleheader.
public_facing logical Whether the game is public-facing.
double_header character Doubleheader indicator (N/Y/S).
gameday_type character Gameday data type code.
tiebreaker character Tiebreaker indicator.
calendar_event_id character Calendar event identifier.
season_display character Display season (YYYY).
day_night character Day/night designation.
description character Game description.
scheduled_innings integer Number of scheduled innings.
reverse_home_away_status logical Whether home/away designation is reversed.
inning_break_length integer Length of the inning break (seconds).
games_in_series integer Total games in the series.
series_game_number integer Game number within the series.
series_description character Series description.
record_source character Source of the record data.
if_necessary character Whether the game is played only if necessary.
if_necessary_description character If-necessary description.
status_abstract_game_state character Abstract game state (e.g. Final).
status_coded_game_state character Coded game state.
status_detailed_state character Detailed game state.
status_status_code character Game status code.
status_start_time_tbd logical Whether the start time is TBD.
status_abstract_game_code character Abstract game code.
teams_away_score integer Away team score.
teams_away_is_winner logical Whether the away team won.
teams_away_split_squad logical Whether the away team is a split squad.
teams_away_series_number integer Away team series number.
teams_away_team_id integer Away team MLB ID.
teams_away_team_name character Away team name.
teams_away_team_link character MLB Stats API relative away team link.
teams_away_league_record_wins integer Away team league-record wins.
teams_away_league_record_losses integer Away team league-record losses.
teams_away_league_record_ties integer Away team league-record ties.
teams_away_league_record_pct character Away team winning percentage.
teams_home_score integer Home team score.
teams_home_is_winner logical Whether the home team won.
teams_home_split_squad logical Whether the home team is a split squad.
teams_home_series_number integer Home team series number.
teams_home_team_id integer Home team MLB ID.
teams_home_team_name character Home team name.
teams_home_team_link character MLB Stats API relative home team link.
teams_home_league_record_wins integer Home team league-record wins.
teams_home_league_record_losses integer Home team league-record losses.
teams_home_league_record_ties integer Home team league-record ties.
teams_home_league_record_pct character Home team winning percentage.
venue_id integer Venue ID.
venue_name character Venue name.
venue_link character MLB Stats API relative venue link.
content_link character MLB Stats API relative game content link.
status_reason character Reason for the game status, if any.
rescheduled_from character Original scheduled date-time if rescheduled.
rescheduled_from_date character Original scheduled date if rescheduled.
resumed_from character Original date-time if the game was resumed.
resumed_from_date character Original date if the game was resumed.
events list Nested list of change events for the game.

Examples

try(mlb_game_changes(updated_since = "2021-08-10T19:08:24.000004Z", sport_id = 1))

Retrieve additional game content for major and minor league games

Description

Retrieve additional game content for major and minor league games

Usage

mlb_game_content(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble of game content data with the following columns:

col_name types description
title character Media/EPG title (e.g. MLBTV).
call_letters character Broadcaster call letters.
espn_auth_required logical Whether ESPN authentication is required.
tbs_auth_required logical Whether TBS authentication is required.
espn2auth_required logical Whether ESPN2 authentication is required.
game_date character Game date associated with the content.
content_id character Content identifier.
fs1auth_required logical Whether FS1 authentication is required.
media_id character Media identifier.
media_feed_type character Media feed type (HOME/AWAY/NATIONAL).
mlbn_auth_required logical Whether MLB Network authentication is required.
fox_auth_required logical Whether FOX authentication is required.
media_feed_sub_type character Media feed sub-type code.
free_game logical Whether the broadcast is a free game.
epg_id integer Electronic programming guide identifier.
media_state character Media state (e.g. MEDIA_ARCHIVE).
abc_auth_required logical Whether ABC authentication is required.
rendition_name character Media rendition name.
description character Content description.
language character Broadcast language.
type character Content/media type.

Examples

try(mlb_game_content(game_pk = 566001))

Acquire game context metrics for Major and Minor League games

Description

Acquire game context metrics for Major and Minor League games

Usage

mlb_game_context_metrics(game_pk, timecode)

Arguments

game_pk

The game_pk for the game requested

timecode

The time code for the MLB game (format: MMDDYYYY_HHMMSS)

Value

Returns a tibble that includes time codes from the game_pk requested

col_name types description
game_pk integer Unique game identifier.
game_guid character Globally unique game identifier.
link character MLB Stats API relative game link.
game_type character Game type code (R, P, etc.).
season character Season (YYYY).
game_date character Game date-time (ISO 8601, UTC).
official_date character Official game date (YYYY-MM-DD).
status_abstract_game_state character Abstract game state (e.g. Final).
status_coded_game_state character Coded game state.
status_detailed_state character Detailed game state.
status_status_code character Game status code.
status_start_time_tbd logical Whether the start time is TBD.
status_abstract_game_code character Abstract game code.
teams_away_team_id integer Away team MLB ID.
teams_away_team_name character Away team name.
teams_away_team_link character MLB Stats API relative away team link.
teams_away_league_record_wins integer Away team league-record wins.
teams_away_league_record_losses integer Away team league-record losses.
teams_away_league_record_ties integer Away team league-record ties.
teams_away_league_record_pct character Away team winning percentage.
teams_away_score integer Away team score.
teams_away_is_winner logical Whether the away team won.
teams_away_probable_pitcher_id integer Away probable pitcher MLB ID.
teams_away_probable_pitcher_full_name character Away probable pitcher name.
teams_away_probable_pitcher_link character MLB Stats API relative away pitcher link.
teams_away_split_squad logical Whether the away team is a split squad.
teams_away_series_number integer Away team series number.
teams_home_team_id integer Home team MLB ID.
teams_home_team_name character Home team name.
teams_home_team_link character MLB Stats API relative home team link.
teams_home_league_record_wins integer Home team league-record wins.
teams_home_league_record_losses integer Home team league-record losses.
teams_home_league_record_ties integer Home team league-record ties.
teams_home_league_record_pct character Home team winning percentage.
teams_home_score integer Home team score.
teams_home_is_winner logical Whether the home team won.
teams_home_probable_pitcher_id integer Home probable pitcher MLB ID.
teams_home_probable_pitcher_full_name character Home probable pitcher name.
teams_home_probable_pitcher_link character MLB Stats API relative home pitcher link.
teams_home_split_squad logical Whether the home team is a split squad.
teams_home_series_number integer Home team series number.
venue_id integer Venue ID.
venue_name character Venue name.
venue_link character MLB Stats API relative venue link.
link_1 character MLB Stats API relative game content link.
is_tie logical Whether the game ended in a tie.
game_number integer Game number within a doubleheader.
public_facing logical Whether the game is public-facing.
double_header character Doubleheader indicator (N/Y/S).
gameday_type character Gameday data type code.
tiebreaker character Tiebreaker indicator.
calendar_event_id character Calendar event identifier.
season_display character Display season (YYYY).
day_night character Day/night designation.
scheduled_innings integer Number of scheduled innings.
reverse_home_away_status logical Whether home/away designation is reversed.
inning_break_length integer Length of the inning break (seconds).
games_in_series integer Total games in the series.
series_game_number integer Game number within the series.
series_description character Series description.
record_source character Source of the record data.
if_necessary character Whether the game is played only if necessary.
if_necessary_description character If-necessary description.
game_id character Human-readable game ID slug.
home_win_probability numeric Home team win probability (percent).
away_win_probability numeric Away team win probability (percent).

Examples

try(mlb_game_context_metrics(game_pk = 531060, timecode = "20180803_182458"))

MLB Game Endpoint Overview

Description

  • mlb_game_info(): Retrieve additional game information for major and minor league games.

  • mlb_game_pks(): Get MLB Game Info by Date and Level.

  • mlb_game_content(): Retrieve additional game content for major and minor league games.

  • mlb_game_linescore(): Retrieve game linescores for major and minor league games.

  • mlb_game_wp(): Acquire win probability for Major and Minor League games.

  • mlb_game_pace(): Retrieve game pace metrics for major and minor league.

  • mlb_game_changes(): Acquire time codes for Major and Minor League games.

  • mlb_game_context_metrics(): Acquire game context metrics for Major and Minor League games.

  • mlb_pbp(): Acquire pitch-by-pitch data for Major and Minor League games.

  • mlb_pbp_diff(): Acquire pitch-by-pitch data between two timecodes for Major and Minor League games.

Details

MLB Game

These functions retrieve MLB game information, content, linescores, win probability, pace, changes, context metrics, and pitch-by-pitch data from the MLB Stats API.


Retrieve additional game information for major and minor league games

Description

Retrieve additional game information for major and minor league games

Usage

mlb_game_info(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble that includes supplemental information, such as weather, official scorer, attendance, etc., for the game_pk provided

col_name types description
game_date character Game date (YYYY-MM-DD).
game_pk numeric Unique game identifier.
venue_name character Stadium name.
venue_id integer Venue ID.
temperature character Game-time temperature (degrees F).
other_weather character Weather condition description.
wind character Wind speed and direction.
attendance character Reported game attendance.
start_time character First-pitch local start time.
elapsed_time character Total elapsed game time (H:MM).
game_id character Human-readable game ID slug.
game_type character Game type code (R, P, etc.).
home_sport_code character Home sport code (always 'mlb').
official_scorer character Official scorer name.
date character Long-form game date label.
status_ind character Game status code.
home_league_id integer Home team league ID.
gameday_sw character Gameday data type code.

Examples

try(mlb_game_info(game_pk = 566001))

Retrieve game linescores for major and minor league games

Description

Retrieve game linescores for major and minor league games

Usage

mlb_game_linescore(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble with the following columns

col_name types description
game_pk numeric Unique game identifier.
home_team_id character Home team MLB ID.
home_team_name character Home team name.
away_team_id character Away team MLB ID.
away_team_name character Away team name.
num integer Inning number.
ordinal_num character Inning ordinal label (e.g. 1st).
home_runs integer Home runs scored in the inning.
home_hits integer Home hits in the inning.
home_errors integer Home errors in the inning.
home_left_on_base integer Home runners left on base in the inning.
away_runs integer Away runs scored in the inning.
away_hits integer Away hits in the inning.
away_errors integer Away errors in the inning.
away_left_on_base integer Away runners left on base in the inning.
home_team_all_star_status character Home team all-star status flag.
home_team_link character MLB Stats API relative home team link.
home_team_season character Home team season (YYYY).
home_team_venue_id character Home team venue ID.
home_team_venue_name character Home team venue name.
home_team_venue_link character MLB Stats API relative home venue link.
home_team_team_code character Home team code.
home_team_file_code character Home team file code.
home_team_abbreviation character Home team abbreviation.
home_team_team_name character Home team nickname.
home_team_location_name character Home team location/city name.
home_team_first_year_of_play character Home franchise first year of play.
home_team_league_id character Home team league ID.
home_team_league_name character Home team league name.
home_team_league_link character MLB Stats API relative home league link.
home_team_division_id character Home team division ID.
home_team_division_name character Home team division name.
home_team_division_link character MLB Stats API relative home division link.
home_team_sport_id character Home team sport ID.
home_team_sport_link character MLB Stats API relative home sport link.
home_team_sport_name character Home team sport name.
home_team_short_name character Home team short name.
home_team_record_games_played character Home team games played.
home_team_record_wild_card_games_back character Home team games back in the wild card.
home_team_record_league_games_back character Home team games back in the league.
home_team_record_spring_league_games_back character Home team games back in the spring league.
home_team_record_sport_games_back character Home team games back in the sport.
home_team_record_division_games_back character Home team games back in the division.
home_team_record_conference_games_back character Home team games back in the conference.
home_team_record_league_record_wins character Home team league-record wins.
home_team_record_league_record_losses character Home team league-record losses.
home_team_record_league_record_ties character Home team league-record ties.
home_team_record_league_record_pct character Home team winning percentage.
home_team_record_division_leader character Whether the home team leads its division.
home_team_record_wins character Home team wins.
home_team_record_losses character Home team losses.
home_team_record_winning_percentage character Home team winning percentage.
home_team_franchise_name character Home franchise name.
home_team_club_name character Home club name.
home_team_active character Whether the home team is active.
away_team_all_star_status character Away team all-star status flag.
away_team_link character MLB Stats API relative away team link.
away_team_season character Away team season (YYYY).
away_team_venue_id character Away team venue ID.
away_team_venue_name character Away team venue name.
away_team_venue_link character MLB Stats API relative away venue link.
away_team_team_code character Away team code.
away_team_file_code character Away team file code.
away_team_abbreviation character Away team abbreviation.
away_team_team_name character Away team nickname.
away_team_location_name character Away team location/city name.
away_team_first_year_of_play character Away franchise first year of play.
away_team_league_id character Away team league ID.
away_team_league_name character Away team league name.
away_team_league_link character MLB Stats API relative away league link.
away_team_division_id character Away team division ID.
away_team_division_name character Away team division name.
away_team_division_link character MLB Stats API relative away division link.
away_team_sport_id character Away team sport ID.
away_team_sport_link character MLB Stats API relative away sport link.
away_team_sport_name character Away team sport name.
away_team_short_name character Away team short name.
away_team_record_games_played character Away team games played.
away_team_record_wild_card_games_back character Away team games back in the wild card.
away_team_record_league_games_back character Away team games back in the league.
away_team_record_spring_league_games_back character Away team games back in the spring league.
away_team_record_sport_games_back character Away team games back in the sport.
away_team_record_division_games_back character Away team games back in the division.
away_team_record_conference_games_back character Away team games back in the conference.
away_team_record_league_record_wins character Away team league-record wins.
away_team_record_league_record_losses character Away team league-record losses.
away_team_record_league_record_ties character Away team league-record ties.
away_team_record_league_record_pct character Away team winning percentage.
away_team_record_division_leader character Whether the away team leads its division.
away_team_record_wins character Away team wins.
away_team_record_losses character Away team losses.
away_team_record_winning_percentage character Away team winning percentage.
away_team_franchise_name character Away franchise name.
away_team_club_name character Away club name.
away_team_active character Whether the away team is active.

Examples

try(mlb_game_linescore(game_pk = 566001))

Retrieve game pace metrics for major and minor league

Description

Retrieve game pace metrics for major and minor league

Usage

mlb_game_pace(
  season,
  league_ids = NULL,
  sport_ids = NULL,
  team_ids = NULL,
  game_type = NULL,
  venue_ids = NULL,
  org_type = NULL,
  start_date = NULL,
  end_date = NULL
)

Arguments

season

Year for which to return information (Required).

league_ids

The league_id(s) for which to return information.

sport_ids

The sport_id(s) for which to return information.

team_ids

The team_id(s) for which to return information.

game_type

The game_type for which to return information.

venue_ids

Venue directorial information based venue_id.

org_type

pace of game metrics based on team ('T'), league ('L') or sport('S')

start_date

Date of first game for which you want data. Format must be in MM/DD/YYYY format.

end_date

Date of last game for which you want data. Format must be in MM/DD/YYYY format.

Value

Returns a tibble with the following columns

col_name types description
hits_per9inn numeric Hits per 9 innings.
runs_per9inn numeric Runs per 9 innings.
pitches_per9inn numeric Pitches per 9 innings.
plate_appearances_per9inn numeric Plate appearances per 9 innings.
hits_per_game numeric Hits per game.
runs_per_game numeric Runs per game.
innings_played_per_game numeric Innings played per game.
pitches_per_game numeric Pitches per game.
pitchers_per_game numeric Pitchers used per game.
plate_appearances_per_game numeric Plate appearances per game.
total_game_time character Total game time (HHH:MM:SS).
total_innings_played numeric Total innings played.
total_hits integer Total hits.
total_runs integer Total runs.
total_plate_appearances integer Total plate appearances.
total_pitchers integer Total pitchers used.
total_pitches integer Total pitches thrown.
total_games integer Total games.
total7inn_games integer Total 7-inning games.
total9inn_games integer Total 9-inning games.
total_extra_inn_games integer Total extra-inning games.
time_per_game character Average time per game (HH:MM:SS).
time_per_pitch character Average time per pitch (HH:MM:SS).
time_per_hit character Average time per hit (HH:MM:SS).
time_per_run character Average time per run (HH:MM:SS).
time_per_plate_appearance character Average time per plate appearance (HH:MM:SS).
time_per9inn character Average time per 9 innings (HH:MM:SS).
time_per77plate_appearances character Average time per 77 plate appearances.
total_extra_inn_time character Total extra-inning time (HHH:MM:SS).
time_per7inn_game character Average time per 7-inning game (HH:MM:SS).
time_per7inn_game_without_extra_inn character Average time per 7-inning game excl. extras.
total7inn_games_scheduled integer Total 7-inning games scheduled.
total7inn_games_without_extra_inn integer Total 7-inning games without extra innings.
total9inn_games_without_extra_inn integer Total 9-inning games without extra innings.
total9inn_games_scheduled integer Total 9-inning games scheduled.
hits_per_run numeric Hits per run.
pitches_per_pitcher numeric Pitches per pitcher.
season character Season (YYYY).
total9inn_games_completed_early integer 9-inning games completed early.
total7inn_games_completed_early integer 7-inning games completed early.
sport_id integer MLB sport ID.
sport_code character Sport code (e.g. mlb, aaa).
sport_link character MLB Stats API relative sport link.
pr_portal_calculated_fields_total7inn_games integer Portal-calculated total 7-inning games.
pr_portal_calculated_fields_total9inn_games integer Portal-calculated total 9-inning games.
pr_portal_calculated_fields_total_extra_inn_games integer Portal-calculated total extra-inning games.
pr_portal_calculated_fields_time_per7inn_game character Portal-calculated time per 7-inning game.
pr_portal_calculated_fields_time_per9inn_game character Portal-calculated time per 9-inning game.
pr_portal_calculated_fields_time_per_extra_inn_game character Portal-calculated time per extra-inning game.

Examples

try(mlb_game_pace(season = 2021, start_date = "09/14/2021", end_date = "09/16/2021"))

Get MLB Game Info by Date and Level

Description

Find game_pk values for professional baseball games (major and minor leagues) via the MLB api https://www.mlb.com/

Usage

mlb_game_pks(date, level_ids = c(1))

Arguments

date

The date for which you want to find game_pk values for MLB games

level_ids

A numeric vector with ids for each level where game_pks are desired. See below for a reference of level ids.

Details

Level IDs:

The following IDs can be passed to the level_ids argument:

1 = MLB 11 = Triple-A 12 = Doubl-A 13 = Class A Advanced 14 = Class A 15 = Class A Short Season 5442 = Rookie Advanced 16 = Rookie 17 = Winter League

Value

Returns a tibble that includes game_pk values and additional information for games scheduled or played with the following columns:

col_name types description
game_pk integer Unique game identifier.
gameGuid character Globally unique game identifier.
link character MLB Stats API relative game link.
gameType character Game type code (R, P, etc.).
season character Season (YYYY).
gameDate character Game date-time (ISO 8601, UTC).
officialDate character Official game date (YYYY-MM-DD).
isTie logical Whether the game ended in a tie.
gameNumber integer Game number within a doubleheader.
publicFacing logical Whether the game is public-facing.
doubleHeader character Doubleheader indicator (N/Y/S).
gamedayType character Gameday data type code.
tiebreaker character Tiebreaker indicator.
calendarEventID character Calendar event identifier.
seasonDisplay character Display season (YYYY).
dayNight character Day/night designation.
scheduledInnings integer Number of scheduled innings.
reverseHomeAwayStatus logical Whether home/away designation is reversed.
inningBreakLength integer Length of the inning break (seconds).
gamesInSeries integer Total games in the series.
seriesGameNumber integer Game number within the series.
seriesDescription character Series description.
recordSource character Source of the record data.
ifNecessary character Whether the game is played only if necessary.
ifNecessaryDescription character If-necessary description.
status.abstractGameState character Abstract game state (e.g. Final).
status.codedGameState character Coded game state.
status.detailedState character Detailed game state.
status.statusCode character Game status code.
status.startTimeTBD logical Whether the start time is TBD.
status.abstractGameCode character Abstract game code.
teams.away.score integer Away team score.
teams.away.isWinner logical Whether the away team won.
teams.away.splitSquad logical Whether the away team is a split squad.
teams.away.seriesNumber integer Away team series number.
teams.away.team.id integer Away team MLB ID.
teams.away.team.name character Away team name.
teams.away.team.link character MLB Stats API relative away team link.
teams.away.leagueRecord.wins integer Away team league-record wins.
teams.away.leagueRecord.losses integer Away team league-record losses.
teams.away.leagueRecord.ties integer Away team league-record ties.
teams.away.leagueRecord.pct character Away team winning percentage.
teams.home.score integer Home team score.
teams.home.isWinner logical Whether the home team won.
teams.home.splitSquad logical Whether the home team is a split squad.
teams.home.seriesNumber integer Home team series number.
teams.home.team.id integer Home team MLB ID.
teams.home.team.name character Home team name.
teams.home.team.link character MLB Stats API relative home team link.
teams.home.leagueRecord.wins integer Home team league-record wins.
teams.home.leagueRecord.losses integer Home team league-record losses.
teams.home.leagueRecord.ties integer Home team league-record ties.
teams.home.leagueRecord.pct character Home team winning percentage.
venue.id integer Venue ID.
venue.name character Venue name.
venue.link character MLB Stats API relative venue link.
content.link character MLB Stats API relative game content link.

Examples

try(mlb_game_pks("2019-04-29"))

MLB Game Status Codes

Description

MLB Game Status Codes

Usage

mlb_game_status_codes()

Value

Returns a tibble with the following columns

col_name types description
abstract_game_state character Abstract game state grouping (e.g. 'Preview', 'Live', 'Final').
coded_game_state character Single-letter coded game state (e.g. 'S', 'P', 'I', 'F').
detailed_state character Detailed status description (e.g. 'Scheduled', 'Pre-Game', 'In Progress').
status_code character Status code identifier (e.g. 'S', 'P', 'I', 'F').
reason character Reason text for the status when applicable (e.g. delay/postponement).
abstract_game_code character Single-letter abstract game code (e.g. 'P', 'L', 'F').

Examples

try(mlb_game_status_codes())

Acquire time codes for Major and Minor League games

Description

Acquire time codes for Major and Minor League games

Usage

mlb_game_timecodes(game_pk)

Arguments

game_pk

The game_pk for the game requested

Value

Returns a tibble that includes time codes from the game_pk requested

col_name types description
timecodes character Play snapshot time code in 'YYYYMMDD_HHMMSS' format.

Examples

try(mlb_game_timecodes(game_pk = 632970))

MLB Game Types

Description

MLB Game Types

Usage

mlb_game_types()

Value

Returns a tibble with the following columns

col_name types description
game_type_id character Single-letter game type code (e.g. 'S', 'R', 'P', 'W').
game_type_description character Game type description (e.g. 'Spring Training', 'Regular Season').

Examples

try(mlb_game_types())

Acquire win probability for Major and Minor League games

Description

Acquire win probability for Major and Minor League games

Usage

mlb_game_wp(game_pk, timecode = NULL)

Arguments

game_pk

The game_pk for the game requested

timecode

The time code for the MLB game (format: MMDDYYYY_HHMMSS)

Value

Returns a tibble that includes time codes from the game_pk requested

col_name types description
home_team_win_probability numeric Home team win probability (percent) entering the at-bat.
away_team_win_probability numeric Away team win probability (percent) entering the at-bat.
home_team_win_probability_added numeric Change in home team win probability attributed to the at-bat.
at_bat_index integer Zero-based index of the at-bat within the game.
leverage_index numeric Leverage index quantifying the importance of the at-bat situation.

Examples

try(mlb_game_wp(game_pk = 531060))

Acquire high/low stats for Major and Minor Leagues

Description

Acquire high/low stats for Major and Minor Leagues

Usage

mlb_high_low_stats(
  org_type,
  season,
  sort_stat,
  team_ids = NULL,
  league_ids = NULL,
  sport_ids = NULL,
  game_type = NULL,
  stat_group = NULL,
  limit = NULL
)

Arguments

org_type

The organization type for return information (Required). Valid values include:

  • player

  • team

  • division

  • league

  • sport

season

The season for which you want to return information (Required).

sort_stat

The stat to sort the return (Required). Valid values can be found from 'stat_lookup_param' below

stat_name stat_lookup_param is_counting stat_label stat_groups org_types high_low_types
at_bats atBats TRUE At bats hitting , pitching PLAYER, TEAM PLAYER, TEAM , GAME
total_plate_appearances plateAppearances TRUE Total plate appearances hitting PLAYER, TEAM PLAYER, TEAM , GAME
runs runs TRUE Runs hitting PLAYER, TEAM PLAYER, TEAM , GAME
runs_batted_in rbi TRUE Runs batted in hitting PLAYER, TEAM PLAYER, TEAM , GAME
home_team_runs runs TRUE Home team runs hitting TEAM GAME
away_team_runs runs TRUE Away team runs hitting TEAM GAME
hits hits TRUE Hits hitting PLAYER, TEAM PLAYER, TEAM , GAME
hits_risp hitsRisp TRUE Hits risp hitting PLAYER, TEAM PLAYER, TEAM
home_team_hits hits TRUE Home team hits hitting TEAM GAME
away_team_hits hits TRUE Away team hits hitting TEAM GAME
total_bases totalBases TRUE Total bases hitting , pitching PLAYER, TEAM PLAYER, TEAM
doubles doubles TRUE Doubles hitting , pitching PLAYER, TEAM PLAYER, TEAM , GAME
triples triples TRUE Triples hitting PLAYER, TEAM PLAYER, TEAM , GAME
home_runs homeRuns TRUE Home runs hitting , pitching PLAYER, TEAM PLAYER, TEAM
extra_base_hits extraBaseHits TRUE Extra base hits hitting PLAYER, TEAM PLAYER, TEAM
walks baseOnBalls TRUE Walks hitting , pitching PLAYER, TEAM PLAYER, TEAM
strikeouts strikeouts TRUE Strikeouts hitting , pitching PLAYER, TEAM PLAYER, TEAM
stolen_bases stolenBases TRUE Stolen bases hitting PLAYER, TEAM PLAYER, TEAM
caught_stealing caughtStealing TRUE Caught stealing hitting , pitching, fielding PLAYER, TEAM PLAYER, TEAM
sacrifice_flies sacFlies TRUE Sacrifice flies hitting PLAYER, TEAM PLAYER, TEAM
sacrifice_bunts sacBunts TRUE Sacrifice bunts hitting PLAYER, TEAM PLAYER, TEAM
hit_by_pitches hitByPitch TRUE Hit by pitches hitting , pitching PLAYER, TEAM PLAYER, TEAM
left_on_base leftOnBase TRUE Left on base hitting PLAYER, TEAM PLAYER, TEAM
ground_into_double_plays groundIntoDoublePlay TRUE Ground into double plays hitting , pitching PLAYER, TEAM PLAYER, TEAM
strikes strikes TRUE Strikes pitching PLAYER, TEAM PLAYER, TEAM , GAME
pitches pitchesThrown TRUE Pitches pitching PLAYER, TEAM PLAYER, TEAM , GAME
balks balks TRUE Balks pitching PLAYER, TEAM PLAYER, TEAM , GAME
innings_pitched inningsPitched TRUE Innings pitched pitching PLAYER PLAYER
errors errors TRUE Errors fielding TEAM
home_team_errors errors TRUE Home team errors fielding TEAM
away_team_errors errors TRUE Away team errors fielding TEAM
chances chances TRUE Chances fielding TEAM
put_outs putOuts TRUE Put outs fielding TEAM
assists assists TRUE Assists fielding TEAM
double_plays doublePlays TRUE Double plays fielding TEAM
attendance attendance TRUE Attendance game TEAM GAME
game_time gameDuration TRUE Game time game TEAM GAME
delay_time gameDuration TRUE Delay time game TEAM GAME
longest gameDuration TRUE Longest game TEAM
shortest gameDuration TRUE Shortest game TEAM
inning innings TRUE Inning game TEAM GAME
win_streak winStreak TRUE Win streak streak TEAM
loss_streak lossStreak TRUE Loss streak streak TEAM
team_ids

The team_id(s) for which to return information.

league_ids

The league_id(s) for which to return information.

sport_ids

The sport_id(s) for which to return information.

game_type

The game_type for which to return information.

stat_group

Stat group for which to return information. Valid values include:

stat_group
hitting
pitching
fielding
catching
running
game
team
streak
limit

Number of records as the limit of the return.

Value

Returns a tibble with the following columns

col_name types description
total_splits integer Total number of split records matching the query.
season integer Season year for the split.
date character Date of the game (YYYY-MM-DD).
is_home logical Whether the subject team was the home team.
rank integer Rank of the split within the high/low leaderboard.
game_innings integer Number of innings played in the game.
stat_at_bats integer Value of the sorted statistic (here at bats) for the split.
team_id integer MLB team id for the subject team.
team_name character Subject team name.
team_link character API relative link to the subject team.
opponent_id integer MLB team id for the opponent.
opponent_name character Opponent team name.
opponent_link character API relative link to the opponent team.
game_pk integer MLB game primary key.
game_link character API relative link to the game live feed.
game_number integer Game number within a day (1 unless a doubleheader).
game_day_night character Day/night designation of the game ('day' or 'night').
game_content_link character API relative link to the game content endpoint.
home_team_id integer Home team id (populated for game-level org types).
home_team_name character Home team name (populated for game-level org types).
home_team_link character API relative link to the home team.
away_team_id integer Away team id (populated for game-level org types).
away_team_name character Away team name (populated for game-level org types).
away_team_link character API relative link to the away team.
combined_stats logical Whether the stat combines multiple split sources.
group_display_name character Stat group display name (e.g. 'hitting').
game_type_id character Single-letter game type code (e.g. 'R').
game_type_description character Game type description (e.g. 'Regular Season').
sort_stat_name character Snake-case name of the sorted statistic (e.g. 'at_bats').
sort_stat_lookup_param character API lookup parameter for the sorted statistic (e.g. 'atBats').
sort_stat_is_counting logical Whether the sorted statistic is a counting stat.
sort_stat_label character Human-readable label of the sorted statistic (e.g. 'At bats').

Examples

try(mlb_high_low_stats(org_type = 'Team', season = 2020, sort_stat = 'atBats'))

MLB Stat High/Low Types

Description

MLB Stat High/Low Types

Usage

mlb_high_low_types()

Value

Returns a tibble with the following columns

col_name types description
stat_name character Snake-case name of the statistic (e.g. 'at_bats').
stat_lookup_param character API lookup parameter for the statistic (e.g. 'atBats').
is_counting logical Whether the statistic is a counting stat.
stat_label character Human-readable label of the statistic (e.g. 'At bats').
stat_groups list List-column of stat group display names the stat belongs to.
org_types list List-column of organization types the stat applies to (e.g. PLAYER).
high_low_types list List-column of high/low aggregation types (e.g. PLAYER, TEAM, GAME).

Examples

try(mlb_high_low_types())

MLB Hit Trajectories

Description

MLB Hit Trajectories

Usage

mlb_hit_trajectories()

Value

Returns a tibble with the following columns

col_name types description
hit_trajectory_code character Hit trajectory code (e.g. 'bunt_grounder', 'bunt_popup').
hit_trajectory_description character Hit trajectory description (e.g. 'Bunt - Ground Ball', 'Bunt - Popup').

Examples

try(mlb_hit_trajectories())

Retrieve Homerun Derby data

Description

Retrieve Homerun Derby data

Usage

mlb_homerun_derby(game_pk)

Arguments

game_pk

The game_pk for which you want to return data

Value

Returns a tibble with the following columns

col_name types description
game_pk integer MLB game primary key for the Home Run Derby event.
event_name character Event name (e.g. 'All-Star Workout Day: Home Run Derby').
event_date character Event date-time in ISO 8601 (e.g. '2017-07-11T00:00:00Z').
event_type_code character Single-letter event type code (e.g. 'O').
event_type_name character Event type name (e.g. 'Other').
venue_id integer MLB venue id hosting the event.
venue_name character Venue name (e.g. 'Marlins Park').
round integer Derby round number for the matchup.
batter character Full name of the batter for this swing record.
batter_id integer MLB player id of the batter.
batter_link character API relative link to the batter.
top_seed_complete logical Whether the top seed's turn in the matchup is complete.
top_seed_started logical Whether the top seed's turn in the matchup has started.
top_seed_winner logical Whether the top seed won the matchup.
bonus_time logical Whether the swing occurred during bonus time.
home_run logical Whether the swing was scored a home run.
tie_breaker logical Whether the swing occurred during a tie-breaker.
is_home_run logical Whether the recorded hit is a home run.
time_remaining character Time remaining on the clock when the swing occurred.
is_bonus_time logical Whether the swing counted toward bonus time.
is_tie_breaker logical Whether the swing counted toward a tie-breaker.
hit_data_launch_speed integer Exit velocity of the home run swing (mph).
hit_data_launch_angle integer Launch angle of the batted ball (degrees).
hit_data_total_distance integer Projected total distance of the batted ball (feet).
hit_data_coordinates_coord_x numeric Hit location x-coordinate on the field overlay.
hit_data_coordinates_coord_y numeric Hit location y-coordinate on the field overlay.
hit_data_coordinates_landing_pos_x numeric Landing position x-coordinate of the batted ball.
hit_data_coordinates_landing_pos_y numeric Landing position y-coordinate of the batted ball.
hit_data_trajectory_data_trajectory_polynomial_x list Polynomial coefficients of the x trajectory.
hit_data_trajectory_data_trajectory_polynomial_y list Polynomial coefficients of the y trajectory.
hit_data_trajectory_data_trajectory_polynomial_z list Polynomial coefficients of the z trajectory.
hit_data_trajectory_data_valid_time_interval list Valid time interval for the trajectory fit (seconds).
top_seed_seed integer Bracket seed number of the top seed.
top_seed_is_winner logical Whether the top seed is the matchup winner.
top_seed_is_complete logical Whether the top seed's turn is complete.
top_seed_is_started logical Whether the top seed's turn has started.
top_seed_num_home_runs integer Number of home runs hit by the top seed.
top_seed_player_id integer MLB player id of the top seed.
top_seed_player_full_name character Full name of the top seed.
top_seed_player_link character API relative link to the top seed player.
top_seed_top_derby_hit_data_launch_speed integer Top seed's hardest-hit exit velocity in the round (mph).
top_seed_top_derby_hit_data_total_distance integer Top seed's longest projected distance in the round (feet).
bottom_seed_complete logical Whether the bottom seed's turn in the matchup is complete.
bottom_seed_started logical Whether the bottom seed's turn in the matchup has started.
bottom_seed_winner logical Whether the bottom seed won the matchup.
bottom_seed_seed integer Bracket seed number of the bottom seed.
bottom_seed_is_winner logical Whether the bottom seed is the matchup winner.
bottom_seed_is_complete logical Whether the bottom seed's turn is complete.
bottom_seed_is_started logical Whether the bottom seed's turn has started.
bottom_seed_num_home_runs integer Number of home runs hit by the bottom seed.
bottom_seed_player_id integer MLB player id of the bottom seed.
bottom_seed_player_full_name character Full name of the bottom seed.
bottom_seed_player_link character API relative link to the bottom seed player.
bottom_seed_top_derby_hit_data_launch_speed integer Bottom seed's hardest-hit exit velocity in the round (mph).
bottom_seed_top_derby_hit_data_total_distance integer Bottom seed's longest projected distance in the round (feet).
venue_link character API relative link to the event venue.
is_multi_day logical Whether the event spans multiple days.
is_primary_calendar logical Whether the event is on the primary calendar.
file_code character Internal file code for the event.
event_number integer Event number identifier.
public_facing logical Whether the event is public facing.

Examples

try(mlb_homerun_derby(game_pk = 511101))

Retrieve Homerun Derby Bracket

Description

Retrieve Homerun Derby Bracket

Usage

mlb_homerun_derby_bracket(game_pk)

Arguments

game_pk

The game_pk for which you want to return data

Value

Returns a tibble with the following columns

col_name types description
game_pk integer MLB game primary key for the Home Run Derby event.
event_name character Event name (e.g. 'All-Star Workout Day: Home Run Derby').
event_type_code character Single-letter event type code (e.g. 'O').
event_type_name character Event type name (e.g. 'Other').
event_date character Event date-time in ISO 8601 (e.g. '2017-07-11T00:00:00Z').
venue_id integer MLB venue id hosting the event.
venue_name character Venue name (e.g. 'Marlins Park').
venue_link character API relative link to the event venue.
is_multi_day logical Whether the event spans multiple days.
is_primary_calendar logical Whether the event is on the primary calendar.
file_code character Internal file code for the event.
event_number integer Event number identifier.
public_facing logical Whether the event is public facing.
round integer Derby bracket round number.
top_seed_complete logical Whether the top seed's turn in the matchup is complete.
top_seed_started logical Whether the top seed's turn in the matchup has started.
top_seed_winner logical Whether the top seed won the matchup.
top_seed_seed integer Bracket seed number of the top seed.
top_seed_is_winner logical Whether the top seed is the matchup winner.
top_seed_is_complete logical Whether the top seed's turn is complete.
top_seed_is_started logical Whether the top seed's turn has started.
top_seed_num_home_runs integer Number of home runs hit by the top seed.
top_seed_player_id integer MLB player id of the top seed.
top_seed_player_full_name character Full name of the top seed.
top_seed_player_link character API relative link to the top seed player.
top_seed_top_derby_hit_data_launch_speed integer Top seed's hardest-hit exit velocity in the round (mph).
top_seed_top_derby_hit_data_total_distance integer Top seed's longest projected distance in the round (feet).
bottom_seed_complete logical Whether the bottom seed's turn in the matchup is complete.
bottom_seed_started logical Whether the bottom seed's turn in the matchup has started.
bottom_seed_winner logical Whether the bottom seed won the matchup.
bottom_seed_seed integer Bracket seed number of the bottom seed.
bottom_seed_is_winner logical Whether the bottom seed is the matchup winner.
bottom_seed_is_complete logical Whether the bottom seed's turn is complete.
bottom_seed_is_started logical Whether the bottom seed's turn has started.
bottom_seed_num_home_runs integer Number of home runs hit by the bottom seed.
bottom_seed_player_id integer MLB player id of the bottom seed.
bottom_seed_player_full_name character Full name of the bottom seed.
bottom_seed_player_link character API relative link to the bottom seed player.
bottom_seed_top_derby_hit_data_launch_speed integer Bottom seed's hardest-hit exit velocity in the round (mph).
bottom_seed_top_derby_hit_data_total_distance integer Bottom seed's longest projected distance in the round (feet).

Examples

try(mlb_homerun_derby_bracket(game_pk = 511101))

MLB Home Run Derby Endpoint Overview

Description

  • mlb_homerun_derby(): Retrieve Homerun Derby data.

  • mlb_homerun_derby_bracket(): Retrieve Homerun Derby Bracket.

  • mlb_homerun_derby_players(): Retrieve Homerun Derby Players.

Details

MLB Home Run Derby

These functions retrieve MLB Home Run Derby data, bracket, and player information from the MLB Stats API.


Retrieve Homerun Derby Players

Description

Retrieve Homerun Derby Players

Usage

mlb_homerun_derby_players(game_pk)

Arguments

game_pk

The game_pk for which you want to return data

Value

Returns a tibble with the following columns

col_name types description
game_pk integer MLB game primary key for the Home Run Derby event.
event_name character Event name (e.g. 'All-Star Workout Day: Home Run Derby').
event_date character Event date-time in ISO 8601 (e.g. '2017-07-11T00:00:00Z').
event_type_code character Single-letter event type code (e.g. 'O').
event_type_name character Event type name (e.g. 'Other').
venue_id integer MLB venue id hosting the event.
venue_name character Venue name (e.g. 'Marlins Park').
player_id integer MLB player id of the participant.
player_full_name character Participant full name.
player_link character API relative link to the player.
player_first_name character Participant first name.
player_last_name character Participant last name.
player_primary_number character Participant primary jersey number.
player_birth_date character Participant birth date (YYYY-MM-DD).
player_current_age integer Participant current age in years.
player_birth_city character Participant birth city.
player_birth_state_province character Participant birth state or province.
player_birth_country character Participant birth country.
player_height character Participant height (e.g. "6' 5\"").
player_weight integer Participant weight in pounds.
player_active logical Whether the participant is currently an active player.
player_use_name character Participant preferred display first name.
player_middle_name character Participant middle name.
player_boxscore_name character Participant short box score name.
player_nick_name character Participant nickname.
player_gender character Participant gender code (e.g. 'M').
player_is_player logical Whether the person is classified as a player.
player_is_verified logical Whether the player profile is verified.
player_draft_year integer Year the participant was drafted.
player_pronunciation character Phonetic pronunciation of the participant's name.
player_mlb_debut_date character Participant MLB debut date (YYYY-MM-DD).
player_name_first_last character Participant name in first-last order.
player_name_slug character URL slug for the participant (name plus id).
player_first_last_name character Participant name in first-last order.
player_last_first_name character Participant name in last, first order.
player_last_init_name character Participant name as last, first initial.
player_init_last_name character Participant name as first initial last.
player_full_fml_name character Participant full first-middle-last name.
player_full_lfm_name character Participant full last, first-middle name.
player_strike_zone_top numeric Top of the participant's strike zone (feet).
player_strike_zone_bottom numeric Bottom of the participant's strike zone (feet).
player_name_matrilineal character Participant matrilineal name when provided.
player_current_team_id integer Participant current team id.
player_current_team_name character Participant current team name.
player_current_team_link character API relative link to the current team.
player_current_team_season integer Season of the current team reference.
player_current_team_team_code character Current team three-letter team code.
player_current_team_file_code character Current team file code.
player_current_team_abbreviation character Current team abbreviation (e.g. 'NYY').
player_current_team_team_name character Current team short team name (e.g. 'Yankees').
player_current_team_location_name character Current team location name.
player_current_team_first_year_of_play character Franchise first year of play.
player_current_team_short_name character Current team short name.
player_current_team_franchise_name character Current team franchise name.
player_current_team_club_name character Current team club name.
player_current_team_all_star_status character Current team all-star status flag.
player_current_team_active logical Whether the current team is active.
player_current_team_parent_org_name character Parent organization name (minors).
player_current_team_parent_org_id integer Parent organization id (minors).
player_current_team_venue_id integer Current team home venue id.
player_current_team_venue_name character Current team home venue name.
player_current_team_venue_link character API relative link to the team venue.
player_current_team_spring_venue_id integer Current team spring training venue id.
player_current_team_spring_venue_link character API relative link to the spring venue.
player_current_team_league_id integer Current team league id (e.g. 103, 104).
player_current_team_league_name character Current team league name.
player_current_team_league_link character API relative link to the league.
player_current_team_division_id integer Current team division id.
player_current_team_division_name character Current team division name.
player_current_team_division_link character API relative link to the division.
player_current_team_sport_id integer Current team sport id (1 for MLB).
player_current_team_sport_link character API relative link to the sport.
player_current_team_sport_name character Current team sport name.
player_current_team_spring_league_id integer Spring league id.
player_current_team_spring_league_name character Spring league name (e.g. 'Grapefruit League').
player_current_team_spring_league_link character API relative link to the spring league.
player_current_team_spring_league_abbreviation character Spring league abbreviation (e.g. 'GL').
player_primary_position_code character Participant primary position code.
player_primary_position_name character Participant primary position name.
player_primary_position_type character Participant primary position type (e.g. 'Hitter').
player_primary_position_abbreviation character Participant primary position abbreviation (e.g. 'DH').
player_bat_side_code character Participant batting side code (e.g. 'R').
player_bat_side_description character Participant batting side description (e.g. 'Right').
player_pitch_hand_code character Participant throwing hand code (e.g. 'R').
player_pitch_hand_description character Participant throwing hand description (e.g. 'Right').
venue_link character API relative link to the event venue.
is_multi_day logical Whether the event spans multiple days.
is_primary_calendar logical Whether the event is on the primary calendar.
file_code character Internal file code for the event.
event_number integer Event number identifier.
public_facing logical Whether the event is public facing.

Examples

try(mlb_homerun_derby_players(game_pk = 511101))

MLB Job Types

Description

MLB Job Types

Usage

mlb_job_types()

Value

Returns a tibble with the following columns

col_name types description
job_code character Four-letter job type code (e.g. 'UMPR', 'UDIR').
job character Job title (e.g. 'Umpire', 'Director of Instant Replay').
sort_order integer Display sort order for the job type.

Examples

try(mlb_job_types())

MLB Jobs

Description

MLB Jobs

Usage

mlb_jobs(job_type = "UMPR", sport_id = NULL, date = NULL)

Arguments

job_type

Return information for a given job_type. See mlb_job_types()

sport_id

Return information for a given sport_id.

date

Return information for a given date.

Value

Returns a tibble with the following columns

col_name types description
jersey_number character Jersey number worn (often blank for non-uniformed roles).
job character Job title (e.g. 'Umpire').
job_code character Four-letter job type code (e.g. 'UMPR').
title character Specific role title for the assignment.
person_id integer MLB person id for the individual.
person_full_name character Full name of the individual.
person_link character API relative link to the person.

Examples

try(mlb_jobs(job_type='UMPR'))

MLB Jobs Datacasters

Description

MLB Jobs Datacasters

Usage

mlb_jobs_datacasters(sport_id = NULL, date = NULL)

Arguments

sport_id

Return information for a given sport_id.

date

Return information for a given date.

Value

Returns a tibble with the following columns

col_name types description
jersey_number character Jersey number (typically blank for datacasters).
job character Job title (e.g. 'Stringer').
job_code character Four-letter job type code (e.g. 'MSTR').
title character Specific role title for the assignment.
person_id integer MLB person id for the datacaster.
person_full_name character Full name of the datacaster.
person_link character API relative link to the person.

Examples

try(mlb_jobs_datacasters(sport_id=1))

MLB Jobs Endpoint Overview

Description

  • mlb_jobs(): MLB Jobs.

  • mlb_jobs_datacasters(): MLB Jobs Datacasters.

  • mlb_jobs_official_scorers(): MLB Jobs Official Scorers.

  • mlb_jobs_umpires(): MLB Jobs Umpires.

  • mlb_job_types(): MLB Job Types.

Details

MLB Jobs

These functions retrieve MLB job, datacaster, official scorer, umpire, and job-type information from the MLB Stats API.


MLB Jobs Official Scorers

Description

MLB Jobs Official Scorers

Usage

mlb_jobs_official_scorers(sport_id = NULL, date = NULL)

Arguments

sport_id

Return information for a given sport_id.

date

Return information for a given date.

Value

Returns a tibble with the following columns

col_name types description
jersey_number character Jersey number (typically blank for official scorers).
job character Job title (e.g. 'Official Scorer').
job_code character Four-letter job type code (e.g. 'SCOR').
title character Specific role title for the assignment.
person_id integer MLB person id for the official scorer.
person_full_name character Full name of the official scorer.
person_link character API relative link to the person.

Examples

try(mlb_jobs_official_scorers(sport_id=1))

MLB Jobs Umpires

Description

MLB Jobs Umpires

Usage

mlb_jobs_umpires(sport_id = NULL, date = NULL)

Arguments

sport_id

Return information for a given sport_id.

date

Return information for a given date.

Value

Returns a tibble with the following columns

col_name types description
jersey_number character Umpire jersey number.
job character Job title (e.g. 'Umpire').
job_code character Four-letter job type code (e.g. 'UMPR').
title character Specific role title for the assignment.
person_id integer MLB person id for the umpire.
person_full_name character Full name of the umpire.
person_link character API relative link to the person.

Examples

try(mlb_jobs_umpires(sport_id=1))

MLB API Language Options

Description

MLB API Language Options

Usage

mlb_languages()

Value

Returns a tibble with the following columns

col_name types description
language_id integer Numeric language identifier.
language_code character Short language code (e.g. 'en', 'xe').
language_name character Language display name (e.g. 'English', 'Elias').
locale character Locale string for the language (e.g. 'en_US').

Examples

try(mlb_languages())

MLB Leagues

Description

MLB Leagues

Usage

mlb_league(seasons = NULL, sport_id = NULL, league_id = NULL)

Arguments

seasons

Year(s) to return to return league information for.

sport_id

The sport_id to return league information for.

league_id

The league_id(s) to return league information for.

Value

Returns a tibble with the following columns

col_name types description
league_id integer MLB league id (e.g. 103 for AL, 104 for NL).
league_name character League name (e.g. 'American League').
league_link character API relative link to the league.
league_abbreviation character League abbreviation (e.g. 'AL').
league_name_short character Short league name (e.g. 'American').
league_season_state character Season state (e.g. 'offseason', 'regular').
league_has_wild_card logical Whether the league uses a wild card.
league_has_split_season logical Whether the league has a split season.
league_num_games integer Scheduled number of regular season games.
league_has_playoff_points logical Whether the league awards playoff points.
league_num_teams integer Number of teams in the league.
league_num_wildcard_teams integer Number of wild card teams.
league_season character Season year for the league record.
league_org_code character Organization code (e.g. 'AL').
league_conferences_in_use logical Whether conferences are used.
league_divisions_in_use logical Whether divisions are used.
league_sort_order integer Display sort order for the league.
league_active logical Whether the league is active.
season_date_info_season_id character Season identifier for the date info block.
season_date_info_pre_season_start_date character Preseason start date (YYYY-MM-DD).
season_date_info_pre_season_end_date character Preseason end date (YYYY-MM-DD).
season_date_info_season_start_date character Season start date (YYYY-MM-DD).
season_date_info_spring_start_date character Spring training start date (YYYY-MM-DD).
season_date_info_spring_end_date character Spring training end date (YYYY-MM-DD).
season_date_info_regular_season_start_date character Regular season start date (YYYY-MM-DD).
season_date_info_last_date1st_half character Last date of the first half (YYYY-MM-DD).
season_date_info_all_star_date character All-Star Game date (YYYY-MM-DD).
season_date_info_first_date2nd_half character First date of the second half (YYYY-MM-DD).
season_date_info_regular_season_end_date character Regular season end date (YYYY-MM-DD).
season_date_info_post_season_start_date character Postseason start date (YYYY-MM-DD).
season_date_info_post_season_end_date character Postseason end date (YYYY-MM-DD).
season_date_info_season_end_date character Season end date (YYYY-MM-DD).
season_date_info_offseason_start_date character Offseason start date (YYYY-MM-DD).
season_date_info_off_season_end_date character Offseason end date (YYYY-MM-DD).
season_date_info_season_level_gameday_type character Season-level Gameday data type code.
season_date_info_game_level_gameday_type character Game-level Gameday data type code.
season_date_info_qualifier_plate_appearances numeric Plate appearances per game needed to qualify.
season_date_info_qualifier_outs_pitched integer Outs pitched per game needed to qualify.
sport_id integer Sport id associated with the league (1 for MLB).
sport_link character API relative link to the sport.

Examples

try(mlb_league(seasons = 2021, sport_id = 1))

MLB League Leader Types

Description

MLB League Leader Types

Usage

mlb_league_leader_types()

Value

Returns a tibble with the following columns

col_name types description
leader_type character League leader category display name (e.g. 'assists', 'shutouts').

Examples

try(mlb_league_leader_types())

MLB Logical Events

Description

MLB Logical Events

Usage

mlb_logical_events()

Value

Returns a tibble with the following columns

col_name types description
event_code character Logical event code used by the MLB Gameday feed (e.g. 'newBatter').

Examples

try(mlb_logical_events())

MLB Metrics

Description

MLB Metrics

Usage

mlb_metrics()

Value

Returns a tibble with the following columns

col_name types description
metric_name character Metric name (e.g. 'releaseSpinRate').
metric_id integer Numeric metric identifier.
stat_group character Stat group the metric belongs to (e.g. 'pitching').
metric_unit character Unit of measure for the metric (e.g. 'RPM').

Examples

try(mlb_metrics())

Acquire pitch-by-pitch data for Major and Minor League games

Description

Acquire pitch-by-pitch data for Major and Minor League games

Usage

mlb_pbp(game_pk)

Arguments

game_pk

The date for which you want to find game_pk values for MLB games

Value

Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch level.

Some data will vary depending on the park and the league level, as most sensor data is not available in minor league parks via this API. Note that the column names have mostly been left as-is and there are likely duplicate columns in terms of the information they provide. I plan to clean the output up down the road, but for now I am leaving the majority as-is.

Both major and minor league pitch-by-pitch data can be pulled with this function.

col_name types description
game_pk numeric MLB game primary key.
game_date character Game date (YYYY-MM-DD).
index integer Index of the play event within the at-bat.
startTime character Event start timestamp (ISO 8601).
endTime character Event end timestamp (ISO 8601).
isPitch logical Whether the event is a pitch.
type character Play event type (e.g. 'pitch', 'action').
playId character Unique play event identifier (UUID).
pitchNumber integer Pitch number within the at-bat.
details.description character Pitch/event description (e.g. 'Swinging Strike').
details.event character Event name for non-pitch actions.
details.awayScore integer Away score recorded at the event.
details.homeScore integer Home score recorded at the event.
details.isScoringPlay logical Whether the event is a scoring play.
details.hasReview logical Whether the event was reviewed.
details.code character Pitch/result code (e.g. 'S', 'C', 'B').
details.ballColor character Gameday ball color rgba string.
details.isInPlay logical Whether the ball was put in play.
details.isStrike logical Whether the pitch was a strike.
details.isBall logical Whether the pitch was a ball.
details.call.code character Umpire call code.
details.call.description character Umpire call description.
count.balls.start integer Ball count before the pitch.
count.strikes.start integer Strike count before the pitch.
count.outs.start integer Out count before the pitch.
player.id integer Player id for action-event participant.
player.link character API relative link to the action player.
pitchData.strikeZoneTop numeric Top of the batter strike zone (feet).
pitchData.strikeZoneBottom numeric Bottom of the batter strike zone (feet).
details.fromCatcher logical Whether the event originated from the catcher.
pitchData.coordinates.x numeric Pitch x pixel coordinate (Gameday).
pitchData.coordinates.y numeric Pitch y pixel coordinate (Gameday).
hitData.trajectory character Batted ball trajectory.
hitData.hardness character Batted ball hardness.
hitData.location character Fielding position where the ball was hit.
hitData.coordinates.coordX numeric Batted ball landing x coordinate.
hitData.coordinates.coordY numeric Batted ball landing y coordinate.
actionPlayId character Identifier of an associated action play.
details.eventType character Event type slug for non-pitch actions.
details.runnerGoing logical Whether a runner was going on the pitch.
position.code character Fielding position code for the player.
position.name character Fielding position name.
position.type character Fielding position type.
position.abbreviation character Fielding position abbreviation.
battingOrder character Batting order slot.
atBatIndex character At-bat index within the game (factor).
result.type character Result type (e.g. 'atBat').
result.event character At-bat result event (e.g. 'Strikeout').
result.eventType character At-bat result event slug.
result.description character Narrative description of the at-bat result.
result.rbi integer Runs batted in on the at-bat.
result.awayScore integer Away score after the at-bat.
result.homeScore integer Home score after the at-bat.
about.atBatIndex integer At-bat index (numeric).
about.halfInning character Half inning ('top' or 'bottom').
about.inning integer Inning number.
about.startTime character At-bat start timestamp (ISO 8601).
about.endTime character At-bat end timestamp (ISO 8601).
about.isComplete logical Whether the at-bat is complete.
about.isScoringPlay logical Whether the at-bat is a scoring play.
about.hasReview logical Whether the at-bat had a review.
about.hasOut logical Whether the at-bat produced an out.
about.captivatingIndex integer MLB captivating index for the play.
count.balls.end integer Ball count after the pitch.
count.strikes.end integer Strike count after the pitch.
count.outs.end integer Out count after the pitch.
matchup.batter.id integer Batter player id.
matchup.batter.fullName character Batter full name (factor).
matchup.batter.link character API relative link to the batter.
matchup.batSide.code character Batter handedness code (e.g. 'L', 'R').
matchup.batSide.description character Batter handedness description.
matchup.pitcher.id integer Pitcher player id.
matchup.pitcher.fullName character Pitcher full name (factor).
matchup.pitcher.link character API relative link to the pitcher.
matchup.pitchHand.code character Pitcher throwing hand code (e.g. 'R').
matchup.pitchHand.description character Pitcher throwing hand description.
matchup.splits.batter character Batter platoon split (e.g. 'vs_RHP').
matchup.splits.pitcher character Pitcher platoon split (e.g. 'vs_LHB').
matchup.splits.menOnBase character Men on base split (e.g. 'Empty', 'Men_On').
batted.ball.result factor Categorized batted ball result.
home_team character Home team name.
home_level_id integer Home team level/sport id (1 for MLB).
home_level_name character Home team level/sport name.
home_parentOrg_id integer Home team parent organization id (minors).
home_parentOrg_name character Home team parent organization name (minors).
home_league_id integer Home team league id.
home_league_name character Home team league name.
away_team character Away team name.
away_level_id integer Away team level/sport id (1 for MLB).
away_level_name character Away team level/sport name.
away_parentOrg_id integer Away team parent organization id (minors).
away_parentOrg_name character Away team parent organization name (minors).
away_league_id integer Away team league id.
away_league_name character Away team league name.
batting_team character Team batting on the play (factor).
fielding_team character Team fielding on the play (factor).
last.pitch.of.ab character Whether the pitch was the last of the at-bat (factor).
pfxId character Pitch f/x tracking identifier.
details.trailColor character Gameday pitch trail color rgba string.
details.type.code character Pitch type code (e.g. 'CU', 'SI').
details.type.description character Pitch type description (e.g. 'Curveball').
pitchData.startSpeed numeric Pitch release speed (mph).
pitchData.endSpeed numeric Pitch speed crossing the plate (mph).
pitchData.zone integer Strike zone region of the pitch.
pitchData.typeConfidence numeric Pitch type classification confidence.
pitchData.plateTime numeric Time from release to plate (seconds).
pitchData.extension numeric Pitcher release extension (feet).
pitchData.coordinates.aY numeric Pitch acceleration in y (ft/s^2).
pitchData.coordinates.aZ numeric Pitch acceleration in z (ft/s^2).
pitchData.coordinates.pfxX numeric Horizontal pitch movement (inches).
pitchData.coordinates.pfxZ numeric Vertical pitch movement (inches).
pitchData.coordinates.pX numeric Horizontal pitch location at plate (feet).
pitchData.coordinates.pZ numeric Vertical pitch location at plate (feet).
pitchData.coordinates.vX0 numeric Pitch initial velocity in x (ft/s).
pitchData.coordinates.vY0 numeric Pitch initial velocity in y (ft/s).
pitchData.coordinates.vZ0 numeric Pitch initial velocity in z (ft/s).
pitchData.coordinates.x0 numeric Pitch initial x position (feet).
pitchData.coordinates.y0 numeric Pitch initial y position (feet).
pitchData.coordinates.z0 numeric Pitch initial z position (feet).
pitchData.coordinates.aX numeric Pitch acceleration in x (ft/s^2).
pitchData.breaks.breakAngle numeric Pitch break angle (degrees).
pitchData.breaks.breakLength numeric Pitch break length (inches).
pitchData.breaks.breakY numeric Distance from plate where break is measured.
pitchData.breaks.spinRate integer Pitch spin rate (RPM).
pitchData.breaks.spinDirection integer Pitch spin direction (degrees).
hitData.launchSpeed numeric Batted ball exit velocity (mph).
hitData.launchAngle numeric Batted ball launch angle (degrees).
hitData.totalDistance numeric Batted ball total distance (feet).
injuryType character Injury type when the event is injury-related.
umpire.id integer Umpire person id for the event.
umpire.link character API relative link to the umpire.
details.isOut logical Whether the pitch/event resulted in an out.
pitchData.breaks.breakVertical numeric Total vertical break (inches).
pitchData.breaks.breakVerticalInduced numeric Induced vertical break (inches).
pitchData.breaks.breakHorizontal numeric Horizontal break (inches).
details.disengagementNum integer Pitcher disengagement number on the play.
isBaseRunningPlay logical Whether the event is a base running play.
isSubstitution logical Whether the event is a substitution.
replacedPlayer.id integer Player id replaced on a substitution.
replacedPlayer.link character API relative link to the replaced player.
result.isOut logical Whether the at-bat resulted in an out.
about.isTopInning logical Whether the play occurred in the top of the inning.
matchup.postOnFirst.id integer Runner id on first base after the play.
matchup.postOnFirst.fullName character Runner name on first base after the play.
matchup.postOnFirst.link character API relative link to the first base runner.
matchup.postOnSecond.id integer Runner id on second base after the play.
matchup.postOnSecond.fullName character Runner name on second base after the play.
matchup.postOnSecond.link character API relative link to the second base runner.
matchup.postOnThird.id integer Runner id on third base after the play.
matchup.postOnThird.fullName character Runner name on third base after the play.
matchup.postOnThird.link character API relative link to the third base runner.

Examples

try(mlb_pbp(game_pk = 632970))

Acquire pitch-by-pitch data between two timecodes for Major and Minor League games

Description

Acquire pitch-by-pitch data between two timecodes for Major and Minor League games

Usage

mlb_pbp_diff(game_pk, start_timecode, end_timecode)

Arguments

game_pk

The date for which you want to find game_pk values for MLB games

start_timecode

The start time code for the MLB game (format: MMDDYYYY_HHMMSS)

end_timecode

The end time code for the MLB game (format: MMDDYYYY_HHMMSS)

Value

Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch level between the start_timecode and end_timecode

col_name types description
game_pk numeric MLB game primary key.
game_date character Game date (YYYY-MM-DD).
index integer Index of the play event within the at-bat.
startTime character Event start timestamp (ISO 8601).
endTime character Event end timestamp (ISO 8601).
isPitch logical Whether the event is a pitch.
type character Play event type (e.g. 'pitch', 'action').
playId character Unique play event identifier (UUID).
pitchNumber integer Pitch number within the at-bat.
details.description character Pitch/event description (e.g. 'Foul', 'Ball').
details.event character Event name for non-pitch actions.
details.awayScore integer Away score recorded at the event.
details.homeScore integer Home score recorded at the event.
details.isScoringPlay logical Whether the event is a scoring play.
details.hasReview logical Whether the event was reviewed.
details.code character Pitch/result code (e.g. 'F', 'B').
details.ballColor character Gameday ball color rgba string.
details.isInPlay logical Whether the ball was put in play.
details.isStrike logical Whether the pitch was a strike.
details.isBall logical Whether the pitch was a ball.
details.call.code character Umpire call code.
details.call.description character Umpire call description.
count.balls.start integer Ball count before the pitch.
count.strikes.start integer Strike count before the pitch.
count.outs.start integer Out count before the pitch.
player.id integer Player id for action-event participant.
player.link character API relative link to the action player.
pitchData.strikeZoneTop numeric Top of the batter strike zone (feet).
pitchData.strikeZoneBottom numeric Bottom of the batter strike zone (feet).
details.fromCatcher logical Whether the event originated from the catcher.
pitchData.coordinates.x numeric Pitch x pixel coordinate (Gameday).
pitchData.coordinates.y numeric Pitch y pixel coordinate (Gameday).
hitData.trajectory character Batted ball trajectory.
hitData.hardness character Batted ball hardness.
hitData.location character Fielding position where the ball was hit.
hitData.coordinates.coordX numeric Batted ball landing x coordinate.
hitData.coordinates.coordY numeric Batted ball landing y coordinate.
actionPlayId character Identifier of an associated action play.
details.eventType character Event type slug for non-pitch actions.
details.runnerGoing logical Whether a runner was going on the pitch.
position.code character Fielding position code for the player.
position.name character Fielding position name.
position.type character Fielding position type.
position.abbreviation character Fielding position abbreviation.
battingOrder character Batting order slot.
atBatIndex character At-bat index within the game (factor).
result.type character Result type (e.g. 'atBat').
result.event character At-bat result event.
result.eventType character At-bat result event slug.
result.description character Narrative description of the at-bat result.
result.rbi integer Runs batted in on the at-bat.
result.awayScore integer Away score after the at-bat.
result.homeScore integer Home score after the at-bat.
about.atBatIndex integer At-bat index (numeric).
about.halfInning character Half inning ('top' or 'bottom').
about.inning integer Inning number.
about.startTime character At-bat start timestamp (ISO 8601).
about.endTime character At-bat end timestamp (ISO 8601).
about.isComplete logical Whether the at-bat is complete.
about.isScoringPlay logical Whether the at-bat is a scoring play.
about.hasReview logical Whether the at-bat had a review.
about.hasOut logical Whether the at-bat produced an out.
about.captivatingIndex integer MLB captivating index for the play.
count.balls.end integer Ball count after the pitch.
count.strikes.end integer Strike count after the pitch.
count.outs.end integer Out count after the pitch.
matchup.batter.id integer Batter player id.
matchup.batter.fullName character Batter full name (factor).
matchup.batter.link character API relative link to the batter.
matchup.batSide.code character Batter handedness code (e.g. 'L', 'R').
matchup.batSide.description character Batter handedness description.
matchup.pitcher.id integer Pitcher player id.
matchup.pitcher.fullName character Pitcher full name (factor).
matchup.pitcher.link character API relative link to the pitcher.
matchup.pitchHand.code character Pitcher throwing hand code (e.g. 'R').
matchup.pitchHand.description character Pitcher throwing hand description.
matchup.splits.batter character Batter platoon split (e.g. 'vs_RHP').
matchup.splits.pitcher character Pitcher platoon split (e.g. 'vs_RHB').
matchup.splits.menOnBase character Men on base split (e.g. 'Men_On').
batted.ball.result factor Categorized batted ball result.
home_team character Home team name.
home_level_id integer Home team level/sport id (1 for MLB).
home_level_name character Home team level/sport name.
home_parentOrg_id integer Home team parent organization id (minors).
home_parentOrg_name character Home team parent organization name (minors).
home_league_id integer Home team league id.
home_league_name character Home team league name.
away_team character Away team name.
away_level_id integer Away team level/sport id (1 for MLB).
away_level_name character Away team level/sport name.
away_parentOrg_id integer Away team parent organization id (minors).
away_parentOrg_name character Away team parent organization name (minors).
away_league_id integer Away team league id.
away_league_name character Away team league name.
batting_team character Team batting on the play (factor).
fielding_team character Team fielding on the play (factor).
last.pitch.of.ab character Whether the pitch was the last of the at-bat (factor).
pfxId character Pitch f/x tracking identifier.
details.trailColor character Gameday pitch trail color rgba string.
details.type.code character Pitch type code (e.g. 'SI', 'CH').
details.type.description character Pitch type description (e.g. 'Sinker', 'Changeup').
pitchData.startSpeed numeric Pitch release speed (mph).
pitchData.endSpeed numeric Pitch speed crossing the plate (mph).
pitchData.zone integer Strike zone region of the pitch.
pitchData.typeConfidence numeric Pitch type classification confidence.
pitchData.plateTime numeric Time from release to plate (seconds).
pitchData.extension numeric Pitcher release extension (feet).
pitchData.coordinates.aY numeric Pitch acceleration in y (ft/s^2).
pitchData.coordinates.aZ numeric Pitch acceleration in z (ft/s^2).
pitchData.coordinates.pfxX numeric Horizontal pitch movement (inches).
pitchData.coordinates.pfxZ numeric Vertical pitch movement (inches).
pitchData.coordinates.pX numeric Horizontal pitch location at plate (feet).
pitchData.coordinates.pZ numeric Vertical pitch location at plate (feet).
pitchData.coordinates.vX0 numeric Pitch initial velocity in x (ft/s).
pitchData.coordinates.vY0 numeric Pitch initial velocity in y (ft/s).
pitchData.coordinates.vZ0 numeric Pitch initial velocity in z (ft/s).
pitchData.coordinates.x0 numeric Pitch initial x position (feet).
pitchData.coordinates.y0 numeric Pitch initial y position (feet).
pitchData.coordinates.z0 numeric Pitch initial z position (feet).
pitchData.coordinates.aX numeric Pitch acceleration in x (ft/s^2).
pitchData.breaks.breakAngle numeric Pitch break angle (degrees).
pitchData.breaks.breakLength numeric Pitch break length (inches).
pitchData.breaks.breakY numeric Distance from plate where break is measured.
pitchData.breaks.spinRate integer Pitch spin rate (RPM).
pitchData.breaks.spinDirection integer Pitch spin direction (degrees).
hitData.launchSpeed numeric Batted ball exit velocity (mph).
hitData.launchAngle numeric Batted ball launch angle (degrees).
hitData.totalDistance numeric Batted ball total distance (feet).
injuryType character Injury type when the event is injury-related.
umpire.id integer Umpire person id for the event.
umpire.link character API relative link to the umpire.
details.isOut logical Whether the pitch/event resulted in an out.
pitchData.breaks.breakVertical numeric Total vertical break (inches).
pitchData.breaks.breakVerticalInduced numeric Induced vertical break (inches).
pitchData.breaks.breakHorizontal numeric Horizontal break (inches).
details.disengagementNum integer Pitcher disengagement number on the play.
result.isOut logical Whether the at-bat resulted in an out.
about.isTopInning logical Whether the play occurred in the top of the inning.
matchup.postOnFirst.id integer Runner id on first base after the play.
matchup.postOnFirst.fullName character Runner name on first base after the play.
matchup.postOnFirst.link character API relative link to the first base runner.

Examples

try(mlb_pbp_diff(game_pk = 632970, 
                   start_timecode = "20210808_231704", 
                   end_timecode = "20210808_233711"))

Find Biographical Information for MLB Players

Description

Find Biographical Information for MLB Players

Usage

mlb_people(person_ids = NULL)

Arguments

person_ids

MLBAMIDs for players of interest. Multiple IDs should be provided in a vector separated by a comma.

Value

Returns a tibble with the following columns:

col_name types description
id integer MLB person id (MLBAMID).
full_name character Player full name.
link character API relative link to the player.
first_name character Player first name.
last_name character Player last name.
primary_number character Player primary jersey number.
birth_date character Player birth date (YYYY-MM-DD).
current_age integer Player current age in years.
birth_city character Player birth city.
birth_state_province character Player birth state or province.
birth_country character Player birth country.
height character Player height (e.g. "6' 2\"").
weight integer Player weight in pounds.
active logical Whether the player is currently active.
use_name character Player preferred display first name.
use_last_name character Player preferred display last name.
middle_name character Player middle name.
boxscore_name character Player short box score name.
nick_name character Player nickname.
gender character Player gender code (e.g. 'M').
is_player logical Whether the person is classified as a player.
is_verified logical Whether the player profile is verified.
draft_year integer Year the player was drafted.
mlb_debut_date character Player MLB debut date (YYYY-MM-DD).
name_first_last character Player name in first-last order.
name_slug character URL slug for the player (name plus id).
first_last_name character Player name in first-last order.
last_first_name character Player name in last, first order.
last_init_name character Player name as last, first initial.
init_last_name character Player name as first initial last.
full_fml_name character Player full first-middle-last name.
full_lfm_name character Player full last, first-middle name.
strike_zone_top numeric Top of the player's strike zone (feet).
strike_zone_bottom numeric Bottom of the player's strike zone (feet).
pronunciation character Phonetic pronunciation of the player's name.
last_played_date character Date the player last played (YYYY-MM-DD), if inactive.
primary_position_code character Primary position code.
primary_position_name character Primary position name (e.g. 'First Base').
primary_position_type character Primary position type (e.g. 'Infielder').
primary_position_abbreviation character Primary position abbreviation (e.g. '1B').
bat_side_code character Batting side code (e.g. 'R').
bat_side_description character Batting side description (e.g. 'Right').
pitch_hand_code character Throwing hand code (e.g. 'R').
pitch_hand_description character Throwing hand description (e.g. 'Right').

Examples

try(mlb_people(person_ids = 502671))
  try(mlb_people(person_ids = c(502671,605151)))

Find Information About MLB Free Agents

Description

Find Information About MLB Free Agents

Usage

mlb_people_free_agents(season = NULL)

Arguments

season

Season preceding free agency

Value

Returns a tibble with the following columns:

col_name types description
date_declared character Date the player declared free agency (YYYY-MM-DD).
notes character Notes on the signing (e.g. 'One-year contract').
date_signed character Date the player signed a new contract (YYYY-MM-DD).
sort_order integer Display sort order for the free agent record.
player_id integer MLB player id of the free agent.
player_full_name character Free agent full name.
player_link character API relative link to the player.
original_team_id integer Team id the player left.
original_team_name character Name of the team the player left.
original_team_link character API relative link to the original team.
position_code character Player position code.
position_name character Player position name (e.g. 'Relief Pitcher').
position_type character Player position type (e.g. 'Pitcher').
position_abbreviation character Player position abbreviation (e.g. 'RP').
new_team_id integer Team id the player signed with.
new_team_name character Name of the team the player signed with.
new_team_link character API relative link to the new team.

Examples

try(mlb_people_free_agents(season = 2018))

MLB Pitch Codes

Description

MLB Pitch Codes

Usage

mlb_pitch_codes()

Value

Returns a tibble with the following columns

col_name types description
pitch_code character Single-character code identifying the pitch result.
pitch_description character Human-readable description of the pitch code.
swing_status logical Whether the code represents a swing.
swing_miss_status logical Whether the code represents a swinging strike (miss).
swing_contact_status logical Whether the code represents a swing that made contact.
sort_order integer Display sort order for the pitch code.
strike_status logical Whether the code counts as a strike.
ball_status logical Whether the code counts as a ball.
pitch_status logical Whether the code represents a pitch (vs. non-pitch event).
pitch_result_text character Display text for the pitch result.
bunt_attempt_status logical Whether the code represents a bunt attempt.
contact_status logical Whether the code represents bat-ball contact.

Examples

try(mlb_pitch_codes())

MLB Pitch Types

Description

MLB Pitch Types

Usage

mlb_pitch_types()

Value

Returns a tibble with the following columns

col_name types description
pitch_type_code character Short code identifying the pitch type (e.g. 'FA').
pitch_type_description character Full name of the pitch type (e.g. 'Fastball').

Examples

try(mlb_pitch_types())

Find MLB Player Game Stats

Description

Find MLB Player Game Stats

Usage

mlb_player_game_stats(person_id = NULL, game_pk = NULL)

Arguments

person_id

MLBAMIDs for player of interest.

game_pk

The game_pk to return game_log statistics for a specific player in a specific game and to complete the call.

Value

Returns a tibble with one row per stat group (fielding, hitting, pitching) for the player in the game, with the following columns:

col_name types description
type character Stat type returned (e.g. 'gameLog').
group character Stat group: fielding, hitting, or pitching.
caught_stealing integer Runners caught stealing.
stolen_bases integer Stolen bases.
stolen_base_percentage character Stolen base success rate.
caught_stealing_percentage character Caught-stealing rate (catcher fielding).
assists integer Fielding assists.
put_outs integer Fielding putouts.
errors integer Fielding errors.
chances integer Total fielding chances.
fielding character Fielding percentage.
passed_ball integer Passed balls (catcher).
pickoffs integer Pickoffs.
summary character Text summary line of the player's game.
games_played integer Games played.
games_started integer Games started.
fly_outs integer Fly-ball outs.
ground_outs integer Ground-ball outs.
air_outs integer Air outs (fly outs + line outs + pop outs).
runs integer Runs.
doubles integer Doubles.
triples integer Triples.
home_runs integer Home runs.
strike_outs integer Strikeouts.
base_on_balls integer Walks.
intentional_walks integer Intentional walks.
hits integer Hits.
hit_by_pitch integer Hit by pitch.
at_bats integer At-bats.
number_of_pitches integer Number of pitches seen or thrown.
innings_pitched character Innings pitched.
wins integer Pitcher wins.
losses integer Pitcher losses.
saves integer Saves.
save_opportunities integer Save opportunities.
holds integer Holds.
blown_saves integer Blown saves.
earned_runs integer Earned runs allowed.
batters_faced integer Batters faced.
outs integer Outs recorded.
games_pitched integer Games pitched.
complete_games integer Complete games.
shutouts integer Shutouts.
pitches_thrown integer Pitches thrown.
balls integer Balls thrown.
strikes integer Strikes thrown.
strike_percentage character Share of pitches that were strikes.
hit_batsmen integer Batters hit by pitch (pitcher).
balks integer Balks.
wild_pitches integer Wild pitches.
rbi integer Runs batted in.
games_finished integer Games finished.
runs_scored_per9 character Runs scored per nine innings.
home_runs_per9 character Home runs allowed per nine innings.
inherited_runners integer Inherited runners.
inherited_runners_scored integer Inherited runners who scored.
catchers_interference integer Catcher's interference.
sac_bunts integer Sacrifice bunts.
sac_flies integer Sacrifice flies.
ground_into_double_play integer Grounded into double plays.
ground_into_triple_play integer Grounded into triple plays.
plate_appearances integer Plate appearances.
total_bases integer Total bases.
left_on_base integer Runners left on base.
at_bats_per_home_run character At-bats per home run.
total_splits integer Number of stat splits returned.
type_display_name character Display name of the stat type.
group_display_name character Display name of the stat group.
player_id numeric MLBAM player ID supplied in the request.
game_pk numeric Game ID supplied in the request.

Examples

try(mlb_player_game_stats(person_id = 605151, game_pk = 531368))

Find MLB Player Game Stats - Current Game

Description

Find MLB Player Game Stats - Current Game

Usage

mlb_player_game_stats_current(person_id = NULL)

Arguments

person_id

MLBAMIDs for player of interest.

Value

Returns a tibble with the following columns:

col_name types
type character
group character
stat_assists integer
stat_put_outs integer
stat_errors integer
stat_chances integer
stat_fielding character
stat_caught_stealing integer
stat_passed_ball integer
stat_stolen_bases integer
stat_stolen_base_percentage character
stat_pickoffs integer
stat_games_played integer
stat_games_started integer
stat_fly_outs integer
stat_ground_outs integer
stat_air_outs integer
stat_runs integer
stat_doubles integer
stat_triples integer
stat_home_runs integer
stat_strike_outs integer
stat_base_on_balls integer
stat_intentional_walks integer
stat_hits integer
stat_hit_by_pitch integer
stat_at_bats integer
stat_number_of_pitches integer
stat_innings_pitched character
stat_wins integer
stat_losses integer
stat_saves integer
stat_save_opportunities integer
stat_holds integer
stat_blown_saves integer
stat_earned_runs integer
stat_batters_faced integer
stat_outs integer
stat_games_pitched integer
stat_complete_games integer
stat_shutouts integer
stat_pitches_thrown integer
stat_balls integer
stat_strikes integer
stat_strike_percentage character
stat_hit_batsmen integer
stat_balks integer
stat_wild_pitches integer
stat_rbi integer
stat_games_finished integer
stat_runs_scored_per9 character
stat_home_runs_per9 character
stat_inherited_runners integer
stat_inherited_runners_scored integer
stat_catchers_interference integer
stat_sac_bunts integer
stat_sac_flies integer
stat_ground_into_double_play integer
stat_ground_into_triple_play integer
stat_plate_appearances integer
stat_total_bases integer
stat_left_on_base integer
stat_at_bats_per_home_run character
game_type character
num_teams integer
stat_avg character
stat_obp character
stat_slg character
stat_ops character
stat_outs_pitched integer
stat_whip character
stat_ground_outs_to_airouts character
stat_pitches_per_inning character
stat_strikeout_walk_ratio character
stat_strikeouts_per9inn character
stat_walks_per9inn character
stat_hits_per9inn character
team_id integer
team_name character
team_link character
opponent_id integer
opponent_name character
opponent_link character
pitcher_id integer
pitcher_full_name character
pitcher_link character
pitcher_first_name character
pitcher_last_name character
batter_id integer
batter_full_name character
batter_link character
batter_first_name character
batter_last_name character
total_splits integer
type_display_name character
group_display_name character
player_id numeric
game_pk numeric

Examples

try(mlb_player_game_stats_current(person_id = 660271))

MLB Player Status Codes

Description

MLB Player Status Codes

Usage

mlb_player_status_codes()

Value

Returns a tibble with the following columns

col_name types description
player_status_code character Short code for the player status (e.g. 'A').
player_status_description character Description of the player status (e.g. 'Active').

Examples

try(mlb_player_status_codes())

MLB Positions

Description

MLB Positions

Usage

mlb_positions()

Value

Returns a tibble with the following columns

col_name types description
position_short_name character Short position name (e.g. 'Pitcher').
position_full_name character Full position name.
position_abbreviation character Position abbreviation (e.g. 'P', 'SS').
position_code character Numeric scorekeeping position code.
position_type character Position category (e.g. 'Pitcher', 'Infielder').
position_formal_name character Formal position name.
position_display_name character Display name for the position.
outfield logical Whether the position is an outfield position.
game_position logical Whether it is an on-field game position.
pitcher logical Whether the position is a pitcher.
fielder logical Whether the position is a fielder.

Examples

try(mlb_positions())

Retrieve probable starters for a given MLB game

Description

Retrieve probable starters for a given MLB game

Usage

mlb_probables(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tiible that includes probable starting pitchers and the home plate umpire for the game_pk requested including the following columns:

col_name types description
game_pk integer Unique game identifier.
game_date character Date of the game (YYYY-MM-DD).
fullName character Full name of the probable starting pitcher.
id integer MLBAM player ID of the probable starting pitcher.
team character Team name for the probable pitcher.
team_id integer MLBAM team ID for the probable pitcher.
home_plate_full_name character Full name of the home plate umpire.
home_plate_id integer MLBAM ID of the home plate umpire.

Examples

try(mlb_probables(566001))

MLB Review Reasons

Description

MLB Review Reasons

Usage

mlb_review_reasons()

Value

Returns a tibble with the following columns

col_name types description
review_reason_code character Short code for the replay review reason.
review_reason_description character Description of the review reason (e.g. 'Tag play').

Examples

try(mlb_review_reasons())

MLB Roster Types

Description

MLB Roster Types

Usage

mlb_roster_types()

Value

Returns a tibble with the following columns

col_name types description
roster_type_description character Description of the roster type.
roster_type_lookup_name character Lookup name for the roster type.
roster_type_parameter character Parameter value to pass as roster_type in API calls.

Examples

try(mlb_roster_types())

Find MLB Rosters by Roster Type

Description

Find MLB Rosters by Roster Type

Usage

mlb_rosters(team_id = NULL, season = NULL, date = NULL, roster_type = NULL)

Arguments

team_id

team_id to return team roster information for a particular club.

season

Year to return team roster information for a particular club in a specific season.

date

Date to return team roster and their coaching staff directorial information for a particular team.

roster_type

roster_type to return team directorial information for. See mlb_roster_types() for more options. Valid options include: '40Man', 'fullSeason', 'fullRoster', 'nonRosterInvitees', 'active', 'allTime', 'depthChart', 'gameday', 'coach'

Value

Returns a tibble with one row per roster member with the following columns (player roster types). The coach roster type instead returns job, job_id, and title columns in place of the position/status columns:

col_name types description
jersey_number character Player's uniform number.
person_id integer MLBAM player ID.
person_full_name character Player's full name.
person_link character API link to the player resource.
position_code character Numeric scorekeeping position code.
position_name character Full position name.
position_type character Position category (e.g. 'Infielder').
position_abbreviation character Position abbreviation (e.g. 'SS').
status_code character Roster status code (e.g. 'A').
status_description character Roster status description (e.g. 'Active').
link character API link to the team roster resource.
team_id integer MLBAM team ID.
roster_type character Roster type returned.
season numeric Season requested.
date character Date requested, or NA if not supplied.

Examples

try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'active'))
  try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'coach'))

MLB Runner Detail Types

Description

MLB Runner Detail Types

Usage

mlb_runner_detail_types()

Value

Returns a tibble with the following columns

col_name types description
stat_name character Name of the runner detail stat (e.g. 'r_force_out').

Examples

try(mlb_runner_detail_types())

Find game_pk values for professional baseball games (major and minor leagues)

Description

Find game_pk values for professional baseball games (major and minor leagues)

Usage

mlb_schedule(season = 2019, level_ids = "1")

Arguments

season

The season for which you want to find game_pk values for MLB games

level_ids

A numeric vector with ids for each level where game_pks are desired. See below for a reference of level ids.

sport_id sport_code sport_link sport_name sport_abbreviation sort_order active_status
1 mlb /api/v1/sports/1 Major League Baseball MLB 11 TRUE
11 aaa /api/v1/sports/11 Triple-A AAA 101 TRUE
12 aax /api/v1/sports/12 Double-A AA 201 TRUE
13 afa /api/v1/sports/13 High-A A+ 301 TRUE
14 afx /api/v1/sports/14 Low-A A 401 TRUE
16 rok /api/v1/sports/16 Rookie ROK 701 TRUE
17 win /api/v1/sports/17 Winter Leagues WIN 1301 TRUE
8 bbl /api/v1/sports/8 Organized Baseball Pros 1401 TRUE
21 min /api/v1/sports/21 Minor League Baseball Minors 1402 TRUE
23 ind /api/v1/sports/23 Independent Leagues IND 2101 TRUE
51 int /api/v1/sports/51 International Baseball INT 3501 TRUE
508 nat /api/v1/sports/508 International Baseball (Collegiate) INTC 3502 TRUE
509 nae /api/v1/sports/509 International Baseball (18 and under) 18U 3503 TRUE
510 nas /api/v1/sports/510 International Baseball (16 and under) 16U 3505 TRUE
22 bbc /api/v1/sports/22 College Baseball College 5101 TRUE
586 hsb /api/v1/sports/586 High School Baseball H.S. 6201 TRUE

Value

Returns a tibble which includes game_pk values and additional information for games scheduled or played with the following columns:

col_name types description
date character Calendar date for the schedule entry.
total_items integer Total schedule items on the date.
total_events integer Total non-game events on the date.
total_games integer Total games on the date.
total_games_in_progress integer Games currently in progress on the date.
game_pk integer Unique game identifier.
game_guid character Globally unique game identifier (GUID).
link character API link to the game feed.
game_type character Game type code (e.g. 'R', 'S', 'W').
season character Season the game belongs to.
game_date character Game date-time in UTC (ISO 8601).
official_date character Official game date (YYYY-MM-DD).
game_number integer Game number within a doubleheader.
public_facing logical Whether the game is public-facing.
double_header character Doubleheader indicator ('N', 'S', 'Y').
gameday_type character Gameday data feed type.
tiebreaker character Whether the game is a tiebreaker.
calendar_event_id character Calendar event identifier.
season_display character Display string for the season.
day_night character Day or night game indicator.
scheduled_innings integer Scheduled number of innings.
reverse_home_away_status logical Whether home/away teams are reversed.
inning_break_length integer Length of inning breaks in seconds.
games_in_series integer Number of games in the series.
series_game_number integer Game number within the series.
series_description character Description of the series.
record_source character Source of the schedule record.
if_necessary character Whether the game is played only if necessary.
if_necessary_description character Description of the if-necessary status.
status_abstract_game_state character Abstract game state (e.g. 'Final').
status_coded_game_state character Coded game state.
status_detailed_state character Detailed game state (e.g. 'Cancelled').
status_status_code character Status code for the game.
status_start_time_tbd logical Whether the start time is TBD.
status_reason character Reason for the game status (e.g. 'Rain').
status_abstract_game_code character Abstract game state code.
teams_away_split_squad logical Whether the away team is a split squad.
teams_away_series_number integer Away team's series number.
teams_away_team_id integer Away team MLBAM ID.
teams_away_team_name character Away team name.
teams_away_team_link character API link to the away team.
teams_away_league_record_wins integer Away team league-record wins.
teams_away_league_record_losses integer Away team league-record losses.
teams_away_league_record_ties integer Away team league-record ties.
teams_away_league_record_pct character Away team winning percentage.
teams_home_split_squad logical Whether the home team is a split squad.
teams_home_series_number integer Home team's series number.
teams_home_team_id integer Home team MLBAM ID.
teams_home_team_name character Home team name.
teams_home_team_link character API link to the home team.
teams_home_league_record_wins integer Home team league-record wins.
teams_home_league_record_losses integer Home team league-record losses.
teams_home_league_record_ties integer Home team league-record ties.
teams_home_league_record_pct character Home team winning percentage.
venue_id integer MLBAM venue ID.
venue_name character Venue name.
venue_link character API link to the venue.
content_link character API link to the game content.
is_tie logical Whether the game ended in a tie.
description character Game description (often for exhibition games).
teams_away_score integer Away team final score.
teams_away_is_winner logical Whether the away team won.
teams_home_score integer Home team final score.
teams_home_is_winner logical Whether the home team won.
reschedule_date character Reschedule date-time, if rescheduled.
reschedule_game_date character Reschedule game date, if rescheduled.
rescheduled_from character Original date-time the game was rescheduled from.
rescheduled_from_date character Original date the game was rescheduled from.
resume_date character Resume date-time, if suspended/resumed.
resume_game_date character Resume game date, if suspended/resumed.
resumed_from character Date-time the game was resumed from.
resumed_from_date character Date the game was resumed from.
events list Nested list of non-game events.

Level IDs

The following IDs can be passed to the level_ids argument:

1 = MLB
11 = Triple-A
12 = Doubl-A
13 = Class A Advanced
14 = Class A
15 = Class A Short Season
5442 = Rookie Advanced
16 = Rookie
17 = Winter League

Examples

try(mlb_schedule(season = "2019"))

MLB Schedule Endpoint Overview

Description

  • mlb_schedule(): Find game_pk values for professional baseball games (major and minor leagues).

  • mlb_schedule_postseason(): Find game_pk values for professional baseball postseason games (major and minor leagues).

  • mlb_schedule_postseason_series(): Find game_pk values for professional baseball postseason series games (major and minor leagues).

  • mlb_schedule_games_tied(): Find game_pk values for professional baseball games (major and minor leagues) that are tied.

  • mlb_schedule_event_types(): MLB Schedule Event Types.

Details

MLB Schedule

These functions retrieve MLB schedule, postseason, tied-game, and event-type information from the MLB Stats API.


MLB Schedule Event Types

Description

MLB Schedule Event Types

Usage

mlb_schedule_event_types()

Value

Returns a tibble with the following columns

col_name types description
schedule_event_type_code character Short code for the schedule event type.
schedule_event_type_name character Name of the event type (e.g. 'All-Star Weekend Event').

Examples

try(mlb_schedule_event_types())

Find game_pk values for professional baseball games (major and minor leagues) that are tied

Description

Find game_pk values for professional baseball games (major and minor leagues) that are tied

Usage

mlb_schedule_games_tied(season = 2021, game_type = "S")

Arguments

season

The season for which you want to find game_pk values for MLB games

game_type

game_type to return schedule information for all tied games in a particular game_type

game_type_id game_type_description
S Spring Training
R Regular Season
F Wild Card Game
D Division Series
L League Championship Series
W World Series
C Championship
N Nineteenth Century Series
P Playoffs
A All-Star Game
I Intrasquad
E Exhibition

Value

Returns a tibble that includes game_pk values and additional information for games scheduled or played

col_name types description
date character Calendar date for the schedule entry.
total_items integer Total schedule items on the date.
total_events integer Total non-game events on the date.
total_games integer Total games on the date.
total_games_in_progress integer Games currently in progress on the date.
game_pk integer Unique game identifier.
game_guid character Globally unique game identifier (GUID).
link character API link to the game feed.
game_type character Game type code (e.g. 'R', 'S').
season character Season the game belongs to.
game_date character Game date-time in UTC (ISO 8601).
official_date character Official game date (YYYY-MM-DD).
is_tie logical Whether the game ended in a tie.
game_number integer Game number within a doubleheader.
public_facing logical Whether the game is public-facing.
double_header character Doubleheader indicator ('N', 'S', 'Y').
gameday_type character Gameday data feed type.
tiebreaker character Whether the game is a tiebreaker.
calendar_event_id character Calendar event identifier.
season_display character Display string for the season.
day_night character Day or night game indicator.
scheduled_innings integer Scheduled number of innings.
reverse_home_away_status logical Whether home/away teams are reversed.
games_in_series integer Number of games in the series.
series_game_number integer Game number within the series.
series_description character Description of the series.
record_source character Source of the schedule record.
if_necessary character Whether the game is played only if necessary.
if_necessary_description character Description of the if-necessary status.
status_abstract_game_state character Abstract game state (e.g. 'Final').
status_coded_game_state character Coded game state.
status_detailed_state character Detailed game state.
status_status_code character Status code for the game.
status_start_time_tbd logical Whether the start time is TBD.
status_reason character Reason for the game status (e.g. 'Tied').
status_abstract_game_code character Abstract game state code.
teams_away_score integer Away team score.
teams_away_split_squad logical Whether the away team is a split squad.
teams_away_series_number integer Away team's series number.
teams_away_team_id integer Away team MLBAM ID.
teams_away_team_name character Away team name.
teams_away_team_link character API link to the away team.
teams_away_league_record_wins integer Away team league-record wins.
teams_away_league_record_losses integer Away team league-record losses.
teams_away_league_record_ties integer Away team league-record ties.
teams_away_league_record_pct character Away team winning percentage.
teams_home_score integer Home team score.
teams_home_split_squad logical Whether the home team is a split squad.
teams_home_series_number integer Home team's series number.
teams_home_team_id integer Home team MLBAM ID.
teams_home_team_name character Home team name.
teams_home_team_link character API link to the home team.
teams_home_league_record_wins integer Home team league-record wins.
teams_home_league_record_losses integer Home team league-record losses.
teams_home_league_record_ties integer Home team league-record ties.
teams_home_league_record_pct character Home team winning percentage.
venue_id integer MLBAM venue ID.
venue_name character Venue name.
venue_link character API link to the venue.
content_link character API link to the game content.
inning_break_length integer Length of inning breaks in seconds.
events list Nested list of non-game events.

Examples

try(mlb_schedule_games_tied(season = 2021))

Find game_pk values for professional baseball postseason games (major and minor leagues)

Description

Find game_pk values for professional baseball postseason games (major and minor leagues)

Usage

mlb_schedule_postseason(
  season = 2021,
  game_type = NULL,
  series_number = NULL,
  sport_id = 1,
  team_id = NULL
)

Arguments

season

The season for which you want to find game_pk values for MLB games

game_type

game_type to return schedule information for all tied games in a particular game_type

series_number

The Series number to return schedule information for all tied games in a particular series number

sport_id

The sport_id to return schedule information for.

team_id

The team_id to return schedule information for.

game_type_id game_type_description
S Spring Training
R Regular Season
F Wild Card Game
D Division Series
L League Championship Series
W World Series
C Championship
N Nineteenth Century Series
P Playoffs
A All-Star Game
I Intrasquad
E Exhibition

Value

Returns a tibble that includes game_pk values and additional information for games scheduled or played

col_name types description
date character Calendar date for the schedule entry.
total_items integer Total schedule items on the date.
total_events integer Total non-game events on the date.
total_games integer Total games on the date.
total_games_in_progress integer Games currently in progress on the date.
game_pk integer Unique game identifier.
game_guid character Globally unique game identifier (GUID).
link character API link to the game feed.
game_type character Postseason game type code (e.g. 'F', 'D', 'W').
season character Season the game belongs to.
game_date character Game date-time in UTC (ISO 8601).
official_date character Official game date (YYYY-MM-DD).
is_tie logical Whether the game ended in a tie.
is_featured_game logical Whether the game is a featured game.
game_number integer Game number within a doubleheader.
public_facing logical Whether the game is public-facing.
double_header character Doubleheader indicator ('N', 'S', 'Y').
gameday_type character Gameday data feed type.
tiebreaker character Whether the game is a tiebreaker.
calendar_event_id character Calendar event identifier.
season_display character Display string for the season.
day_night character Day or night game indicator.
description character Series/round description (e.g. 'AL Wild Card Game').
scheduled_innings integer Scheduled number of innings.
reverse_home_away_status logical Whether home/away teams are reversed.
games_in_series integer Number of games in the series.
series_game_number integer Game number within the series.
series_description character Description of the series.
record_source character Source of the schedule record.
if_necessary character Whether the game is played only if necessary.
if_necessary_description character Description of the if-necessary status.
status_abstract_game_state character Abstract game state (e.g. 'Final').
status_coded_game_state character Coded game state.
status_detailed_state character Detailed game state.
status_status_code character Status code for the game.
status_start_time_tbd logical Whether the start time is TBD.
status_abstract_game_code character Abstract game state code.
teams_away_score integer Away team score.
teams_away_is_winner logical Whether the away team won.
teams_away_split_squad logical Whether the away team is a split squad.
teams_away_series_number integer Away team's series number.
teams_away_team_id integer Away team MLBAM ID.
teams_away_team_name character Away team name.
teams_away_team_link character API link to the away team.
teams_away_league_record_wins integer Away team series-record wins.
teams_away_league_record_losses integer Away team series-record losses.
teams_away_league_record_pct character Away team winning percentage.
teams_home_score integer Home team score.
teams_home_is_winner logical Whether the home team won.
teams_home_split_squad logical Whether the home team is a split squad.
teams_home_series_number integer Home team's series number.
teams_home_team_id integer Home team MLBAM ID.
teams_home_team_name character Home team name.
teams_home_team_link character API link to the home team.
teams_home_league_record_wins integer Home team series-record wins.
teams_home_league_record_losses integer Home team series-record losses.
teams_home_league_record_pct character Home team winning percentage.
venue_id integer MLBAM venue ID.
venue_name character Venue name.
venue_link character API link to the venue.
content_link character API link to the game content.
inning_break_length integer Length of inning breaks in seconds.
reschedule_date character Reschedule date-time, if rescheduled.
reschedule_game_date character Reschedule game date, if rescheduled.
status_reason character Reason for the game status (e.g. 'Rain').
rescheduled_from character Original date-time the game was rescheduled from.
rescheduled_from_date character Original date the game was rescheduled from.
events list Nested list of non-game events.

Examples

try(mlb_schedule_postseason(season = 2021))

Find game_pk values for professional baseball postseason series games (major and minor leagues)

Description

Find game_pk values for professional baseball postseason series games (major and minor leagues)

Usage

mlb_schedule_postseason_series(
  season = 2021,
  game_type = NULL,
  series_number = NULL,
  sport_id = 1,
  team_id = NULL
)

Arguments

season

The season for which you want to find game_pk values for MLB games

game_type

game_type to return schedule information for all tied games in a particular game_type

series_number

The Series number to return schedule information for all tied games in a particular series number

sport_id

The sport_id to return schedule information for.

team_id

The team_id to return schedule information for.

game_type_id game_type_description
S Spring Training
R Regular Season
F Wild Card Game
D Division Series
L League Championship Series
W World Series
C Championship
N Nineteenth Century Series
P Playoffs
A All-Star Game
I Intrasquad
E Exhibition

Value

Returns a tibble that includes game_pk values and additional information for games scheduled or played

col_name types description
total_items integer Total games in the series.
total_games integer Total games in the series.
total_games_in_progress integer Games currently in progress.
game_pk integer Unique game identifier.
game_guid character Globally unique game identifier (GUID).
link character API link to the game feed.
game_type character Postseason game type code (e.g. 'W', 'L', 'D').
season character Season the game belongs to.
game_date character Game date-time in UTC (ISO 8601).
official_date character Official game date (YYYY-MM-DD).
is_tie logical Whether the game ended in a tie.
is_featured_game logical Whether the game is a featured game.
game_number integer Game number within a doubleheader.
public_facing logical Whether the game is public-facing.
double_header character Doubleheader indicator ('N', 'S', 'Y').
gameday_type character Gameday data feed type.
tiebreaker character Whether the game is a tiebreaker.
calendar_event_id character Calendar event identifier.
season_display character Display string for the season.
day_night character Day or night game indicator.
description character Series/game description (e.g. 'World Series Game 1').
scheduled_innings integer Scheduled number of innings.
reverse_home_away_status logical Whether home/away teams are reversed.
inning_break_length integer Length of inning breaks in seconds.
games_in_series integer Number of games in the series.
series_game_number integer Game number within the series.
series_description character Description of the series.
record_source character Source of the schedule record.
if_necessary character Whether the game is played only if necessary.
if_necessary_description character Description of the if-necessary status.
status_abstract_game_state character Abstract game state (e.g. 'Final').
status_coded_game_state character Coded game state.
status_detailed_state character Detailed game state.
status_status_code character Status code for the game.
status_start_time_tbd logical Whether the start time is TBD.
status_abstract_game_code character Abstract game state code.
teams_away_score integer Away team score.
teams_away_is_winner logical Whether the away team won.
teams_away_split_squad logical Whether the away team is a split squad.
teams_away_series_number integer Away team's series number.
teams_away_team_id integer Away team MLBAM ID.
teams_away_team_name character Away team name.
teams_away_team_link character API link to the away team.
teams_away_league_record_wins integer Away team series-record wins.
teams_away_league_record_losses integer Away team series-record losses.
teams_away_league_record_pct character Away team winning percentage.
teams_home_score integer Home team score.
teams_home_is_winner logical Whether the home team won.
teams_home_split_squad logical Whether the home team is a split squad.
teams_home_series_number integer Home team's series number.
teams_home_team_id integer Home team MLBAM ID.
teams_home_team_name character Home team name.
teams_home_team_link character API link to the home team.
teams_home_league_record_wins integer Home team series-record wins.
teams_home_league_record_losses integer Home team series-record losses.
teams_home_league_record_pct character Home team winning percentage.
venue_id integer MLBAM venue ID.
venue_name character Venue name.
venue_link character API link to the venue.
content_link character API link to the game content.
reschedule_date character Reschedule date-time, if rescheduled.
reschedule_game_date character Reschedule game date, if rescheduled.
rescheduled_from character Original date-time the game was rescheduled from.
rescheduled_from_date character Original date the game was rescheduled from.
status_reason character Reason for the game status (e.g. 'Rain').
sort_order integer Sort order within the series listing.
series_id character Series identifier (e.g. 'W_1').
series_sort_number integer Sort number for the series.
series_is_default logical Whether the series is the default series.
series_game_type character Game type code for the series.

Examples

try(mlb_schedule_postseason_series(season = 2021, sport_id = 1))

Find MLB Seasons

Description

Find MLB Seasons

Usage

mlb_seasons(sport_id = 1, with_game_type_dates = TRUE)

Arguments

sport_id

The sport_id to return season information for.

with_game_type_dates

with_game_type_dates to return season information

Value

Returns a tibble with the following columns:

col_name types description
season_id character Season year identifier.
has_wildcard logical Whether the season has a wild card round.
pre_season_start_date character Pre-season start date.
pre_season_end_date character Pre-season end date.
season_start_date character Season start date.
spring_start_date character Spring training start date.
spring_end_date character Spring training end date.
regular_season_start_date character Regular season start date.
last_date1st_half character Last date of the first half.
all_star_date character All-Star Game date.
first_date2nd_half character First date of the second half.
regular_season_end_date character Regular season end date.
post_season_start_date character Post-season start date.
post_season_end_date character Post-season end date.
season_end_date character Season end date.
offseason_start_date character Off-season start date.
off_season_end_date character Off-season end date.
season_level_gameday_type character Season-level Gameday data feed type.
game_level_gameday_type character Game-level Gameday data feed type.
qualifier_plate_appearances numeric Plate appearances per team game to qualify.
qualifier_outs_pitched integer Outs pitched per team game to qualify.

Examples

try(mlb_seasons(sport_id = 1))

Find MLB Seasons all

Description

Find MLB Seasons all

Usage

mlb_seasons_all(
  sport_id = 1,
  division_id = NULL,
  league_id = NULL,
  with_game_type_dates = TRUE
)

Arguments

sport_id

The sport_id to return season information for.

division_id

The division_id to return season information for.

league_id

The league_id to return season information for.

with_game_type_dates

with_game_type_dates to return season information for.

Value

Returns a tibble with the following columns:

col_name types description
season_id character Season year identifier.
has_wildcard logical Whether the season has a wild card round.
pre_season_start_date character Pre-season start date.
season_start_date character Season start date.
regular_season_start_date character Regular season start date.
regular_season_end_date character Regular season end date.
season_end_date character Season end date.
offseason_start_date character Off-season start date.
off_season_end_date character Off-season end date.
season_level_gameday_type character Season-level Gameday data feed type.
game_level_gameday_type character Game-level Gameday data feed type.
qualifier_plate_appearances numeric Plate appearances per team game to qualify.
qualifier_outs_pitched integer Outs pitched per team game to qualify.
post_season_start_date character Post-season start date.
post_season_end_date character Post-season end date.
last_date1st_half character Last date of the first half.
all_star_date character All-Star Game date.
first_date2nd_half character First date of the second half.
pre_season_end_date character Pre-season end date.
spring_start_date character Spring training start date.
spring_end_date character Spring training end date.

Examples

try(mlb_seasons_all(sport_id = 1))

MLB Situation Codes

Description

MLB Situation Codes

Usage

mlb_situation_codes()

Value

Returns a tibble with the following columns

col_name types description
situation_code character Code identifying the game situation.
sort_order integer Display sort order for the situation code.
navigation_menu character Navigation menu grouping (e.g. 'Game').
situation_code_description character Description of the situation (e.g. 'Home Games').
team logical Whether the situation applies to team stats.
batting logical Whether the situation applies to batting stats.
fielding logical Whether the situation applies to fielding stats.
pitching logical Whether the situation applies to pitching stats.

Examples

try(mlb_situation_codes())

MLB Sky (Weather) Codes

Description

MLB Sky (Weather) Codes

Usage

mlb_sky()

Value

Returns a tibble with the following columns

col_name types description
sky_code character Code for the sky/weather condition.
sky_description character Description of the sky condition (e.g. 'Clear').

Examples

try(mlb_sky())

MLB Sport IDs

Description

MLB Sport IDs

Usage

mlb_sports(sport_id = NULL)

Arguments

sport_id

The sport_id to return information for.

Value

Returns a tibble with the following columns

col_name types description
sport_id integer MLBAM sport (level) identifier.
sport_code character Short sport code (e.g. 'mlb', 'aaa').
sport_link character API link to the sport resource.
sport_name character Full sport/level name.
sport_abbreviation character Sport abbreviation (e.g. 'MLB').
sort_order integer Display sort order for the sport.
active_status logical Whether the sport/level is active.

and the following values:

sport_id sport_code sport_link sport_name sport_abbreviation sort_order active_status
1 mlb /api/v1/sports/1 Major League Baseball MLB 11 TRUE
11 aaa /api/v1/sports/11 Triple-A AAA 101 TRUE
12 aax /api/v1/sports/12 Double-A AA 201 TRUE
13 afa /api/v1/sports/13 High-A A+ 301 TRUE
14 afx /api/v1/sports/14 Low-A A 401 TRUE
16 rok /api/v1/sports/16 Rookie ROK 701 TRUE
17 win /api/v1/sports/17 Winter Leagues WIN 1301 TRUE
8 bbl /api/v1/sports/8 Organized Baseball Pros 1401 TRUE
21 min /api/v1/sports/21 Minor League Baseball Minors 1402 TRUE
23 ind /api/v1/sports/23 Independent Leagues IND 2101 TRUE
51 int /api/v1/sports/51 International Baseball INT 3501 TRUE
508 nat /api/v1/sports/508 International Baseball (Collegiate) INTC 3502 TRUE
509 nae /api/v1/sports/509 International Baseball (18 and under) 18U 3503 TRUE
510 nas /api/v1/sports/510 International Baseball (16 and under) 16U 3505 TRUE
22 bbc /api/v1/sports/22 College Baseball College 5101 TRUE
586 hsb /api/v1/sports/586 High School Baseball H.S. 6201 TRUE

Examples

try(mlb_sports())

MLB Sport IDs Information

Description

MLB Sport IDs Information

Usage

mlb_sports_info(sport_id = 1)

Arguments

sport_id

The sport_id to return information for.

Value

Returns a tibble with the following columns

col_name types description
sport_id integer MLBAM sport (level) identifier.
sport_code character Short sport code (e.g. 'mlb', 'aaa').
sport_link character API link to the sport resource.
sport_name character Full sport/level name.
sport_abbreviation character Sport abbreviation (e.g. 'MLB').
sort_order integer Display sort order for the sport.
active_status logical Whether the sport/level is active.

Examples

try(mlb_sports_info(sport_id = 1))

MLB Sport Players

Description

MLB Sport Players

Usage

mlb_sports_players(sport_id = 1, season = 2021)

Arguments

sport_id

The sport_id to return information for.

season

The season to return information for.

Value

Returns a tibble with the following columns:

col_name types description
player_id integer MLBAM player ID.
full_name character Player full name.
link character API link to the player resource.
first_name character Player first name.
last_name character Player last name.
primary_number character Primary uniform number.
birth_date character Date of birth (YYYY-MM-DD).
current_age integer Current age in years.
birth_city character City of birth.
birth_country character Country of birth.
height character Listed height (feet and inches).
weight integer Listed weight in pounds.
active logical Whether the player is currently active.
use_name character Preferred first name for display.
use_last_name character Preferred last name for display.
middle_name character Player middle name.
boxscore_name character Name as shown in box scores.
nick_name character Player nickname.
gender character Player gender code.
is_player logical Whether the person is a player.
is_verified logical Whether the profile is verified.
pronunciation character Phonetic pronunciation of the name.
mlb_debut_date character MLB debut date (YYYY-MM-DD).
name_first_last character Name in first-last order.
name_slug character URL slug for the player.
first_last_name character First and last name display.
last_first_name character Last, first name display.
last_init_name character Last name with first initial.
init_last_name character First initial with last name.
full_fml_name character Full first-middle-last name.
full_lfm_name character Full last-first-middle name.
strike_zone_top numeric Top of the player's strike zone (feet).
strike_zone_bottom numeric Bottom of the player's strike zone (feet).
birth_state_province character State or province of birth.
draft_year integer Year the player was drafted.
name_matrilineal character Matrilineal (maternal) surname.
last_played_date character Date of last MLB appearance.
name_title character Name title prefix.
name_suffix character Name suffix (e.g., Jr., III).
death_date character Date of death (YYYY-MM-DD).
death_city character City of death.
death_country character Country of death.
current_team_id integer Current team MLBAM ID.
current_team_name character Current team name.
current_team_link character API link to the current team.
primary_position_code character Primary position code.
primary_position_name character Primary position name.
primary_position_type character Primary position type.
primary_position_abbreviation character Primary position abbreviation.
bat_side_code character Batting side code (L/R/S).
bat_side_description character Batting side description.
pitch_hand_code character Throwing hand code (L/R).
pitch_hand_description character Throwing hand description.

Examples

try(mlb_sports_players(sport_id = 1, season = 2021))

MLB Standings

Description

MLB Standings

Usage

mlb_standings(
  season = NULL,
  date = NULL,
  standings_type = NULL,
  league_id = NULL
)

Arguments

season

Year(s) to return to return standings information for.

date

Date to return to return standings information for.

standings_type

The standings_type(s) to return standings information for. Description of all standings_types

  1. regularSeason - Regular Season Standings

  2. wildCard - Wild card standings

  3. divisionLeaders - Division Leader standings

  4. wildCardWithLeaders - Wild card standings with Division Leaders

  5. firstHalf - First half standings. Only valid for leagues with a split season (Mexican League).

  6. secondHalf - Second half standings. Only valid for leagues with a split season (Mexican League).

  7. springTraining - Spring Training Standings

  8. postseason - Postseason Standings

  9. byDivision - Standings by Division

  10. byConference - Standings by Conference

  11. byLeague - Standings by League

league_id

The league_id(s) to return standings information for.

Value

Returns a tibble with the following columns

col_name types description
standings_type character Type of standings returned (e.g., regularSeason).
last_updated character Timestamp the standings record was last updated.
team_records_season character Season for the team record.
team_records_clinch_indicator character Clinch status indicator code.
team_records_division_rank character Rank within the division.
team_records_league_rank character Rank within the league.
team_records_sport_rank character Rank across the sport.
team_records_games_played integer Games played.
team_records_games_back character Games back of the division leader.
team_records_wild_card_games_back character Games back of the wild card.
team_records_league_games_back character Games back within the league.
team_records_spring_league_games_back character Games back within the spring league.
team_records_sport_games_back character Games back across the sport.
team_records_division_games_back character Games back within the division.
team_records_conference_games_back character Games back within the conference.
team_records_last_updated character Timestamp the team record was last updated.
team_records_runs_allowed integer Total runs allowed.
team_records_runs_scored integer Total runs scored.
team_records_division_champ logical Whether the team clinched the division.
team_records_division_leader logical Whether the team leads its division.
team_records_has_wildcard logical Whether the team holds a wild card spot.
team_records_clinched logical Whether the team has clinched a playoff berth.
team_records_elimination_number character Overall elimination number.
team_records_elimination_number_sport character Elimination number across the sport.
team_records_elimination_number_league character Elimination number within the league.
team_records_elimination_number_division character Elimination number within the division.
team_records_elimination_number_conference character Elimination number within the conference.
team_records_wild_card_elimination_number character Wild card elimination number.
team_records_magic_number character Magic number to clinch.
team_records_wins integer Total wins.
team_records_losses integer Total losses.
team_records_run_differential integer Run differential (runs scored minus allowed).
team_records_winning_percentage character Winning percentage.
team_records_wild_card_rank character Rank in the wild card race.
team_records_wild_card_leader logical Whether the team leads the wild card race.
team_records_team_id integer Team MLBAM ID.
team_records_team_name character Team name.
team_records_team_link character API link to the team.
team_records_streak_streak_code character Current streak code (e.g., W3, L1).
team_records_streak_streak_type character Streak type (wins or losses).
team_records_streak_streak_number integer Length of the current streak.
team_records_league_record_wins integer Wins in league play.
team_records_league_record_losses integer Losses in league play.
team_records_league_record_ties integer Ties in league play.
team_records_league_record_pct character League play winning percentage.
team_records_records_split_records list Nested split records (home/away/etc.).
team_records_records_division_records list Nested records by division.
team_records_records_overall_records list Nested overall records.
team_records_records_league_records list Nested records by league.
team_records_records_expected_records list Nested expected (Pythagorean) records.
league_id integer League MLBAM ID.
league_link character API link to the league.
division_id integer Division MLBAM ID.
division_link character API link to the division.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
round_robin_status character Round robin status indicator.

Examples

try(mlb_standings(season = 2021, league_id = 103))

MLB Standings Types

Description

MLB Standings Types

Usage

mlb_standings_types()

Value

Returns a tibble with the following columns

col_name types description
standings_type_name character Standings type identifier (e.g., wildCard).
standings_type_description character Human-readable description of the type.

Examples

try(mlb_standings_types())

MLB Stat Groups

Description

MLB Stat Groups

Usage

mlb_stat_groups()

Value

Returns a tibble with the following columns

col_name types description
stat_group_name character Stat group display name (e.g., hitting).

Examples

try(mlb_stat_groups())

MLB Stat Types

Description

MLB Stat Types

Usage

mlb_stat_types()

Value

Returns a tibble with the following columns

col_name types description
stat_type_name character Stat type display name (e.g., projected).

Examples

try(mlb_stat_types())

MLB Stats

Description

MLB Stats

Usage

mlb_stats(
  stat_type = NULL,
  player_pool = NULL,
  game_type = NULL,
  team_id = NULL,
  position = NULL,
  stat_group = NULL,
  season = NULL,
  league_id = NULL,
  sport_ids = NULL,
  sort_stat = NULL,
  order = NULL,
  limit = 1000,
  offset = NULL
)

Arguments

stat_type

Stat type to return statistics for.

player_pool

There are 4 different types of player pools to return statistics for a particular player pool across a sport. Acceptable values include: All, Qualified, Rookies, or Qualified_rookies

game_type

Game type to return information for a particular statistic in a particular game type.

team_id

Team ID to return information and ranking for a particular statistic for a particular team.

position

Position to return statistics for a given position. Default to "Qualified" player pool Acceptable values include:

  • P

  • C

  • 1B

  • 2B

  • 3B

  • SS

  • LF

  • CF

  • RF

  • DH

  • PH

  • PR

  • BR

  • OF

  • IF

  • SP

  • RP

  • CP

  • UT

  • UI

  • UO

  • RHP

  • LHP

  • RHS

  • LHS

  • LHR

  • RHR

  • B

  • X

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

league_id

League ID to return statistics for a given league. Default to "Qualified" player pool.

sport_ids

The sport_id(s) to return information and ranking information for.

sort_stat

Sort return based on stat.

order

Order return based on either desc or asc.

limit

A limit to limit return to a particular number of records.

offset

An offset to returns i+1 as the first record in the set of players.

Value

Returns a tibble with the following columns

col_name types description
total_splits integer Total number of splits in the response.
season character Season year for the statistic.
num_teams integer Number of teams the player appeared for.
rank integer Rank of the player for the sorted statistic.
age integer Player age during the season.
games_played integer Games played.
ground_outs integer Ground outs.
air_outs integer Air outs (fly outs).
runs integer Runs scored.
doubles integer Doubles.
triples integer Triples.
home_runs integer Home runs.
strike_outs integer Strikeouts.
base_on_balls integer Walks (bases on balls).
intentional_walks integer Intentional walks.
hits integer Hits.
hit_by_pitch integer Times hit by pitch.
avg character Batting average.
at_bats integer At bats.
obp character On-base percentage.
slg character Slugging percentage.
ops character On-base plus slugging.
caught_stealing integer Times caught stealing.
stolen_bases integer Stolen bases.
stolen_base_percentage character Stolen base success percentage.
caught_stealing_percentage character Caught stealing percentage.
ground_into_double_play integer Grounded into double plays.
number_of_pitches integer Total pitches seen.
plate_appearances integer Plate appearances.
total_bases integer Total bases.
rbi integer Runs batted in.
left_on_base integer Runners left on base.
sac_bunts integer Sacrifice bunts.
sac_flies integer Sacrifice flies.
babip character Batting average on balls in play.
ground_outs_to_airouts character Ratio of ground outs to air outs.
catchers_interference integer Times reached on catcher's interference.
at_bats_per_home_run character At bats per home run.
team_id integer Team MLBAM ID.
team_name character Team name.
team_link character API link to the team.
player_id integer Player MLBAM ID.
player_full_name character Player full name.
player_link character API link to the player.
player_first_name character Player first name.
player_last_name character Player last name.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_abbreviation character Sport abbreviation (e.g., MLB).
position_code character Primary position code.
position_name character Primary position name.
position_type character Primary position type.
position_abbreviation character Primary position abbreviation.
splits_tied_with_offset list Players tied at the offset boundary.
splits_tied_with_limit list Players tied at the limit boundary.
player_pool character Player pool used (e.g., QUALIFIED).
type_display_name character Stat type display name.
group_display_name character Stat group display name.

Examples

try(mlb_stats(stat_type = 'season', stat_group = 'hitting', season = 2021))

MLB Stats Endpoint Overview

Description

  • mlb_stats(): MLB Stats.

  • mlb_stats_leaders(): MLB Stats Leaders.

  • mlb_stats_streaks(): MLB Stats Streaks.

  • mlb_stat_groups(): MLB Stat Groups.

  • mlb_stat_types(): MLB Stat Types.

  • mlb_baseball_stats(): MLB Baseball Stats.

Details

MLB Stats

These functions retrieve MLB statistics, leaders, streaks, stat groups, stat types, and baseball stat metadata from the MLB Stats API.


MLB Stats Leaders

Description

MLB Stats Leaders

Usage

mlb_stats_leaders(
  leader_categories = NULL,
  player_pool = NULL,
  leader_game_types = NULL,
  sit_codes = NULL,
  position = NULL,
  stat_group = NULL,
  season = NULL,
  league_id = NULL,
  sport_id = NULL,
  start_date = NULL,
  end_date = NULL,
  stat_type = NULL,
  limit = 1000
)

Arguments

leader_categories

League leader category to return information and ranking for a particular statistic.

player_pool

There are 4 different types of player pools to return statistics for a particular player pool across a sport. Acceptable values include: All, Qualified, Rookies, or Qualified_rookies

leader_game_types

Game type to return information and ranking for a particular statistic in a particular game type.

sit_codes

Situation code to return information and ranking for a particular statistic in a particular game type.

position

Position to return statistics for a given position. Default to "Qualified" player pool Acceptable values include:

  • P

  • C

  • 1B

  • 2B

  • 3B

  • SS

  • LF

  • CF

  • RF

  • DH

  • PH

  • PR

  • BR

  • OF

  • IF

  • SP

  • RP

  • CP

  • UT

  • UI

  • UO

  • RHP

  • LHP

  • RHS

  • LHS

  • LHR

  • RHR

  • B

  • X

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

league_id

League ID to return statistics for a given league. Default to "Qualified" player pool.

sport_id

The sport_id to return information and ranking information for.

start_date

Start date to return information and ranking for a particular statistic for a particular date range. Format: MM/DD/YYYY start_date must be coupled with end_date and byDateRange stat_type

end_date

End date to return information and ranking for a particular statistic for a particular date range. Format: MM/DD/YYYY end_date must be coupled with start_date and byDateRange stat_type

stat_type

The stat_type to return information and ranking for a particular statistic for a particular stat type.

limit

A limit to limit return to a particular number of records.

Value

Returns a tibble with the following columns

col_name types description
leader_category character Statistical leader category (e.g., homeRuns).
rank integer Rank within the leaderboard.
value character Statistic value for the leader.
season character Season year.
num_teams integer Number of teams the player appeared for.
team_id integer Team MLBAM ID.
team_name character Team name.
team_link character API link to the team.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
person_id integer Player MLBAM ID.
person_full_name character Player full name.
person_link character API link to the player.
person_first_name character Player first name.
person_last_name character Player last name.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_abbreviation character Sport abbreviation (e.g., MLB).
stat_group character Stat group (e.g., hitting).
total_splits integer Total number of splits in the leaderboard.
game_type_id character Game type code (e.g., R for regular season).
game_type_description character Game type description.

Examples

try(mlb_stats_leaders(leader_categories='homeRuns',sport_id=1, season = 2021))

MLB Team Affiliates

Description

MLB Team Affiliates

Usage

mlb_team_affiliates(team_ids = NULL, sport_ids = NULL, season = NULL)

Arguments

team_ids

The team_id(s) to return affiliates data for.

sport_ids

The sport_id to return team affiliates information for.

season

The season to return team affiliates data for the particular season.

Value

Returns a tibble with the following columns

col_name types description
all_star_status character All-star status flag.
team_id integer Team MLBAM ID.
team_full_name character Full team name.
link character API link to the team.
season integer Season year.
team_code character Internal team code.
file_code character File code abbreviation.
team_abbreviation character Team abbreviation.
team_name character Short team name.
location_name character Team location (city).
first_year_of_play character First year the franchise played.
short_name character Short display name.
franchise_name character Franchise name.
club_name character Club name.
active logical Whether the team is active.
parent_org_name character Parent organization name.
parent_org_id integer Parent organization MLBAM ID.
spring_league_id integer Spring league MLBAM ID.
spring_league_name character Spring league name.
spring_league_link character API link to the spring league.
spring_league_abbreviation character Spring league abbreviation.
venue_id integer Home venue MLBAM ID.
venue_name character Home venue name.
venue_link character API link to the venue.
spring_venue_id integer Spring training venue MLBAM ID.
spring_venue_link character API link to the spring venue.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
division_id integer Division MLBAM ID.
division_name character Division name.
division_link character API link to the division.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_name character Sport name (e.g., Major League Baseball).

Examples

try(mlb_team_affiliates(team_ids = 147))

MLB Team Alumni

Description

MLB Team Alumni

Usage

mlb_team_alumni(team_id = NULL, stat_group = NULL, season = NULL)

Arguments

team_id

Team ID to return information and ranking for a particular statistic for a particular team.

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

Value

Returns a tibble with the following columns

col_name types description
player_id integer MLBAM player ID.
player_full_name character Player full name.
link character API link to the player resource.
first_name character Player first name.
last_name character Player last name.
primary_number character Primary uniform number.
birth_date character Date of birth (YYYY-MM-DD).
current_age integer Current age in years.
birth_city character City of birth.
birth_country character Country of birth.
height character Listed height (feet and inches).
weight integer Listed weight in pounds.
active logical Whether the player is currently active.
use_name character Preferred first name for display.
use_last_name character Preferred last name for display.
middle_name character Player middle name.
boxscore_name character Name as shown in box scores.
nick_name character Player nickname.
gender character Player gender code.
name_matrilineal character Matrilineal (maternal) surname.
is_player logical Whether the person is a player.
is_verified logical Whether the profile is verified.
pronunciation character Phonetic pronunciation of the name.
last_played_date character Date of last MLB appearance.
mlb_debut_date character MLB debut date (YYYY-MM-DD).
name_first_last character Name in first-last order.
name_slug character URL slug for the player.
first_last_name character First and last name display.
last_first_name character Last, first name display.
last_init_name character Last name with first initial.
init_last_name character First initial with last name.
full_fml_name character Full first-middle-last name.
full_lfm_name character Full last-first-middle name.
strike_zone_top numeric Top of the player's strike zone (feet).
strike_zone_bottom numeric Bottom of the player's strike zone (feet).
alumni_last_season character Last season the player was with the team.
birth_state_province character State or province of birth.
draft_year integer Year the player was drafted.
primary_position_code character Primary position code.
primary_position_name character Primary position name.
primary_position_type character Primary position type.
primary_position_abbreviation character Primary position abbreviation.
bat_side_code character Batting side code (L/R/S).
bat_side_description character Batting side description.
pitch_hand_code character Throwing hand code (L/R).
pitch_hand_description character Throwing hand description.

Examples

try(mlb_team_alumni(team_id = 137, stat_group = 'hitting', season = 2021))

MLB Team Coaches

Description

MLB Team Coaches

Usage

mlb_team_coaches(team_id = NULL, date = NULL, season = NULL)

Arguments

team_id

Team ID to return team coach information for.

date

Date to return team coach information for.

season

Year to return team coach information for.

Value

Returns a tibble with the following columns

col_name types description
jersey_number character Coach uniform number.
job character Job name (e.g., Manager).
job_id character Job code identifier.
title character Full coaching title.
person_id integer Coach MLBAM person ID.
person_full_name character Coach full name.
person_link character API link to the coach.

Examples

try(mlb_team_coaches(team_id = 137, season = 2021))

MLB Teams Endpoint Overview

Description

  • mlb_teams(): MLB Teams.

  • mlb_team_info(): MLB Team Info.

  • mlb_team_affiliates(): MLB Team Affiliates.

  • mlb_team_alumni(): MLB Team Alumni.

  • mlb_team_coaches(): MLB Team Coaches.

  • mlb_team_history(): MLB Teams History.

  • mlb_team_leaders(): MLB Team Leaders.

  • mlb_team_personnel(): MLB Team Personnel.

  • mlb_team_stats(): MLB Team Individual Stats.

  • mlb_teams_stats(): MLB Teams Stats.

  • mlb_teams_stats_leaders(): MLB Teams Stats Leaders.

Details

MLB Teams

These functions retrieve MLB team, affiliate, alumni, coach, history, leader, personnel, and stats information from the MLB Stats API.


MLB Teams History

Description

MLB Teams History

Usage

mlb_team_history(team_ids = NULL, start_season = NULL, end_season = NULL)

Arguments

team_ids

The team_id(s) to return historical data for.

start_season

The start_season to return historical data for from the given year to present.

end_season

The end_season to return historical data for from the the creation to the given year.

Value

Returns a tibble with the following columns

col_name types description
all_star_status character All-star status flag.
team_id integer Team MLBAM ID.
team_full_name character Full team name.
link character API link to the team.
season integer Season year for the historical record.
team_code character Internal team code.
file_code character File code abbreviation.
team_abbreviation character Team abbreviation.
team_name character Short team name.
location_name character Team location (city).
first_year_of_play character First year the franchise played.
short_name character Short display name.
franchise_name character Franchise name.
club_name character Club name.
active logical Whether the team is active.
venue_id integer Home venue MLBAM ID for that season.
venue_name character Home venue name for that season.
venue_link character API link to the venue.
spring_venue_id integer Spring training venue MLBAM ID.
spring_venue_link character API link to the spring venue.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_name character Sport name (e.g., Major League Baseball).

Examples

try(mlb_team_history(team_ids = 147))

MLB Team Info

Description

MLB Team Info

Usage

mlb_team_info(team_id = NULL, season = NULL, sport_id = NULL)

Arguments

team_id

The team_id to return team data for.

season

The season to return team data for the given year.

sport_id

The sport_id to return a directory of team data for a particular club in a sport.

Value

Returns a tibble with the following columns

col_name types description
all_star_status character All-star status flag.
team_id integer Team MLBAM ID.
team_full_name character Full team name.
link character API link to the team.
season integer Season year.
team_code character Internal team code.
file_code character File code abbreviation.
team_abbreviation character Team abbreviation.
team_name character Short team name.
location_name character Team location (city).
first_year_of_play character First year the franchise played.
short_name character Short display name.
franchise_name character Franchise name.
club_name character Club name.
active logical Whether the team is active.
spring_league_id integer Spring league MLBAM ID.
spring_league_name character Spring league name.
spring_league_link character API link to the spring league.
spring_league_abbreviation character Spring league abbreviation.
venue_id integer Home venue MLBAM ID.
venue_name character Home venue name.
venue_link character API link to the venue.
spring_venue_id integer Spring training venue MLBAM ID.
spring_venue_link character API link to the spring venue.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
division_id integer Division MLBAM ID.
division_name character Division name.
division_link character API link to the division.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_name character Sport name (e.g., Major League Baseball).

Examples

try(mlb_team_info(team_id = 147))

MLB Team Leaders

Description

MLB Team Leaders

Usage

mlb_team_leaders(
  team_id = NULL,
  leader_categories = NULL,
  leader_game_types = NULL,
  season = NULL,
  limit = 1000
)

Arguments

team_id

Team ID to return team leader information for.

leader_categories

Team leader category to return information and ranking for a particular statistic.

leader_game_types

Game type to return information and ranking for a particular statistic in a particular game type.

season

Season to return team leader information for.

limit

A limit to limit return to a particular number of records.

Value

Returns a tibble with the following columns

col_name types description
leader_category character Team leader category (e.g., homeRuns).
rank integer Rank within the team leaderboard.
value character Statistic value for the leader.
season character Season year.
team_id integer Team MLBAM ID.
team_name character Team name.
team_link character API link to the team.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
person_id integer Player MLBAM ID.
person_full_name character Player full name.
person_link character API link to the player.
person_first_name character Player first name.
person_last_name character Player last name.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_abbreviation character Sport abbreviation (e.g., MLB).
stat_group character Stat group (e.g., hitting).
total_splits integer Total number of splits in the leaderboard.
game_type_id character Game type code (e.g., R for regular season).
game_type_description character Game type description.

Examples

try(mlb_team_leaders(team_id = 137, leader_categories = "homeRuns", season = 2021))

MLB Team Personnel

Description

MLB Team Personnel

Usage

mlb_team_personnel(team_id = NULL, date = NULL)

Arguments

team_id

Team ID to return team coach information for.

date

Date to return team coach information for.

Value

Returns a tibble with the following columns

col_name types description
jersey_number character Personnel uniform number.
job character Job name (e.g., Special Assistant).
job_id character Job code identifier.
title character Full personnel title.
person_id integer Personnel MLBAM person ID.
person_full_name character Personnel full name.
person_link character API link to the person.

Examples

try(mlb_team_personnel(team_id = 137, date = "08/28/2016"))

MLB Team Individual Stats

Description

MLB Team Individual Stats

Usage

mlb_team_stats(
  team_id = NULL,
  stat_type = NULL,
  game_type = NULL,
  stat_group = NULL,
  season = NULL,
  sport_ids = NULL
)

Arguments

team_id

Team ID to return information and ranking for a particular statistic for a particular team.

stat_type

Stat type to return statistics for.

game_type

Game type to return information for a particular statistic in a particular game type.

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

sport_ids

The sport_id(s) to return information and ranking information for.

Value

Returns a tibble with the following columns

col_name types description
season character Season year for the statistic.
games_played integer Games played.
ground_outs integer Ground outs.
air_outs integer Air outs (fly outs).
runs integer Runs scored.
doubles integer Doubles.
triples integer Triples.
home_runs integer Home runs.
strike_outs integer Strikeouts.
base_on_balls integer Walks (bases on balls).
intentional_walks integer Intentional walks.
hits integer Hits.
hit_by_pitch integer Times hit by pitch.
avg character Batting average.
at_bats integer At bats.
obp character On-base percentage.
slg character Slugging percentage.
ops character On-base plus slugging.
caught_stealing integer Times caught stealing.
stolen_bases integer Stolen bases.
stolen_base_percentage character Stolen base success percentage.
caught_stealing_percentage character Caught stealing percentage.
ground_into_double_play integer Grounded into double plays.
number_of_pitches integer Total pitches seen.
plate_appearances integer Plate appearances.
total_bases integer Total bases.
rbi integer Runs batted in.
left_on_base integer Runners left on base.
sac_bunts integer Sacrifice bunts.
sac_flies integer Sacrifice flies.
babip character Batting average on balls in play.
ground_outs_to_airouts character Ratio of ground outs to air outs.
catchers_interference integer Times reached on catcher's interference.
at_bats_per_home_run character At bats per home run.
team_id integer Team MLBAM ID.
team_name character Team name.
team_link character API link to the team.
type_display_name character Stat type display name.
group_display_name character Stat group display name.

Examples

try(mlb_team_stats(team_id = 137, stat_type = 'season', stat_group = 'hitting', season = 2021))

MLB Teams

Description

MLB Teams

Usage

mlb_teams(
  season = NULL,
  active_status = NULL,
  all_star_statuses = NULL,
  league_ids = NULL,
  sport_ids = NULL,
  game_type = NULL
)

Arguments

season

Year to return to return team information for.

active_status

The active statuses to populate teams for a given season.

all_star_statuses

The all-star statuses to populate teams for a given season.

league_ids

The league_id(s) to return team information for.

sport_ids

The sport_id(s) to return team information for.

game_type

The game_type to return team information for.

Value

Returns a tibble with the following columns

col_name types description
all_star_status character All-star status flag.
team_id integer Team MLBAM ID.
team_full_name character Full team name.
link character API link to the team.
season integer Season year.
team_code character Internal team code.
file_code character File code abbreviation.
team_abbreviation character Team abbreviation.
team_name character Short team name.
location_name character Team location (city).
first_year_of_play character First year the franchise played.
short_name character Short display name.
franchise_name character Franchise name.
club_name character Club name.
active logical Whether the team is active.
spring_league_id integer Spring league MLBAM ID.
spring_league_name character Spring league name.
spring_league_link character API link to the spring league.
spring_league_abbreviation character Spring league abbreviation.
venue_id integer Home venue MLBAM ID.
venue_name character Home venue name.
venue_link character API link to the venue.
spring_venue_id integer Spring training venue MLBAM ID.
spring_venue_link character API link to the spring venue.
league_id integer League MLBAM ID.
league_name character League name.
league_link character API link to the league.
division_id integer Division MLBAM ID.
division_name character Division name.
division_link character API link to the division.
sport_id integer Sport MLBAM ID.
sport_link character API link to the sport.
sport_name character Sport name (e.g., Major League Baseball).

Examples

try(mlb_teams(season = 2021, sport_ids = c(1)))

MLB Teams Stats

Description

MLB Teams Stats

Usage

mlb_teams_stats(
  stat_type = NULL,
  game_type = NULL,
  stat_group = NULL,
  season = NULL,
  sport_ids = NULL,
  sort_stat = NULL,
  order = NULL
)

Arguments

stat_type

Stat type to return statistics for.

game_type

Game type to return information for a particular statistic in a particular game type.

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

sport_ids

The sport_id(s) to return information and ranking information for.

sort_stat

Sort return based on stat.

order

Order return based on either desc or asc.

Value

Returns a tibble with the following columns

col_name types description
total_splits integer Total number of splits in the response.
season character Season year for the statistic.
rank integer Rank of the team for the sorted statistic.
games_played integer Games played.
ground_outs integer Ground outs.
air_outs integer Air outs (fly outs).
runs integer Runs scored.
doubles integer Doubles.
triples integer Triples.
home_runs integer Home runs.
strike_outs integer Strikeouts.
base_on_balls integer Walks (bases on balls).
intentional_walks integer Intentional walks.
hits integer Hits.
hit_by_pitch integer Times hit by pitch.
avg character Batting average.
at_bats integer At bats.
obp character On-base percentage.
slg character Slugging percentage.
ops character On-base plus slugging.
caught_stealing integer Times caught stealing.
stolen_bases integer Stolen bases.
stolen_base_percentage character Stolen base success percentage.
caught_stealing_percentage character Caught stealing percentage.
ground_into_double_play integer Grounded into double plays.
number_of_pitches integer Total pitches seen.
plate_appearances integer Plate appearances.
total_bases integer Total bases.
rbi integer Runs batted in.
left_on_base integer Runners left on base.
sac_bunts integer Sacrifice bunts.
sac_flies integer Sacrifice flies.
babip character Batting average on balls in play.
ground_outs_to_airouts character Ratio of ground outs to air outs.
catchers_interference integer Times reached on catcher's interference.
at_bats_per_home_run character At bats per home run.
team_id integer Team MLBAM ID.
team_name character Team name.
team_link character API link to the team.
splits_tied_with_offset list Teams tied at the offset boundary.
splits_tied_with_limit list Teams tied at the limit boundary.
type_display_name character Stat type display name.
group_display_name character Stat group display name.

Examples

try(mlb_teams_stats(stat_type = 'season', stat_group = 'hitting', season = 2021))

MLB Teams Stats Leaders

Description

MLB Teams Stats Leaders

Usage

mlb_teams_stats_leaders(
  leader_categories = NULL,
  leader_game_types = NULL,
  sit_codes = NULL,
  stat_group = NULL,
  season = NULL,
  league_id = NULL,
  sport_id = NULL,
  start_date = NULL,
  end_date = NULL,
  stat_type = NULL,
  limit = 1000
)

Arguments

leader_categories

League leader category to return information and ranking for a particular statistic.

leader_game_types

Game type to return information and ranking for a particular statistic in a particular game type.

sit_codes

Situation code to return information and ranking for a particular statistic in a particular game type.

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

league_id

League ID to return statistics for a given league. Default to "Qualified" player pool.

sport_id

The sport_id to return information and ranking information for.

start_date

Start date to return information and ranking for a particular statistic for a particular date range. Format: MM/DD/YYYY start_date must be coupled with end_date and byDateRange stat_type

end_date

End date to return information and ranking for a particular statistic for a particular date range. Format: MM/DD/YYYY end_date must be coupled with start_date and byDateRange stat_type

stat_type

The stat_type to return information and ranking for a particular statistic for a particular stat type.

limit

A limit to limit return to a particular number of records.

Value

Returns a tibble with the following columns

col_name types description
leader_category character Team leader category (e.g., homeRuns).
rank integer Rank within the team leaderboard.
value character Statistic value for the team.
season character Season year.
team_id integer Team MLBAM ID.
team_name character Team name.
team_link character API link to the team.
stat_group character Stat group (e.g., hitting).
total_splits integer Total number of splits in the leaderboard.
game_type_id character Game type code (e.g., R for regular season).
game_type_description character Game type description.

Examples

try(mlb_teams_stats_leaders(leader_categories='homeRuns',sport_id=1, season = 2021))

Find MLB Venues

Description

Find MLB Venues

Usage

mlb_venues(venue_ids = NULL, sport_ids = NULL, season = NULL)

Arguments

venue_ids

Venue directorial information based venue_id.

sport_ids

The sport_id(s) for which to return venue directorial information.

season

Year for which to return venue directorial information for a given season.

Value

Returns a tibble with the following columns:

col_name types description
venue_id integer Venue MLBAM ID.
venue_name character Venue name.
venue_link character API link to the venue.
active logical Whether the venue is active.
season character Season the venue record applies to.

Examples

try(mlb_venues())
  try(mlb_venues(venue_ids = 4781))
  try(mlb_venues(sport_ids = 1))

MLB Wind Direction Codes

Description

MLB Wind Direction Codes

Usage

mlb_wind_direction_codes()

Value

Returns a tibble with the following columns

col_name types description
wind_direction_code character Wind direction code (e.g., In From CF).
wind_direction_description character Wind direction description.

Examples

try(mlb_wind_direction_codes())

Most Recent MLB Season

Description

Most Recent MLB Season

Usage

most_recent_mlb_season()

Value

An integer indicating the year of the most recent season of Major League Baseball


Most Recent NCAA Baseball Season

Description

Most Recent NCAA Baseball Season

Usage

most_recent_ncaa_baseball_season()

Value

An integer indicating the year of the most recent season of NCAA baseball


NCAA Functions Overview

Description

  • ncaa_team_player_stats(): This function allows the user to obtain batting or pitching statistics for any school affiliated with the NCAA at the division I, II, or III levels. The function acquires data from the NCAA's website (stats.ncaa.org) and returns a tibble.

  • ncaa_pbp(): Get Play-By-Play Data for NCAA Baseball Games.

  • ncaa_roster(): Get NCAA Baseball Rosters.

  • ncaa_game_logs(): Get NCAA Baseball Game Logs.

  • ncaa_lineups(): Get NCAA Baseball Game Lineups.

  • ncaa_park_factor(): Get Park Effects for NCAA Baseball Teams.

  • ncaa_schedule_info(): Get Schedule and Results for NCAA Baseball Teams.

  • ncaa_school_id_lu(): Lookup NCAA School IDs (Division I, II, and III)

  • ncaa_teams(): Lookup NCAA Teams by Division (I, II, and III) and Season

Details

Scrape NCAA baseball data (Division I, II, and III)

  ncaa_team_player_stats(team_id = 255, year = 2013, type = "batting")

Get Play-By-Play Data for NCAA Baseball Games

  x <- ncaa_schedule_info(736, 2021)$game_info_url[2]
  ncaa_pbp(game_info_url = x)

Get NCAA Baseball Rosters

  ncaa_roster(team_id = 104, year = 2021)

Get NCAA Baseball Game Logs

  ncaa_game_logs(player_id = 2113782, year = 2021, type = "pitching", span = "game")

Get NCAA Baseball Game Lineups

  ncaa_lineups(game_info_url="https://stats.ncaa.org/game/index/4587474?org_id=528",year=2018)

Get Park Effects for NCAA Baseball Teams

   ncaa_park_factor(team_id = 736, years = c(2017:2019), type = "conference")

Get Schedule and Results for NCAA Baseball Teams

  ncaa_schedule_info(team_id = 736, year = 2021)

Lookup NCAA School IDs (Division I, II, and III)

  ncaa_school_id_lu("VAN")

Scrape NCAA baseball Teams (Division I, II, and III)

  ncaa_teams(year = 2023, division = 1)

(legacy) Get NCAA Baseball Rosters

Description

(legacy) Get NCAA Baseball Rosters

(legacy) Get NCAA Baseball Rosters

Usage

ncaa_baseball_roster(team_id = NULL, year, ...)

get_ncaa_baseball_roster(team_id = NULL, year, ...)

Arguments

team_id

NCAA id for a school

year

The year of interest

...

Additional arguments passed to an underlying function like httr.

Value

A data frame containing roster information, including IDs and urls for each player (if available)

A data frame containing roster information, including IDs and urls for each player (if available)


Get NCAA Baseball Game Logs

Description

Get NCAA Baseball Game Logs

Usage

ncaa_game_logs(player_id, year, type = "batting", span = "game", ...)

Arguments

player_id

A player's unique id. Can be found using the get_ncaa_baseball_roster function.

year

The year of interest.

type

The kind of statistics you want to return. Current options are 'batting' or 'pitching'.

span

The span of time; can either be 'game' for game logs in a season, or 'career' which returns seasonal stats for a player's career.

...

Additional arguments passed to an underlying function like httr.

Value

A data frame containing player and school information as well as game by game statistics

col_name types
player_id numeric
player_name character
Date character
Opponent character
Result character
App numeric
G numeric
GS numeric
IP numeric
CG numeric
H numeric
R numeric
ER numeric
BB numeric
SO numeric
SHO numeric
BF numeric
P-OAB numeric
2B-A numeric
3B-A numeric
Bk numeric
HR-A numeric
WP numeric
HB numeric
IBB numeric
Inh Run numeric
Inh Run Score numeric
SHA numeric
SFA numeric
Pitches numeric
GO numeric
FO numeric
W numeric
L numeric
SV numeric
OrdAppeared numeric
KL numeric
pickoffs character

Examples

try(ncaa_game_logs(player_id = 2649785, year = 2023, type = "pitching", span = "game"))
  try(ncaa_game_logs(player_id = 2477974, year = 2023, type = "pitching", span = "career"))
  try(ncaa_game_logs(player_id = 2680961, year = 2023, type = "batting", span = "game"))
  try(ncaa_game_logs(player_id = 2486588, year = 2023, type = "batting", span = "career"))

Retrieve lineups for a given NCAA game via its game_info_url

Description

Retrieve lineups for a given NCAA game via its game_info_url

Usage

ncaa_lineups(game_info_url = NULL, ...)

Arguments

game_info_url

The unique game info url

...

Additional arguments passed to an underlying function like httr.

Value

Returns a tibble of each school's starting lineup and starting pitcher

col_name types
year numeric
player_name character
position character
slug character
batting_order character
team_name character
sub numeric
attendance character
game_date character
location character
player_id integer
team_id numeric
team_url character
conference_id numeric
conference character
division numeric
season_id numeric

Examples

try(ncaa_lineups(game_info_url="https://stats.ncaa.org/contests/2167178/box_score"))
  try(ncaa_lineups(game_info_url="https://stats.ncaa.org/game/index/4587474?org_id=528"))

Get Park Effects for NCAA Baseball Teams

Description

Get Park Effects for NCAA Baseball Teams

Usage

ncaa_park_factor(team_id, years, type = "conference", ...)

Arguments

team_id

The team's unique NCAA id.

years

The season or seasons (i.e. use 2016 for the 2015-2016 season, etc., limited to just 2013-2023 seasons).

type

default is conference. the conference parameter adjusts for the conference the school plays in, the division parameter calculates based on the division the school plays in 1,2,or 3. Defaults to 'conference'.

...

Additional arguments passed to an underlying function like httr.

Details

  try(ncaa_park_factor(team_id = 736, years = c(2018:2019), type = "conference"))

Value

A data frame with the following fields: school, home_game, away_game, runs_scored_home, runs_allowed_home, run_scored_away, runs_allowed_away, base_pf (base park factor), home_game_adj (an adjustment for the percentage of home games played) final_pf (park factor after adjustments)

col_name types
school character
home_game numeric
away_game numeric
runs_scored_home numeric
runs_allowed_home numeric
runs_scored_away numeric
runs_allowed_away numeric
base_pf numeric
home_game_adj numeric
final_pf numeric

Get Play-By-Play Data for NCAA Baseball Games

Description

Get Play-By-Play Data for NCAA Baseball Games

Usage

ncaa_pbp(
  game_info_url = NA_character_,
  game_pbp_url = NA_character_,
  raw_html_to_disk = FALSE,
  raw_html_path = "/",
  read_from_file = FALSE,
  file = NA_character_,
  ...
)

Arguments

game_info_url

The url for the game's boxscore data. This can be found using the ncaa_schedule_info function.

game_pbp_url

The url for the game's play-by-play data. This can be found using the ncaa_schedule_info function.

raw_html_to_disk

Write raw html to disk (saves as {game_pbp_id}.html in raw_html_path directory)

raw_html_path

Directory path to write raw html

read_from_file

Read from raw html on disk

file

File with full path to read raw html

...

Additional arguments passed to an underlying function like httr.

Value

A data frame with play-by-play data for an individual game.

col_name types
game_date character
location character
attendance logical
inning character
inning_top_bot character
score character
batting character
fielding character
description character
game_pbp_url character
game_pbp_id integer

Examples

try(ncaa_pbp(game_info_url = "https://stats.ncaa.org/contests/2167178/box_score"))

Get NCAA Baseball Rosters

Description

Get NCAA Baseball Rosters

Usage

ncaa_roster(team_id = NULL, year, ...)

Arguments

team_id

NCAA id for a school

year

The year of interest

...

Additional arguments passed to an underlying function like httr.

Value

A data frame containing roster information, including IDs and urls for each player (if available)

col_name types
player_name character
class character
player_id character
season numeric
number character
position character
player_url character
team_name character
conference character
team_id numeric
division numeric
conference_id numeric

Examples

try(ncaa_roster(team_id = 104, year = 2023))

Get Schedule and Results for NCAA Baseball Teams

Description

Get Schedule and Results for NCAA Baseball Teams

Usage

ncaa_schedule_info(team_id = NULL, year = NULL, pbp_links = FALSE, ...)

Arguments

team_id

The team's unique NCAA id.

year

The season (i.e. use 2016 for the 2015-2016 season, etc.)

pbp_links

Logical parameter to run process for scraping play_by_play urls for each game

...

Additional arguments passed to an underlying function like httr.

Details

 try(ncaa_schedule_info(team_id = 736, year = 2019))

Value

A data frame with the following fields: date, opponent, result, score, innings (if more than regulation), and the url for the game itself.

col_name types
year integer
season_id integer
date character
home_team character
home_team_id integer
home_team_conference character
home_team_conference_id integer
home_team_slug character
home_team_division integer
away_team character
away_team_id integer
away_team_conference character
away_team_conference_id integer
away_team_slug character
away_team_division integer
neutral_site character
result character
score character
innings character
slug character
game_info_url character
contest_id integer

Lookup NCAA baseball school IDs (Division I, II, and III)

Description

This function allows the user to look up the team_id needed for the ncaa_team_player_stats() function.

Usage

ncaa_school_id_lu(team_name = NULL)

Arguments

team_name

A string that will be searched for in the names of the teams.

Value

Returns a tibble with school identification data: team_id, team_name, team_url, conference, conference_id, division, year, and season_id

col_name types
team_id numeric
team_name character
team_url character
conference_id numeric
conference character
division numeric
year numeric
season_id numeric

Examples

try(ncaa_school_id_lu("Van"))

(legacy) Scrape NCAA baseball Team Player Stats (Division I, II, and III)

Description

(legacy) Scrape NCAA baseball Team Player Stats (Division I, II, and III)

Usage

ncaa_scrape(
  team_id,
  year = most_recent_ncaa_baseball_season(),
  type = "batting",
  ...
)

Arguments

team_id

The numerical ID that the NCAA website uses to identify a team

year

The season for which data should be returned, in the form of "YYYY". Years currently available: 2013-2017.

type

A string indicating whether to return "batting" or "pitching" statistics

...

Additional arguments passed to an underlying function like httr.

Value

A data frame with the following variables

col_name types
year integer
team_name character
team_id numeric
conference_id integer
conference character
division numeric
player_id integer
player_url character
player_name character
Yr character
Pos character
Jersey character
GP numeric
GS numeric
BA numeric
OBPct numeric
SlgPct numeric
R numeric
AB numeric
H numeric
2B numeric
3B numeric
TB numeric
HR numeric
RBI numeric
BB numeric
HBP numeric
SF numeric
SH numeric
K numeric
DP numeric
CS numeric
Picked numeric
SB numeric
RBI2out numeric

Scrape NCAA baseball Team Player Stats (Division I, II, and III)

Description

This function allows the user to obtain batting or pitching statistics for any school affiliated with the NCAA at the division I, II, or III levels. The function acquires data from the NCAA's website (stats.ncaa.org) and returns a tibble.

Usage

ncaa_team_player_stats(
  team_id,
  year = most_recent_ncaa_baseball_season(),
  type = "batting",
  ...
)

Arguments

team_id

The numerical ID that the NCAA website uses to identify a team

year

The season for which data should be returned, in the form of "YYYY". Years currently available: 2013-2017.

type

A string indicating whether to return "batting" or "pitching" statistics

...

Additional arguments passed to an underlying function like httr.

Value

A data frame with the following variables

col_name types
year integer
team_name character
team_id numeric
conference_id integer
conference character
division numeric
player_id integer
player_url character
player_name character
Yr character
Pos character
Jersey character
GP numeric
GS numeric
BA numeric
OBPct numeric
SlgPct numeric
R numeric
AB numeric
H numeric
2B numeric
3B numeric
TB numeric
HR numeric
RBI numeric
BB numeric
HBP numeric
SF numeric
SH numeric
K numeric
DP numeric
CS numeric
Picked numeric
SB numeric
RBI2out numeric

Examples

try(ncaa_team_player_stats(team_id = 234, year = 2023, type = "batting"))

Scrape NCAA baseball Teams (Division I, II, and III)

Description

This function allows the user to obtain NCAA teams by year and division

Usage

ncaa_teams(year = most_recent_ncaa_baseball_season(), division = 1, ...)

Arguments

year

The season for which data should be returned, in the form of "YYYY". Years currently available: 2002 onward.

division

Division - 1, 2, 3

...

Additional arguments passed to an underlying function like httr.

Details

ncaa_teams(2023, 1)

Value

A data frame with the following variables

col_name types description
team_id character Franchise team id (legacy ⁠/team/{id}/...⁠ urls).
team_name character Team display name.
team_url character Relative team url from stats.ncaa.org.
conference_id character Conference identifier.
conference character Conference name.
division numeric NCAA division (1, 2, 3).
year numeric Season (4-digit year).
season_id character Season id (legacy urls); join key to season ids.
season_team_id character Season-team id (modern ⁠/teams/{id}⁠ urls).

(legacy) Scrape Pitcher Game Logs from FanGraphs

Description

(legacy) Scrape Pitcher Game Logs from FanGraphs

Usage

pitcher_game_logs_fg(playerid, year)

Arguments

playerid

This is the playerid used by FanGraphs for a given player

year

The season for which game logs should be returned (use the YYYY format)

Value

A data frame of pitcher game logs.


Look up Baseball Player IDs by Player Name

Description

This function allows you to query the Chadwick Bureau's public register of baseball players and the various IDs associated with them in different systems of record.

Usage

playerid_lookup(last_name = NULL, first_name = NULL)

Arguments

last_name

A text string used to return results for players with that string in their last name.

first_name

A text string used to return results for players with that string in their first name.

Value

A data frame of baseball players and the various IDs associated with them in different systems of record.

col_name types description
first_name character Player first name.
last_name character Player last name.
given_name character Player full given (legal) name.
name_suffix character Name suffix (e.g. Jr., Sr., III).
nick_name character Player nickname.
birth_year integer Year of birth.
mlb_played_first integer First MLB season as a player.
mlbam_id integer MLB Advanced Media (MLBAM) player ID.
retrosheet_id character Retrosheet player ID.
bbref_id character Baseball-Reference player ID.
fangraphs_id integer FanGraphs player ID.

Examples

try(playerid_lookup("Garcia", "Karim"))

Look up Baseball Player Name by ID

Description

This function allows you to query the Chadwick Bureau's public register of baseball players and the various IDs associated with them in different systems of record.

Usage

playername_lookup(id)

Arguments

id

An integer or character string representing a player ID in a baseball database, cross-referenced through the Chadwick Bureau's public register of baseball players.

Value

A data frame of baseball players and the various IDs associated with them in different systems of record.

col_name types description
name_first character Player first name.
name_last character Player last name.
name_given character Player full given (legal) name.
name_suffix character Name suffix (e.g. Jr., Sr., III).
name_nick character Player nickname.
birth_year integer Year of birth.
mlb_played_first integer First MLB season as a player.
key_mlbam integer MLB Advanced Media (MLBAM) player ID.
key_retro character Retrosheet player ID.
key_bbref character Baseball-Reference player ID.
key_fangraphs integer FanGraphs player ID.

Examples

try(playername_lookup(4885))
  try(playername_lookup("kaaihki01"))

Process Baseball Savant CSV payload

Description

This is a helper function for all statcast_search() functions. The function processes the initial csv payload acquired from Baseball Savant to ensure consistency in formatting across downloads

Usage

process_statcast_payload(payload)

Arguments

payload

payload from a Baseball Savant request

Value

A tibble with the processed Statcast data coerced to the correct types.


Get, Parse, and Format Retrosheet Event and Roster Files

Description

This function requires the use of the ⁠Chadwick CLI⁠. Follow the directions at the repository for installation of the CLI release for your platform. Specifically from the ⁠Chadwick CLI⁠ tools, this function requires the cwevent application to be available from the command line. For unix platform users: the retrosheet_data() function uses the system() interface under the hood. For Windows and other platform users: the retrosheet_data() function interacts with the cwevent application using the shell() interface under the hood.

Usage

retrosheet_data(
  path_to_directory = NULL,
  years_to_acquire = most_recent_mlb_season() - 1,
  sequence_years = FALSE
)

Arguments

path_to_directory

(default: NULL) A file path that if set, either:

  1. creates a new directory, or

  2. uses the path to an existing directory

years_to_acquire

(format: YYYY) The seasons to collect. Single, multiple, and sequential years can be passed. If passing multiple years, enclose in a vector (i.e. c(2017,2018)). Defaults to most_recent_mlb_season().

sequence_years

(logical, default: FALSE): If the seasons passed in the years_to_acquire parameter should be sequenced so that the function returns all years including and between the vector passed, set the argument to TRUE. Defaults to FALSE.

Details

retrosheet_data(path_to_directory = NULL, 
                years_to_acquire =  most_recent_mlb_season()-1, 
                sequence_years = FALSE)

Value

If path_to_directory is not set (default), the process will return a named list of tibbles: 'events' and 'rosters' for each season provided to years_to_acquire If path_to_directory is set, will also write two csv files to the unzipped directory: 1) a combined csv of the event data for a given year and 2) a combined csv of each team's roster for each year provided to years_to_acquire


Generate run expectancy and related measures from Baseball Savant data

Description

These functions allow a user to generate run expectancy and related measures and variables from Baseball Savant data. Measures and variables will be added to the data frame.

Usage

run_expectancy_code(df, level = "plate appearance")

Arguments

df

A data frame generated from Baseball Savant.

level

Whether you want run expectancy calculated at the plate appearance or pitch level. Defaults to plate appearance.

Value

Returns the input Baseball Savant data frame (the same Statcast pitch-level columns produced by statcast_search() – see that function's return value for the full column-by-column reference) with run-expectancy columns appended. The appended columns are:

col_name types description
final_pitch_game numeric 1 if the row is the last pitch of the game, 0 otherwise.
final_pitch_at_bat numeric 1 if the row is the last pitch of the plate appearance, 0 otherwise.
runs_scored_on_pitch numeric Runs that scored on the pitch (parsed from the play description, plus the batter on a home run).
bat_score_after numeric Batting team score after the pitch.
final_pitch_inning numeric 1 if the row is the last pitch of the half-inning, 0 otherwise.
bat_score_start_inning numeric Batting team score at the start of the half-inning.
bat_score_end_inning numeric Batting team score at the end of the half-inning.
cum_runs_in_inning numeric Cumulative runs scored in the half-inning up to the pitch.
runs_to_end_inning numeric Runs scored from the current state to the end of the half-inning.
count_base_out_state character Count, outs, and base-occupancy state string (pitch-level run expectancy).
avg_re numeric Average run expectancy for the current base-out (or count-base-out) state.
next_count_base_out_state character Base-out (or count-base-out) state of the following event.
next_avg_re numeric Average run expectancy for the next state (0 at the end of an inning).
change_re numeric Change in run expectancy between the current and next state.
re24 numeric RE24: change in run expectancy plus runs scored on the pitch.

At the plate-appearance level the analogous state columns are named base_out_state and next_base_out_state.

Examples

try({
   df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15", 
                         playerid = 621043, player_type = 'batter') 
   run_expectancy_code(df, level = "plate appearances")
 })

(legacy) Lookup NCAA baseball school IDs (Division I, II, and III)

Description

(legacy) Lookup NCAA baseball school IDs (Division I, II, and III)

Usage

school_id_lu(team_name = NULL)

Arguments

team_name

A string that will be searched for in the names of the teams.

Value

Returns a tibble with school identification data: team_id, team_name, team_url, conference, conference_id, division, year, and season_id


(legacy) Query Baseball Savant Leaderboards

Description

(legacy) Query Baseball Savant Leaderboards

Usage

scrape_savant_leaderboards(
  leaderboard = "exit_velocity_barrels",
  year = 2020,
  abs = 50,
  min_pa = "q",
  min_pitches = 100,
  min_throws = 100,
  min_field = "q",
  min_run = 0,
  player_type = "batter",
  fielding_type = "player",
  oaa_position = "",
  oaa_roles = "",
  team = "",
  arsenal_type = "n_",
  run_type = "raw",
  min2b = 5,
  min3b = 0,
  position = "",
  bats = "",
  hand = ""
)

Arguments

leaderboard

The type of leaderboard to retrieve, input as a string. Current options include exit_velocity_barrels, expected_statistics, pitch_arsenal, outs_above_average, directional_oaa, catch_probability, pop_time, sprint_speed, and running_splits_90_ft, arm_strength.

year

The season for which you want data.

abs

The minimum number of batted balls. Applies only to exit_velocity_barrels leaderboards.

min_pa

Minimum number of plate appearances. Can be a number or 'q' for qualified batters.

min_pitches

Minimum number of pitches thrown.

min_throws

Minimum number of throwing opportunities.

min_field

Minimum number of fieding opportunities.

min_run

Minimum number of running opportunities.

player_type

One of either 'batter' or pitcher. For the expected_statistics leaderboard, 'batter-team' and 'pitcher-team' are also available.

fielding_type

One of either 'player' or 'team'.

oaa_position

Can be either the number position of a player or 'if' or 'of' for position categories.

oaa_roles

Can be either the number position of a player or 'if' or 'of' for position categories.

team

An abbreviation for a team. Can be left blank.

arsenal_type

One of either 'n_', 'avg_spin', or 'avg_speed'.

run_type

One of either 'percent' or 'raw'.

min2b

The minimum number of throwing attempts to second base.

min3b

The minimum number of throwing attempts to third base.

position

The numeric position of the player. For DH use 10. Can be left blank.

bats

The handedness of the batter. One of 'R' or 'L'. Can be left blank.

hand

The handedness of the pitcher. One of 'R' or 'L'. Can be left blank.

Value

Returns a tibble of Statcast leaderboard data.


(legacy) Query Statcast by Date Range and Players

Description

(legacy) Query Statcast by Date Range and Players

Usage

scrape_statcast_savant(
  start_date = Sys.Date() - 1,
  end_date = Sys.Date(),
  playerid = NULL,
  player_type = "batter",
  ...
)

scrape_statcast_savant.Date(
  start_date = Sys.Date() - 1,
  end_date = Sys.Date(),
  playerid = NULL,
  player_type = "batter",
  ...
)

scrape_statcast_savant.default(
  start_date = Sys.Date() - 1,
  end_date = Sys.Date(),
  playerid = NULL,
  player_type = "batter",
  ...
)

scrape_statcast_savant_batter(start_date, end_date, batterid = NULL, ...)

scrape_statcast_savant_batter_all(start_date, end_date, batterid = NULL, ...)

scrape_statcast_savant_pitcher(start_date, end_date, pitcherid = NULL, ...)

scrape_statcast_savant_pitcher_all(start_date, end_date, pitcherid = NULL, ...)

Arguments

start_date

Date of first game for which you want data. Format must be in YYYY-MM-DD format.

end_date

Date of last game for which you want data. Format must be in YYYY-MM-DD format.

playerid

The MLBAM ID for the player whose data you want to query.

player_type

The player type. Can be batter or pitcher. Default is batter

...

currently ignored

batterid

The MLBAM ID for the batter whose data you want to query.

pitcherid

The MLBAM ID for the pitcher whose data you want to query.

Value

Returns a tibble with Statcast data.

Returns a tibble with Statcast data.

Returns a tibble with Statcast data.

Returns a tibble with Statcast data.

Returns a tibble with Statcast data.

Returns a tibble with Statcast data.

Returns a tibble with Statcast data.


Spotrac Endpoint Overview

Description

  • sptrc_team_active_payroll(): Scrape Team Active Payroll Breakdown from Spotrac.

  • sptrc_league_payrolls(): Scrape League Payroll Breakdowns from Spotrac.

Details

Spotrac

These functions retrieve team and league payroll breakdowns from Spotrac.


Scrape League Payroll Breakdowns from Spotrac

Description

This function allows you to scrape each team's payroll from Spotrac.

Usage

sptrc_league_payrolls(year = most_recent_mlb_season())

Arguments

year

Year to load

Value

A data frame of contract data.

col_name types description
year character Payroll season.
team character Full team name.
team_abbr character Team abbreviation.
rank numeric League rank by total payroll allocations.
record character Team win-loss record for the season.
avg_age_team character Roster-weighted average age of the team.
total_payroll_allocations numeric Total payroll allocations across all roster statuses (USD).
active_26_man numeric Payroll allocated to the active 26-man roster (USD).
injured numeric Payroll allocated to players on the injured list (USD).
retained numeric Retained salary owed to players no longer on the roster (USD).
buried numeric Payroll for players assigned to the minors ("buried" contracts) (USD).

Column names after rank mirror Spotrac's current league-payroll table and may change as Spotrac updates its layout.

Examples

try(sptrc_league_payrolls(year = most_recent_mlb_season()))

Scrape Team Active Payroll Breakdown from Spotrac

Description

This function allows you to scrape a team's active payroll from Spotrac.

Usage

sptrc_team_active_payroll(team_abbr, year = most_recent_mlb_season())

Arguments

team_abbr

Team abbreviation

year

Year to load

Value

A data frame of contract data.

col_name types description
year numeric Payroll season.
team character Team abbreviation supplied to the function.
player_name character Player name.
roster_status character Payroll table the row came from: Active, IL, or Retained Salary.
pos character Player position.
exp character Years of MLB service experience.
options_minor character Remaining minor-league option years.
status character Contract status (e.g. signed, arbitration, pre-arbitration).
payroll_salary numeric Salary counted against the team payroll (USD).
payroll_salary_adjusted numeric Payroll salary adjusted for prorated and retained amounts (USD).
base_salary numeric Player base salary for the season (USD).
signing_bonus numeric Signing bonus allocated to the season (USD).
waiver_options character Waiver and option flags reported by Spotrac.

Columns after roster_status mirror Spotrac's current payroll table and may change as Spotrac updates its layout.

Examples

try(sptrc_team_active_payroll(team_abbr = "BAL", year = most_recent_mlb_season()))

(legacy) Scrape MLB Standings on a Given Date

Description

(legacy) Scrape MLB Standings on a Given Date

Usage

standings_on_date_bref(date, division, from = FALSE)

Arguments

date

a date object

division

One or more of AL East, AL Central, AL West, AL Overall, NL East, NL Central, NL West, and NL Overall

from

a logical indicating whether you want standings up to and including the date (FALSE, default) or rather standings for games played after the date

Value

Returns a tibble of MLB standings


Statcast Functions Overview

Description

  • statcast_search(): Query Statcast by Date Range and Players.

  • statcast_search_batters(): Query Statcast Batters by Date Range and Player.

  • statcast_search_pitchers(): Query Statcast Pitchers by Date Range and Player.

  • statcast_leaderboards(): Query Baseball Savant Leaderboards.

Details

Query Statcast Batters by Date Range

statcast_search(start_date = "2016-04-06", 
                end_date = "2016-04-15", 
                player_type = 'batter')
                            
 ## The above is equivalent to:
statcast_search_batters(start_date = "2016-04-06", 
                        end_date = "2016-04-15", 
                        batterid = NULL)

Query Statcast Pitchers by Date Range

statcast_search(start_date = "2016-04-06", 
                end_date = "2016-04-15", 
                player_type = 'pitcher')
                            
 ## The above is equivalent to:
statcast_search_pitchers(start_date = "2016-04-06", 
                         end_date = "2016-04-15", 
                         pitcherid = NULL)

Query Statcast Batters by Date Range and Player ID

  correa <- statcast_search(start_date = "2016-04-06", 
                            end_date = "2016-04-15", 
                            playerid = 621043, 
                            player_type = 'batter')
                            
 ## The above is equivalent to:
  correa <- statcast_search_batters(start_date = "2016-04-06", 
                                    end_date = "2016-04-15", 
                                    batterid = 621043)

Query Statcast Pitchers by Date Range and Player ID

  noah <- statcast_search(start_date = "2016-04-06",
                          end_date = "2016-04-15", 
                          playerid = 592789, 
                          player_type = 'pitcher')
                          
 ## The above is equivalent to:
  noah <- statcast_search_pitchers(start_date = "2016-04-06", 
                                  end_date = "2016-04-15", 
                                  pitcherid = 592789)

Query Baseball Savant Leaderboards

  statcast_leaderboards(leaderboard = "exit_velocity_barrels", year = 2021)

Statcast Label Imputation

Description

Statcast Label Imputation

Usage

statcast_impute

Format

An object of class data.frame with 44 rows and 4 columns.


Query Baseball Savant Leaderboards

Description

This function allows you to read leaderboard data from BaseballSavant directly into R as data frame.

Usage

statcast_leaderboards(
  leaderboard = "exit_velocity_barrels",
  year = 2020,
  abs = 50,
  min_pa = "q",
  min_pitches = 100,
  min_throws = 100,
  min_field = "q",
  min_run = 0,
  player_type = "batter",
  fielding_type = "player",
  oaa_position = "",
  oaa_roles = "",
  team = "",
  arsenal_type = "n_",
  run_type = "raw",
  min2b = 5,
  min3b = 0,
  position = "",
  bats = "",
  hand = ""
)

Arguments

leaderboard

The type of leaderboard to retrieve, input as a string. Current options include exit_velocity_barrels, expected_statistics, pitch_arsenal, outs_above_average, directional_oaa, catch_probability, pop_time, sprint_speed, and running_splits_90_ft, arm_strength.

year

The season for which you want data.

abs

The minimum number of batted balls. Applies only to exit_velocity_barrels leaderboards.

min_pa

Minimum number of plate appearances. Can be a number or 'q' for qualified batters.

min_pitches

Minimum number of pitches thrown.

min_throws

Minimum number of throwing opportunities.

min_field

Minimum number of fieding opportunities.

min_run

Minimum number of running opportunities.

player_type

One of either 'batter' or pitcher. For the expected_statistics leaderboard, 'batter-team' and 'pitcher-team' are also available.

fielding_type

One of either 'player' or 'team'.

oaa_position

Can be either the number position of a player or 'if' or 'of' for position categories.

oaa_roles

Can be either the number position of a player or 'if' or 'of' for position categories.

team

An abbreviation for a team. Can be left blank.

arsenal_type

One of either 'n_', 'avg_spin', or 'avg_speed'.

run_type

One of either 'percent' or 'raw'.

min2b

The minimum number of throwing attempts to second base.

min3b

The minimum number of throwing attempts to third base.

position

The numeric position of the player. For DH use 10. Can be left blank.

bats

The handedness of the batter. One of 'R' or 'L'. Can be left blank.

hand

The handedness of the pitcher. One of 'R' or 'L'. Can be left blank.

Details

oaa_roles argument: 30 = 1B - Straight Up 31 = 1B - Towards 1B/2B Hole 32 = 1B - Close to Line 40 = 2B - Straight Up 41 = 2B - Shaded Towards 2B Bag 42 = 2B - Towards 1B/2B Hole 43 = 2B - Behind First Basemen 46 = 2B - Up the Middle 60 = SS - Straight Up 61 = SS - Towards 3B/SS Hole 62 = SS - Shaded Towards 2B Bag 64 = SS - Up the Middle 50 = 3B - Straight Up 51 = 3B - Close to Line 52 = 3B - Towards 3B/SS Hole 77 = LF - Close to Line 71 = LF - Leaning Left 70 = LF - Straight Up 72 = LF - Leaning Right 78 = LF - LF Gap 87 = CF - LF Gap 81 = CF - Leaning Left 82 = CF - Leaning Right 89 = CF - RF Gap 98 = RF - RF Gap 91 = RF - Leaning Left 90 = RF - Straight Up 92 = RF - Leaning Right 99 = RF - Close to Line

Value

Returns a tibble of Statcast leaderboard data with the following columns (for leaderboard: 'exit_velocity_barrels'):

col_name types description
year numeric Leaderboard season.
last_name, first_name character Player name as "Last, First".
player_id integer MLBAM player ID.
attempts integer Number of batted-ball events (attempts).
avg_hit_angle numeric Average launch angle on batted balls (degrees).
anglesweetspotpercent numeric Share of batted balls hit in the 8-32 degree sweet-spot range (percent).
max_hit_speed numeric Maximum exit velocity recorded (mph).
avg_hit_speed numeric Average exit velocity on batted balls (mph).
ev50 numeric Average of the top 50% of hardest-hit batted balls by exit velocity (mph).
fbld numeric Average exit velocity on fly balls and line drives (mph).
gb numeric Average exit velocity on ground balls (mph).
max_distance integer Maximum batted-ball distance (feet).
avg_distance integer Average batted-ball distance (feet).
avg_hr_distance integer Average home-run distance (feet).
ev95plus integer Number of batted balls hit at 95+ mph.
ev95percent numeric Share of batted balls hit at 95+ mph (percent).
barrels integer Number of barreled batted balls.
brl_percent numeric Barrels per batted-ball event (percent).
brl_pa numeric Barrels per plate appearance (percent).

Examples

try(statcast_leaderboards(leaderboard = "expected_statistics", year = 2018))
  try(statcast_leaderboards(leaderboard = "arm_strength", year = 2020))

Create stat lines from Statcast data

Description

This function allows you to create stat lines of statistics for players or groups of players from raw Statcast. When calculating wOBA, the most recent year in the data frame is used for weighting.

Usage

statline_from_statcast(df, base = "pa")

Arguments

df

A data frame of statistics that includes, at a minimum, the following columns: events, description, game_date, and type.

base

Tells the function what to use as the population of pitches to use for the stat line. Options include "swings", "contact", or "pa". Defaults to "pa".

Details

  statline_from_statcast(df, base = "contact")

Value

A tibble with the additional columns calculated using the Statcast data.


Column structure of MLB Stats Live Game API data frame

Description

An empty tibble

Usage

stats_api_live_empty_df

Format

An object of class tbl_df (inherits from tbl, data.frame) with 0 rows and 131 columns.


Calculate Team-level Consistency

Description

This function allows you to calculate team-level consistency in run scoring and run prevention over the course of an entire season.

Usage

team_consistency(year)

Arguments

year

Season consistency should be run for.

Details

  try(team_consistency(year=2021))

Value

Returns a tibble with the following columns

col_name types
Team character
Con_R numeric
Con_RA numeric
Con_R_Ptile numeric
Con_RA_Ptile numeric

(legacy) Scrape Team Results

Description

(legacy) Scrape Team Results

Usage

team_results_bref(Tm, year)

Arguments

Tm

The abbreviation used by Baseball-Reference.com for the team whose results you want to scrape.

year

Season for which you want to scrape the park factors.

Value

Returns a tibble of MLB team results


A Team Lookup Table

Description

A Team Lookup Table

Usage

teams_lu_table

Format

An object of class data.frame with 797 rows and 31 columns.


Calculate wOBA and related metrics for any set of data

Description

This function allows you to calculate wOBA for any given set of data, provided the right variables are in the data set. The function currently returns both wOBA per plate appearance on wOBA per instance of fair contact.

Usage

woba_plus(df)

Arguments

df

A data frame of statistics that includes, at a minimum, the following columns: uBB (unintentional walks), HBP (Hit By Pitch), X1B (singles), X2B (doubles), X3B (triples), HR (home runs), AB (at-bats), SH (sacrifice hits), SO (strike outs), and season.

Value

Returns a tibble with the wOBA factors calculated and the following columns:

col_name types
bbref_id character
season integer
Name character
Age numeric
Level character
Team character
G numeric
PA numeric
AB numeric
R numeric
H numeric
X1B numeric
X2B numeric
X3B numeric
HR numeric
RBI numeric
BB numeric
IBB numeric
uBB numeric
SO numeric
HBP numeric
SH numeric
SF numeric
GDP numeric
SB numeric
CS numeric
BA numeric
OBP numeric
SLG numeric
OPS numeric
wOBA numeric
wOBA_CON numeric

Examples

try({
   df <- bref_daily_batter("2015-08-01", "2015-10-03") 
   woba_plus(df)
 })