Interval Statistics
curl --request GET \
  --url https://app-api.spikeapi.com/v3/queries/statistics/interval \
  --header 'Authorization: Bearer <token>'
{
  "from_timestamp": "2006-01-02T00:00:00Z",
  "statistics": [
    {
      "from_timestamp": "2006-01-02T00:00:00Z",
      "record_ids": [
        "6921cac9-6140-4c42-a024-a9ceed9c5f9b"
      ],
      "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,
        "heartrate": 100,
        "heartrate_max": 120,
        "heartrate_min": 60,
        "heartrate_resting": 60,
        "recovery_score": 83,
        "sleep_duration_total": 3600000,
        "sleep_score": 70,
        "steps": 10000,
        "stress_score": 70
      }
    }
  ],
  "to_timestamp": "2006-01-02T00:00:00Z"
}

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

Examples:

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

"2006-01-02T15:04:05Z"

to_timestamp
string<date-time>

End time of the query range in UTC

Examples:

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

"2006-01-02T15:04:05Z"

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 length: 1
providers
enum<string>[]
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

Response

200
application/json

OK

The response is of type object.