Statistics
curl --request GET \
  --url https://app-api.spikeapi.com/v3/queries/statistics \
  --header 'Authorization: Bearer <token>'
{
  "from_timestamp": "2006-01-02T00:00:00Z",
  "statistics": [
    {
      "from_timestamp": "2006-01-02T00:00:00Z",
      "record_ids": [
        "2544b484-ea7d-4b0a-85f2-3523342bca89"
      ],
      "to_timestamp": "2006-01-02T00:00:00Z",
      "values": {
        "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,
        "sleep_duration_total": 3600000,
        "sleep_score": 70,
        "steps": 10000
      }
    }
  ],
  "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"

exclude_manual
boolean
default:false

Exclude manual metrics from the statistics

interval
enum<string>
required

Interval windows to aggregate data

Available options:
fifteen_minute,
thirty_minute,
hour,
day
types
enum<string>[]
required
providers
enum<string>[]
include_record_ids
boolean
default:true

Whether to include the record IDs in the response

Response

200
application/json

OK

The response is of type object.