Skip to main content

How It Works - Last 5/10 Minutes

ยท 2 min read
Nick Eggleton

GET Endpointsโ€‹

The match stat GET endpoints now provides a new filter parameter called "lastXSeconds". This parameters filters the stats so they only count transactions that occurred on or within the last 'X' seconds of the match.

If used on a live match and called periodically, the stats will go up and down based on what's happened in the last number of seconds. As it is a 'seconds' filter, enter 300 to filter the last 5 minutes, 600 for last 10.

From and To Period Secondsโ€‹

Two more parameters have been added to the endpoints alongside lastXSeconds: fromPeriodSeconds and toPeriodSeconds.

These can be used to filter statistics to a particular range of time within a quarter. They can be used independently of each other, where they will run from the start/end of the quarter, or together to focus on a mid-quarter window.

note

These parameters aren't used in Last 5/10 Minutes filtering, and described here for completeness. Also note that you cannot use all three parameters at the same time - the API will return an error message stating this is the case.

POST Endpointsโ€‹

The match stat POST endpoints also support these parameters, they can be supplied in each metic request, and in different combinations in each request. They perform the same filtering as they do for the GET Endpoints.

R Package Support

The R package's getPlayerStats and getSquadStats function also include 'lastXSeconds' parameters to be used in the same fashion as calling the API endpoints directly. It too supports using the parameters in the getPlayerStatsPOST and getSquadStatsPOST endpoints. See here for more details.