jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.25k stars 333 forks source link

pitching_stats returns 500 error #315

Closed ian-shepherd closed 1 year ago

ian-shepherd commented 1 year ago

from pybaseball import pitching_stats data = pitching_stats(2021)

returns this error

raise requests.exceptions.HTTPError( requests.exceptions.HTTPError: Error accessing 'https://www.fangraphs.com/leaders.aspx'. Received status code 500

bryanpeabody commented 1 year ago

I figured out what was wrong with this. It's the age parameter. The code is sending &age=0,100. The only value that works currently on the FG site is age=0. Anything else results in a 500 error. I've reached out on the Discord channel with more details and asked about how we should proceed since this is a FanGraphs issue.

bryanpeabody commented 1 year ago

Also sent an email to Fangraphs support to let them know about their issue.

bryanpeabody commented 1 year ago

Fixed and PR created: https://github.com/jldbc/pybaseball/pull/317

tjburch commented 1 year ago

Thanks for the incredible detective work and for reaching out to FG, @bryanpeabody. Closing.