dword4 / nhlapi

Documenting the publicly accessible portions of the NHL API
448 stars 56 forks source link

Last Ten Games #4

Closed ggoncalves closed 6 years ago

ggoncalves commented 6 years ago

This is not an issue.

I'm willing to retrieve the last ten games to populate the standings view accordantly.

My main goal is to produce a personal standings view so I can see the wildCard with Leaders but using "Point Percentage" order. I personally believe that there is much more sense to see the wildcard standings ordering by point percentage instead of just points.

However, last ten games is so important that I cant start this king of job without this stats.

Does anyone know where can I find it?

leaffan commented 6 years ago

Hej, similar to other items there exist expand modifiers for standings, too. I've found that if you add expand=standings.record to one of the URLs retrieving standings, all the team data is additionally accompanied by a sub dictionary (pardon my Python parlance) with the keys divisionRecords, overallRecords, and conferenceRecords. The first and last entries contain - naturally - the records of the given team against others from the respective divisions and conference. The one with the key overallRecords includes among home, away and shootout records exactly what you're looking for:

overallRecords |  
-- | --
0 | {…}
1 | {…}
2 | {…}
3 |  
wins | 6
losses | 3
ot | 1
type | "lastTen"

Hope that helps you. Regards, Markus