Examples

All queries should use POST to return a calculated index. Using the index endpoint Index is the most straight forward way to calculate your index. This will give you a calculation based on the query that you provide. By default you may POST an empty body and it will calculate the index based on all temperatures available within the default date range (today and 90 days behind).

Using query filters

Using query filters you may filter the calculation to only include temperatures based on the filters that you provide. You may use multiple filters in the same query and each filter will be applied on the result set before calculating the index. This query example will filter for a specific group (4a06e2e2-e29a-405c-8601-2b31e889b382):

{
    "start": "2022-01-01",
    "end": "2022-01-31",
    "filters": [
        {
            "filter": "Group",
            "values": ["4a06e2e2-e29a-405c-8601-2b31e889b382"]
        }
    ]
}

Using multiple query filters

When using multiple filters, each separate filter will be applied using the AND operator and for each value in the separate filters the OR operator will be applied. The following example will include all temperatures where a Male gender has responded AND the respondent has an age between 0-17 OR 35-44.

{
    "start": "2022-01-01",
    "end": "2022-01-31",
    "filters": [
        {
            "filter": "Gender",
            "values": ["Male"]
        },
        {
            "filter": "AgeDistribution",
            "values": ["0 - 17","35 - 44"]
        }
    ]
}