Aggregation API
Query a single user
Aggregation API
Aggregation Query DSL
Horizon AI Python SDK
Aggregation API
Query a single user
POST
/
aggregate
/
v1
/
user
/
{user_id}
/
query
x-vital-api-key
string
*
x-vital-api-key
Required
string
Vital Team API Key
accept
enum<string>
accept
enum<string>
user_id
string
*
user_id
Required
string
object
*
timeframe
Timeframe · object
*
timeframe
Required
object
type
enum<string>
*
type
Required
enum<string>
anchor
string
*
anchor
Required
string
past
object
*
past
Required
object
value
integer
value
integer
unit
enum<string>
*
unit
Required
enum<string>
queries
array
*
queries
Required
array
config
object
config
object
week_starts_on
enum<string>
week_starts_on
enum<string>
provider_priority_overrides
array
provider_priority_overrides
array
Aggregation API is currently in closed beta. The query schema and the behaviour is subject to change based on beta feedback.
JSON is the default output format. Each query instruction outputs one entry containing a dataframe to the $.results
array,
in the declaration order of the query instructions.
{
"results": [
"table": {
"index": [...],
"min": [...],
"max": [...],
"mean": [...],
"newest": [...]
}
]
}
Specify Accept: application/vnd.vital.tar+gzip+parquet
in your request header.
The response body is a gzipped Tarball of multiple Parquet files, namely 0.parquet
, 1.parquet
, 2.parquet
, etc.
The numbering corresponds to the declaration order of the query instructions.
Authorizations
Vital Team API Key
Headers
Available options:
*/*
, application/json
, application/vnd.vital.tar+gzip+parquet
Path Parameters
Body
application/json
Available options:
session_start
, session_end
, state
, type
, duration_second
, stage_asleep_second
, stage_awake_second
, stage_light_second
, stage_rem_second
, stage_deep_second
, stage_unknown_second
, latency_second
, heart_rate_minimum
, heart_rate_mean
, heart_rate_maximum
, heart_rate_dip
, efficiency
, hrv_mean_rmssd
, hrv_mean_sdnn
, skin_temperature_delta
, respiratory_rate
, score
, source_type
, source_provider
, source_app_id
Available options:
mean
, min
, max
, sum
, count
, median
, stddev
, oldest
, newest
Available options:
sunday
, monday
Available options:
oura
, fitbit
, garmin
, whoop
, strava
, renpho
, peloton
, wahoo
, zwift
, freestyle_libre
, abbott_libreview
, freestyle_libre_ble
, eight_sleep
, withings
, apple_health_kit
, manual
, ihealth
, google_fit
, beurer_api
, beurer_ble
, omron
, omron_ble
, onetouch_ble
, accuchek_ble
, contour_ble
, dexcom
, dexcom_v3
, hammerhead
, my_fitness_pal
, health_connect
, polar
, cronometer
, kardia
, whoop_v2
, ultrahuman
, my_fitness_pal_v2
, map_my_fitness