Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to track live events? #13

Open
dvdrplus opened this issue Feb 21, 2024 · 3 comments
Open

Best way to track live events? #13

dvdrplus opened this issue Feb 21, 2024 · 3 comments

Comments

@dvdrplus
Copy link

First off, fantastic job on documentation, what a blessing.

I would like to track live events while they happen in all games occuring that night.

The old API, I used:

https://statsapi.web.nhl.com/api/v1/game/game_Id/feed/live/diffPatch?startTimecode=

which allowed me to periodically check up on a games play by play, only from the last published startTimecode, i.e. not pull the full play-by-play everytime I wanted to update.

Anyone have any recommendations or ideas on the best practice to track live game data with the new API?

For example, if a team scores, or a player gets a shot, I want to know in "real time".

I'll play around more and update if something comes up

@dvdrplus
Copy link
Author

Update** - from probing the NHL.com website (play-by-play tab) for a game, it looks like the website itself simply periodically calls the https://api-web.nhle.com/v1/gamecenter/2023020883/play-by-play endpoint.

If it is good enough for them, it is good enough for me. Will leave temporarily open, incase any others have better ideas

@minter
Copy link

minter commented Mar 1, 2024

@dvdrplus That's what I'm doing in my code - polling the full PBP every 30 seconds or so, and keeping track of which events I've seen on my end. No issues as of yet.

@Zmalski
Copy link
Owner

Zmalski commented Mar 5, 2024

Thanks for updating with your solution @dvdrplus, very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants