baseballr icon indicating copy to clipboard operation
baseballr copied to clipboard

fg_batter_game_logs no longer working

Open bjohara1 opened this issue 1 year ago • 6 comments

The function fg_batter_game_logs is no longer working. Example:

fg_batter_game_logs(playerid = 15640, year = 2023) Error in curl::curl_fetch_memory(url, handle = handle): Could not resolve host: cdn.fangraphs.com Request failed [ERROR]. Retrying in 1.5 seconds... Error in curl::curl_fetch_memory(url, handle = handle): Could not resolve host: cdn.fangraphs.com Request failed [ERROR]. Retrying in 1 seconds... 2023-09-22 06:58:17: Invalid arguments or no batter game logs data available! Error in fg_batter_game_logs(playerid = 15640, year = 2023) : object 'payload' not found

bjohara1 avatar Sep 22 '23 10:09 bjohara1

Same problem with fg_pitcher_game_logs. Trying to use this data for a project so would really appreciate if someone were able to fix this!

cartergunning avatar Oct 03 '23 17:10 cartergunning

Here's a temporary solution for y'all: MLB Game Logs in R! https://youtu.be/2WcYK_TFDHE

robert-frey avatar Oct 03 '23 17:10 robert-frey

Thank you! This was helpful! Quick follow up. If I wanted to use this temporary solution and get all the game logs of players that have played up until the 2023 season in one single dataset how would I go about doing that?!

cartergunning avatar Oct 21 '23 20:10 cartergunning

So is this something that will be fixed before the season starts? I am hoping to use these stats that are specific from Fangraphs

Coop197823 avatar Feb 23 '24 00:02 Coop197823

fangraphs migrated from all cdn.fangraphs.com/api/ endpoints to http://www.fangraphs.com/api/. The underlying endpoint for the fg_xxx_game_logs functions need to be updated.

a-meyers avatar Feb 24 '24 06:02 a-meyers

Yeah, I already resolved this. Update your package

install.packages("baseballr")

saiemgilani avatar Feb 24 '24 06:02 saiemgilani