v1

latestOpenAPI 3.1.02026-07-136587849.3 KB
Queries / Statistics

Statistics by interval (moved to /statistics/interval)

This endpoint returns statistics calculated based on the data available for a specific time period. The data is aggregated according to the time interval specified in your request, allowing you to see trends and patterns over time.

<Note> Refer to the different statistics types in the [Statistics Types](/technical-references/statistics_matrix) section for more information on how the data is aggregated for each type. </Note>

Coordinated Universal Time

The /statistics/interval endpoint uses Coordinated Universal Time (UTC) for all its calculations. This standardization ensures that data is consistent and comparable across different time zones. By using UTC, the API provides a global view of the data, which is crucial for applications that require a uniform time reference. This approach contrasts with the /statistics/daily endpoint, which uses the user's local timezone for calculations, offering a more personalized view.

Selection of Provider Source

Within a single statistics interval there can be data aggregated from one provider source only.

get/queries/statistics

Query parameters

from_timestampstring date-time

Start time of the query range in UTC

Example:2006-01-02T15:04:05

Start time of the query range in UTC

to_timestampstring date-time

End time of the query range in UTC

Example:2006-01-02T15:04:05

End time of the query range in UTC

interval'fifteen_minute' | 'thirty_minute' | 'hour' | 'day' required

Interval of the query

Interval of the query

exclude_manualboolean

Exclude manual metrics from the statistics

Exclude manual metrics from the statistics

typesstring[] required
providersstring[]
include_record_idsboolean

Whether to include the record IDs in the response

Whether to include the record IDs in the response

device_typesstring[]

Device types to include in the statistics

Device types to include in the statistics

Response

OK

from_timestampstring date-time required
to_timestampstring date-time required

Example response

{
  "from_timestamp": "2006-01-02T00:00:00Z",
  "statistics": [
    {
      "from_timestamp": "2006-01-02T00:00:00Z",
      "record_ids": [
        "12345678-1234-abcd-4321-abcdef123456"
      ],
      "to_timestamp": "2006-01-02T00:00:00Z",
      "values": {
        "activity_score": 83,
        "calories_burned_active": 1020.0991,
        "calories_burned_basal": 2000.1242,
        "calories_burned_total": 3020.2233,
        "distance_cycling": 20091.0022,
        "distance_running": 12000.1014,
        "distance_total": 5880.7021,
        "distance_walking": 1200.7022,
        "duration_high_intensity": 1200000,
        "duration_low_intensity": 9000000,
        "duration_moderate_intensity": 2400000,
        "heartrate": 100,
        "heartrate_max": 120,
        "heartrate_min": 60,
        "heartrate_resting": 60,
        "hrv_rmssd": 45,
        "hrv_sdnn": 52,
        "recovery_score": 83,
        "sleep_duration_total": 3600000,
        "sleep_score": 70,
        "sleep_skin_temperature_deviation": -0.13,
        "steps": 10000,
        "stress_score": 70
      }
    }
  ],
  "to_timestamp": "2006-01-02T00:00:00Z"
}