Skip to contents

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_nametypes
venue_idinteger
venue_namecharacter
venue_linkcharacter
activelogical
seasonlogical

Examples

# \donttest{
  try(mlb_venues())
#> ── MLB Venues data from MLB.com ───────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:53 UTC
#> # A tibble: 1,007 × 5
#>    venue_id venue_name                        venue_link   active season
#>       <int> <chr>                             <chr>        <lgl>  <chr> 
#>  1     5515 Colorado Convention Center        /api/v1/ven… TRUE   2024  
#>  2     5520 Virginia Credit Union Stadium     /api/v1/ven… TRUE   2024  
#>  3     5525 ABC Supply Stadium                /api/v1/ven… TRUE   2024  
#>  4     4009 Miyagi Baseball Stadium           /api/v1/ven… FALSE  2024  
#>  5     4010 Tsuruoka Dream Stadium            /api/v1/ven… FALSE  2024  
#>  6     4011 Meiji Jingu Stadium               /api/v1/ven… FALSE  2024  
#>  7     3670 Madonna Stadium                   /api/v1/ven… FALSE  2024  
#>  8     3090 Fukuoka Dome                      /api/v1/ven… FALSE  2024  
#>  9     5530 Chiba Marine Stadium              /api/v1/ven… FALSE  2024  
#> 10     5531 Kobe Sports Park Baseball Stadium /api/v1/ven… FALSE  2024  
#> # ℹ 997 more rows
  try(mlb_venues(venue_ids = 4781))
#> ── MLB Venues data from MLB.com ───────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:53 UTC
#> # A tibble: 1 × 5
#>   venue_id venue_name venue_link          active season
#>      <int> <chr>      <chr>               <lgl>  <chr> 
#> 1     4781 Bush Field /api/v1/venues/4781 FALSE  1995  
  try(mlb_venues(sport_ids = 1))
#> ── MLB Venues data from MLB.com ───────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:54 UTC
#> # A tibble: 62 × 5
#>    venue_id venue_name                     venue_link      active season
#>       <int> <chr>                          <chr>           <lgl>  <chr> 
#>  1     3329 Arvest Ballpark                /api/v1/venues… TRUE   2024  
#>  2        1 Angel Stadium                  /api/v1/venues… TRUE   2024  
#>  3        2 Oriole Park at Camden Yards    /api/v1/venues… TRUE   2024  
#>  4        3 Fenway Park                    /api/v1/venues… TRUE   2024  
#>  5     5380 CoolToday Park                 /api/v1/venues… TRUE   2024  
#>  6        4 Guaranteed Rate Field          /api/v1/venues… TRUE   2024  
#>  7     5381 London Stadium                 /api/v1/venues… TRUE   2024  
#>  8        5 Progressive Field              /api/v1/venues… TRUE   2024  
#>  9        7 Kauffman Stadium               /api/v1/venues… TRUE   2024  
#> 10     5000 CACTI Park of the Palm Beaches /api/v1/venues… TRUE   2024  
#> # ℹ 52 more rows
# }