Skip to main content
GET
/
queries
/
statistics
/
interval
Interval Statistics
curl --request GET \
  --url https://app-api.spikeapi.com/v3/queries/statistics/interval \
  --header 'Authorization: Bearer <token>'
{
  "statistics": [
    {
      "values": {
        "activity_score": 123,
        "calories_burned_active": 123,
        "calories_burned_basal": 123,
        "calories_burned_total": 123,
        "distance_cycling": 123,
        "distance_running": 123,
        "distance_total": 123,
        "distance_walking": 123,
        "heartrate": 123,
        "heartrate_max": 123,
        "heartrate_min": 123,
        "heartrate_resting": 123,
        "hrv_rmssd": 123,
        "hrv_sdnn": 123,
        "recovery_score": 123,
        "sleep_duration_total": 123,
        "sleep_score": 123,
        "sleep_skin_temperature_deviation": 123,
        "steps": 123,
        "stress_score": 123
      },
      "from_timestamp": "2023-11-07T05:31:56Z",
      "record_ids": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "to_timestamp": "2023-11-07T05:31:56Z"
    }
  ],
  "from_timestamp": "2023-11-07T05:31:56Z",
  "to_timestamp": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

from_timestamp
string<date-time>

Start time of the query range in UTC, inclusive

to_timestamp
string<date-time>

End time of the query range in UTC, non-inclusive

interval
enum<string>
required

Interval of the query

Available options:
1h
exclude_manual
boolean
default:false

Exclude manual metrics from the statistics

types
enum<string>[]
required
Minimum array length: 1
Available options:
steps,
distance_total,
distance_walking,
distance_cycling,
distance_running,
calories_burned_basal,
calories_burned_active,
calories_burned_total,
heartrate,
heartrate_max,
heartrate_min,
heartrate_resting,
sleep_skin_temperature_deviation,
hrv_rmssd,
hrv_sdnn
providers
enum<string>[]
Available options:
strava,
health_connect,
fitbit,
garmin,
huawei,
dexcom,
whoop,
withings,
suunto,
apple,
freestyle_libre,
oura,
polar,
coros,
ultrahuman,
samsung_health_data,
luna
include_record_ids
boolean
default:false

Whether to include the record IDs in the response

device_types
enum<string>[]

Device types to include in the statistics

Available options:
unknown,
phone,
watch,
scale,
ring,
head_mounted,
fitness_band,
chest_strap,
smart_display,
accessory

Response

OK

statistics
object[] | null
required
from_timestamp
string<date-time>
to_timestamp
string<date-time>