Funnel

The Funnel endpoint allows funnel type queries to be performed against the Statistics API.

You should send data as a JSON string in the POST body with an accompanying 'Content-Type' header of application/json. The steps parameter is required and is a list of all steps to be included in the funnel analysis.

The returned result object contains an array of the number of matching results that meet the filter criteria.

If the with_actors property is specified a list of matching actors is returned so in the above example you can see Alistair Brownlee, Mario Mola and Jonathan Brownlee are the athletes meeting all conditions.

The steps parameter must contain an array of step objects as outlined below which should be sent in the body of the request. You may have as many steps in the analysis as you desire.

{
    "steps": [
	    {
		    "with_actors": "false",
		    "actor_property": "athlete.name",
		    "filters": "position,eq,1|athlete.gender,eq,male|format,eq,Standard",
		    "timeframe": "this_7_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_7_years",
		    "optional": false,
		    "inverted": false,
        "collection": "results"
		}
	]
}

Step Parameters

Each step accepts the following parameters:

  • with_actors - A boolean value that instructs the funnel to return a list of actor_property values for this step (defaults to false)
  • actor_property - (required) Specifies the name of the property to use as a unique identifier (defaults to athlete.id)
  • filters - A pipe delimited list of filters to be applied to the step
  • timeframe - A timeframe to perform the analysis (defaults to this_100_years)
  • collection - A collection to perform the analysis on (defaults to results)
  • optional - A boolean value that instructs the funnel to ignore the effects of this step on subsequent steps (defaults to false)
  • inverted - A boolean value that excludes events matching this step (defaults to false)

📘

The first step of a funnel can be neither inverted nor made optional

Language
Authorization
Header
Click Try It! to start a request and see the response here!