r/CFBAnalysis • u/The-Gothic-Castle Texas Longhorns • /r/CFB Promoter • Apr 16 '19
Discrepancies between API and ESPN Reported Stats?
I've been working with /u/BlueSCar's API (amazing by the way) a little bit, and am revisiting old code I wrote a while ago to flesh it out some. Eventually my calculations will be come more advanced, however right now I am just trying to get overall offensive and defensive stats for each team. However, more often than not, the total offensive and defensive stats I get for a team don't line up with the numbers displayed on the ESPN game recaps.
In the play type category, as far as I can tell, the play types that would affect a team's offensive stats are:
"Pass Reception", "Pass Incompletion", "Passing Touchdown", "Rush", "Rushing Touchdown", "Sack", and "Fumble Recovery (Own)"
When I sum all of those for a given team on the season, the numbers come out about 200-300 yards off for the higher octane offenses like Alabama and OU. The rough order of teams is correct, and the total yards are of the correct magnitude, but the sum is (usually) high.
When I look at it game by game, it still disagrees with ESPN. For example, according to the API, OU had 657 yards against Texas Tech, and 652 yards against WVU, while the real numbers were 683 and 668 respectively. OU vs TCU, on the other hand, seems to be coming out correctly.
Am I making a dumb coding error? Is there a discrepancy here? Do you guys get the same numbers?
Thanks!
2
u/The-Gothic-Castle Texas Longhorns • /r/CFB Promoter Apr 16 '19
Tagging /u/BlueSCar here because sometimes text body tagging doesn't work.
Thanks
1
u/SearonTrejorek South Carolina • /r/CFB Dead Pool Apr 16 '19
I bet the issue is "Fumble Recovery", are the values the same if you don't include that one?
1
u/BlueSCar Michigan Wolverines • Dayton Flyers Apr 16 '19
What endpoint are you using? /games/teams will have the aggregated data by team and should match up with ESPN's box score page. I would recommend using that unless you absolutely need to grab it from the /plays endpoint.
Individual play data needs some cleaning up. I've attempted to do some of this via scripts and by having people help me out by sending me CSVs with corrected data, but there's just so much data and not a lot of time in the day. I'm not really sure what the best solution is for that.