Is there an API call I can use where I see which tournaments are running?
I know there's a TournamentsPlaying call, but there I need a name. Is there a way to not have to cycle through all the tournaments?
Also, TournamentsPlaying doesn't tell if latereg is still possible - or even better, how long until registration closes. Is this possible to add?
How to find running tournaments with API?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to find running tournaments with API?
Call TournamentsList and then loop through them and look at the Status field. For details like late registration, call TournamentsGet for a particular tournament and look at its particular settings like StartTime and LateRegMinutes, then compare that with the current time. That's not guaranteed to be exact because the late reg could end early if payouts start. If you want a real time notice about when the late registration ends, use the Tournament timer callback event.
Re: How to find running tournaments with API?
Any plans on adding a TournamentsRunning API call?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to find running tournaments with API?
No, it would be redundant with what's already available.
Re: How to find running tournaments with API?
Fair enough. Could you add number to TournamentsPlaying though? When TourneyStart fires, I can store the number in a file and when someone requests status, I can check with the number instead of the current cumbersome way. When it's finished I can just pop it out of the file.Kent Briggs wrote: ↑Sat Jan 07, 2023 8:45 pmNo, it would be redundant with what's already available.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to find running tournaments with API?
The tournaments are indexed internally by name (which the TourneyStart callback provides to you) so the TournamentsPlaying API needs the name, just like the other calls that deal with a particular tournament. TournamentsResults maintains a cache of results in memory which is the only reason it works with just a number.Grim wrote: ↑Sun Jan 08, 2023 12:31 pm Fair enough. Could you add number to TournamentsPlaying though? When TourneyStart fires, I can store the number in a file and when someone requests status, I can check with the number instead of the current cumbersome way. When it's finished I can just pop it out of the file.
Re: How to find running tournaments with API?
Yes, but when there's several of the same SNG played that night, wouldn't I get all of them when calling TournamentsPlaying?
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: How to find running tournaments with API?
TournamentsPlaying returns the current names of players for the specified named tournament. It's doesn't retrieve past data, just what is happening currently with that tournament. Past data is in the Tourney Results logs.
Re: How to find running tournaments with API?
Aha. Thanks again!