Funnels Endpoint
The Statistics API now contains the ability to perform funnel analysis. Much like the example in the Data Explorer Funnels this allows a broader range of analysis to be completed with queries that would previously have taken some level of scripting to solve which can now be answered directly.
The significant advantage to using the API over the data explorer is that the with_actors property is available whereby you may list athletes matching the selected funnel steps.
Continuing on with the example of WTS wins over both Standard and Sprint distance a POST request to /statistics/funnel with a body as below and a 'Content-Type' header of application/json will yield the result.
{
"steps": [
{
"with_actors": "false",
"actor_property": "athlete.name",
"filters": "position,eq,1|athlete.gender,eq,male|format,eq,Standard",
"timeframe": "this_8_years",
"optional": false,
"inverted": false,
"collection": "results"
},
{
"with_actors": "true",
"actor_property": "athlete.name",
"filters": "position,eq,1|athlete.gender,eq,male|format,eq,Sprint",
"timeframe": "this_8_years",
"optional": false,
"inverted": false,
"collection": "results"
}
]
}
The result being that whilst 11 athletes have won a standard distance race only 3 of those have also won a Sprint distance race (namely both Brownlees and Mario Mola).
{
"code": 200,
"status": "success",
"data": {
"steps": [
{
"with_actors": false,
"actor_property": "athlete.name",
"filters": [
{
"operator": "eq",
"property_name": "position",
"property_value": 1
},
{
"operator": "eq",
"property_name": "athlete.gender",
"property_value": "male"
},
{
"operator": "eq",
"property_name": "format",
"property_value": "Standard"
}
],
"timeframe": "this_8_years",
"timezone": null,
"event_collection": "results",
"optional": false,
"inverted": false
},
{
"with_actors": true,
"actor_property": "athlete.name",
"filters": [
{
"operator": "eq",
"property_name": "position",
"property_value": 1
},
{
"operator": "eq",
"property_name": "athlete.gender",
"property_value": "male"
},
{
"operator": "eq",
"property_name": "format",
"property_value": "Sprint"
}
],
"timeframe": "this_8_years",
"timezone": null,
"event_collection": "results",
"optional": false,
"inverted": false
}
],
"actors": [
null,
[
"Alistair Brownlee",
"Jonathan Brownlee",
"Mario Mola"
]
],
"result": [
11,
3
]
}
}
Changelog
- added: Funnels Endpoint at /statistics/funnels
- added: