Inaccurate Scores on a live game appears to be missing Goals array
ChrisArchitect opened this issue ยท 4 comments
heya,
just happened to look at this during a live game and see this data:
{"date":{"raw":"2020-08-09","pretty":"Sun Aug 9"},"games":[{"status":{"state":"FINAL"},"startTime":"2020-08-09T16:00:00Z","goals":[{"team":"WSH","period":"1","scorer":{"player":"T.J. Oshie","seasonTotal":1},"assists":[],"min":19,"sec":44},{"team":"WSH","period":"3","scorer":{"player":"Tom Wilson","seasonTotal":1},"assists":[{"player":"Ilya Kovalchuk","seasonTotal":1},{"player":"Michal Kempny","seasonTotal":1}],"min":2,"sec":49},{"team":"BOS","period":"3","scorer":{"player":"Jake DeBrusk","seasonTotal":1},"assists":[{"player":"Ondrej Kase","seasonTotal":1},{"player":"David Krejci","seasonTotal":1}],"min":10,"sec":30}],"scores":{"BOS":1,"WSH":2},"teams":{"away":{"abbreviation":"BOS","id":6},"home":{"abbreviation":"WSH","id":15}},"preGameStats":{"records":{"WSH":{"wins":0,"losses":1,"ot":1},"BOS":{"wins":0,"losses":2,"ot":0}},"standings":{"BOS":{"conferenceRank":"1","leagueRank":"1"},"WSH":{"conferenceRank":"3","leagueRank":"5"}}},"currentStats":{"records":{"BOS":{"wins":0,"losses":3,"ot":0},"WSH":{"wins":1,"losses":1,"ot":1}},"streaks":{"BOS":{"type":"WINS","count":1},"WSH":{"type":"OT","count":1}},"standings":{"BOS":{"conferenceRank":"1","leagueRank":"1"},"WSH":{"conferenceRank":"3","leagueRank":"5"}}}},{"status":{"state":"LIVE","progress":{"currentPeriod":1,"currentPeriodOrdinal":"1st","currentPeriodTimeRemaining":{"min":0,"sec":0,"pretty":"END"}}},"startTime":"2020-08-09T19:00:00Z","goals":[],"scores":{"DAL":0,"STL":0},"teams":{"away":{"abbreviation":"DAL","id":25},"home":{"abbreviation":"STL","id":19}},"preGameStats":{"records":{"DAL":{"wins":0,"losses":2,"ot":0},"STL":{"wins":0,"losses":2,"ot":0}},"standings":{"DAL":{"conferenceRank":"4","leagueRank":"10"},"STL":{"conferenceRank":"1","leagueRank":"2"}}},"currentStats":{"records":{"DAL":{"wins":0,"losses":2,"ot":0},"STL":{"wins":0,"losses":2,"ot":0}},"streaks":{"DAL":{"type":"LOSSES","count":3},"STL":{"type":"WINS","count":1}},"standings":{"DAL":{"conferenceRank":"4","leagueRank":"10"},"STL":{"conferenceRank":"1","leagueRank":"2"}}}},{"status":{"state":"PREVIEW"},"startTime":"2020-08-10T00:00:00Z","goals":[],"scores":{"CBJ":0,"TOR":0},"teams":{"away":{"abbreviation":"CBJ","id":29},"home":{"abbreviation":"TOR","id":10}},"preGameStats":{"records":{"CBJ":{"wins":2,"losses":2,"ot":0},"TOR":{"wins":2,"losses":2,"ot":0}},"standings":{"CBJ":{"conferenceRank":"9","leagueRank":"14"},"TOR":{"conferenceRank":"8","leagueRank":"13"}},"playoffSeries":{"round":0,"wins":{"CBJ":2,"TOR":2}}},"currentStats":{"records":{"CBJ":{"wins":2,"losses":2,"ot":0},"TOR":{"wins":2,"losses":2,"ot":0}},"standings":{"CBJ":{"conferenceRank":"9","leagueRank":"14"},"TOR":{"conferenceRank":"8","leagueRank":"13"}},"playoffSeries":{"round":0,"wins":{"CBJ":2,"TOR":2}}}}]}
looking at the STL-DAL game, currently live, end of 1st period. The goals array is [] blank. More importantly, the scores shows 0-0 but in fact, the score is 1-0.
See NHL stats api linescore data pulled at same time:
{ "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. ยฉ NHL 2020. All Rights Reserved.", "currentPeriod" : 1, "currentPeriodOrdinal" : "1st", "currentPeriodTimeRemaining" : "END", "periods" : [ { "periodType" : "REGULAR", "num" : 1, "ordinalNum" : "1st", "home" : { "goals" : 1, "shotsOnGoal" : 0, "rinkSide" : "left" }, "away" : { "goals" : 0, "shotsOnGoal" : 0, "rinkSide" : "right" } } ], "shootoutInfo" : { "away" : { "scores" : 0, "attempts" : 0 }, "home" : { "scores" : 0, "attempts" : 0 } }, "teams" : { "home" : { "team" : { "id" : 19, "name" : "St. Louis Blues", "link" : "/api/v1/teams/19" }, "goals" : 1, "shotsOnGoal" : 0, "goaliePulled" : false, "numSkaters" : 0, "powerPlay" : false }, "away" : { "team" : { "id" : 25, "name" : "Dallas Stars", "link" : "/api/v1/teams/25" }, "goals" : 0, "shotsOnGoal" : 0, "goaliePulled" : false, "numSkaters" : 0, "powerPlay" : false } }, "powerPlayStrength" : "Even", "hasShootout" : false, "intermissionInfo" : { "intermissionTimeRemaining" : 0, "intermissionTimeElapsed" : 0, "inIntermission" : false } }
is this a bug? any idea? Just expecting accurate scores data from otherwise well done little api :)
There's some hiccup in the NHL Stats API, the game's scoringPlays
array is currently empty, that's where I pull the goal data from and calculate the scores based on that. I could read the scores from linescore
too, just haven't noticed a need yet. ๐ That would make the scores inconsistent with the goals in these kinds of situation, but more accurate, which is more important. ๐
I've occasionally seen other kinds of temporary issues in the data (a couple days ago one round-robin game's shootout goals were initially reported as second overtime period goals, also on the NHL site), so you might run into other surprises too. ๐
ha, wacky.
Yeah wasn't suggesting using linescore just happened to be what I looked at to compare.
Are discrepancies common like that? It's unfortunate if the data source may not be reliable.
That game went to a shootout because round robin is reg. season rules and confused me looking at the data...period 4 said minutes left 'END' but had no result....heh
Thanks for the reply ๐
Now that you mentioned this one, I remember seeing it a couple times before, but it's hard to say how often these things happen as they seem to be fixed quite quickly and I'm not usually checking the games while they are live due to the time difference here in Finland. Last week I noticed a wrong goal being reported as a powerplay goal in one of the games I was watching (but it was later fixed), and sometimes empty net goals have not been reported as such.
Thanks for reporting this, I will make a change anyway and get the scores from linescore
so that it's possible to detect if the goal info is missing. ๐
I made the change to read the scores from the teams
field, that turned out to be the most straightforward.