mlb_batting_orders: *Retrieve batting orders for a given MLB game*

mlb_batting_ordersR Documentation

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))


baseballr documentation built on Aug. 27, 2026, 1:07 a.m.