Error accessing 'https://www.fangraphs.com/leaders-legacy.aspx'. Received status code 403
I am receiving the following error when I try to use the team_batting, team_pitching and team_fielding functions within pybaseball - does anyone know how to fix this?
Error accessing 'https://www.fangraphs.com/leaders-legacy.aspx'. Received status code 403
I get the same error when trying to use pitching_stats.
The pitching_stats and team_batting calls have been working for me over the last few weeks that I've used them, up until last night, but as of this morning, and still this afternoon, I'm getting the same 403 as above.
Im getting the same 403 issue. I looked into just trying to hit their API directly from a python script (not using pybaseball) and I get the 403.
I think the issue is that they added cloudfare verification around their API for "Verifying you are human"
I was getting a 403 yesterday with my own Fangraphs stuff, as well as pitching_stats(), and now neither gets an error. pitching_stats is returning an empty df if called today, but that's a separate issue lol
I created a PR for changing the legacy page to current API. Maybe this will fix this issue. Not sure is there any restriction for the API though
https://github.com/jldbc/pybaseball/pull/398
Trying to use either pitching_stats or batting_stats and getting "HTTPError: Error accessing 'https://www.fangraphs.com/leaders-legacy.aspx'. Received status code 403" as well. Does anyone know how to solve this? Tried #398 but didn't work
In my sample size of one month, this error has seemed transient. It worked for me today, fwiw.
Idk whether this issue is because of the cloudflare they recently added or it's just an intermittent issue? Anybody knows the approach to solve it? or yeah, i probably need to change the source hahahaha
issue seems to be intermittent to me.