issues
search
jldbc
/
pybaseball
Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.18k
stars
321
forks
source link
Implement new FanGraphs Leaderboard API
#398
Open
ss77995ss
opened
5 months ago
ss77995ss
commented
5 months ago
Description
FanGraphs update their leaderboard page in 2023. Therefore the old data scraping does not work. Currently, we use their legacy url
https://www.fangraphs.com/leaders-legacy.aspx
now. But the legacy one might not update after 2023.
ref:
https://blogs.fangraphs.com/weve-updated-our-major-league-leaderboards-interface/
related issue:
https://github.com/jldbc/pybaseball/issues/376
To use latest leaderboard, apply fangraph's leaderboard api to get the data
url:
link
commit:
https://github.com/jldbc/pybaseball/commit/0f39311b63df54c50eac0d1e2eed16cdd9b73c56
Add a
legacy
flag to remain obtaining data from legacy leaderboard. Also add a notification in document
commit:
https://github.com/jldbc/pybaseball/commit/7205275fdf4a53abcf70df186a4930625c3014e5
,
https://github.com/jldbc/pybaseball/commit/ec9e2bc4c5cc84749f30904ec33df0b042817084
Need Discussions
Currently all the params seem to work but I am not check completely. Might need more testing.
Test will not pass since the response data is different between legacy and latest leaderboard. Need some help for the testing data
Look like issue:
https://github.com/jldbc/pybaseball/issues/396
can also be fixed if we use fangraphs api
link
TODO
[ ] Fix testing
[ ] Delete demo commit
Description
legacy
flag to remain obtaining data from legacy leaderboard. Also add a notification in documentNeed Discussions
TODO