curl --request GET \
--url https://api.example.com/api/v1/users/{user_id}/timeseries \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/users/{user_id}/timeseries"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/users/{user_id}/timeseries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/users/{user_id}/timeseries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/users/{user_id}/timeseries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/users/{user_id}/timeseries")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/users/{user_id}/timeseries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"timestamp": "2023-11-07T05:31:56Z",
"type": "heart_rate",
"value": 123,
"unit": "<string>",
"zone_offset": "+01:00",
"source": {
"provider": "apple",
"device_name": "<string>",
"source": "Connect",
"device": "iPhone15,2",
"device_type": "phone",
"device_id": "R9ZW30ABC12"
},
"is_daily_total": true,
"window_seconds": 123,
"period_end": "2023-11-07T05:31:56Z",
"computed_by": "provider",
"stats": {
"count": 123,
"avg": 123,
"min": 123,
"max": 123,
"sum": 123,
"last": 123
}
}
],
"pagination": {
"has_more": true,
"next_cursor": "eyJpZCI6IjEyMzQ1Njc4OTAiLCJ0cyI6MTcwNDA2NzIwMH0",
"previous_cursor": "<string>",
"total_count": 150
},
"metadata": {
"resolution": "raw",
"sample_count": 123,
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
}{
"code": "VALIDATION_ERROR",
"detail": "body.email: value is not a valid email address: An email address must have an @-sign. (and 1 more)",
"errors": [
{
"loc": [
"body",
"email"
],
"msg": "value is not a valid email address: An email address must have an @-sign.",
"type": "value_error"
},
{
"loc": [
"body",
"first_name"
],
"msg": "String should have at most 100 characters",
"type": "string_too_long"
}
],
"status": 422,
"title": "Unprocessable Content"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}Get Timeseries
Returns granular time series data (biometrics or activity).
curl --request GET \
--url https://api.example.com/api/v1/users/{user_id}/timeseries \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/users/{user_id}/timeseries"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/users/{user_id}/timeseries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/users/{user_id}/timeseries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/users/{user_id}/timeseries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/users/{user_id}/timeseries")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/users/{user_id}/timeseries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"timestamp": "2023-11-07T05:31:56Z",
"type": "heart_rate",
"value": 123,
"unit": "<string>",
"zone_offset": "+01:00",
"source": {
"provider": "apple",
"device_name": "<string>",
"source": "Connect",
"device": "iPhone15,2",
"device_type": "phone",
"device_id": "R9ZW30ABC12"
},
"is_daily_total": true,
"window_seconds": 123,
"period_end": "2023-11-07T05:31:56Z",
"computed_by": "provider",
"stats": {
"count": 123,
"avg": 123,
"min": 123,
"max": 123,
"sum": 123,
"last": 123
}
}
],
"pagination": {
"has_more": true,
"next_cursor": "eyJpZCI6IjEyMzQ1Njc4OTAiLCJ0cyI6MTcwNDA2NzIwMH0",
"previous_cursor": "<string>",
"total_count": 150
},
"metadata": {
"resolution": "raw",
"sample_count": 123,
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z"
}
}{
"code": "VALIDATION_ERROR",
"detail": "body.email: value is not a valid email address: An email address must have an @-sign. (and 1 more)",
"errors": [
{
"loc": [
"body",
"email"
],
"msg": "value is not a valid email address: An email address must have an @-sign.",
"type": "value_error"
},
{
"loc": [
"body",
"first_name"
],
"msg": "String should have at most 100 characters",
"type": "string_too_long"
}
],
"status": 422,
"title": "Unprocessable Content"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}{
"code": "NOT_FOUND",
"detail": "User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.",
"status": 404,
"title": "Not Found"
}Authorizations
Query Parameters
All supported time-series metric types.
heart_rate, resting_heart_rate, heart_rate_variability_sdnn, heart_rate_recovery_one_minute, walking_heart_rate, heart_rate_variability_rmssd, oxygen_saturation, blood_glucose, blood_pressure_systolic, blood_pressure_diastolic, respiratory_rate, sleeping_breathing_disturbances, breathing_disturbance_index, blood_alcohol_content, peripheral_perfusion_index, forced_vital_capacity, forced_expiratory_volume_1, peak_expiratory_flow_rate, height, weight, body_fat_percentage, body_mass_index, lean_body_mass, body_temperature, skin_temperature, skin_temperature_deviation, skin_temperature_trend_deviation, waist_circumference, body_fat_mass, skeletal_muscle_mass, bone_mass, body_water_mass, body_water_percentage, vo2_max, six_minute_walk_test_distance, cardiovascular_age, steps, active_energy, basal_energy, stand_time, exercise_time, physical_effort, flights_climbed, active_time, total_energy, distance_walking_running, distance_cycling, distance_swimming, distance_downhill_snow_sports, distance_other, walking_step_length, walking_speed, walking_double_support_percentage, walking_asymmetry_percentage, walking_steadiness, stair_descent_speed, stair_ascent_speed, running_power, running_speed, running_vertical_oscillation, running_ground_contact_time, running_stride_length, running_vertical_ratio, running_stance_time_balance, swimming_stroke_count, underwater_depth, cadence, power, speed, distance, elevation_gain, workout_effort_score, estimated_workout_effort_score, environmental_audio_exposure, headphone_audio_exposure, environmental_sound_reduction, time_in_daylight, water_temperature, uv_exposure, inhaler_usage, weather_temperature, weather_humidity, elevation, latitude, longitude, air_temperature, garmin_stress_level, garmin_skin_temperature, garmin_fitness_age, garmin_body_battery, withings_pulse_wave_velocity, withings_metabolic_age, dietary_energy_consumed, dietary_carbohydrates, dietary_fiber, dietary_sugar, dietary_fat_total, dietary_fat_saturated, dietary_fat_monounsaturated, dietary_fat_polyunsaturated, dietary_cholesterol, dietary_protein, dietary_sodium, dietary_potassium, dietary_calcium, dietary_iron, dietary_magnesium, dietary_phosphorus, dietary_zinc, dietary_copper, dietary_manganese, dietary_selenium, dietary_chromium, dietary_molybdenum, dietary_iodine, dietary_chloride, dietary_vitamin_a, dietary_vitamin_b6, dietary_vitamin_b12, dietary_vitamin_c, dietary_vitamin_d, dietary_vitamin_e, dietary_vitamin_k, dietary_thiamin, dietary_riboflavin, dietary_niacin, dietary_folate, dietary_pantothenic_acid, dietary_biotin, dietary_caffeine, dietary_fat_trans, dietary_energy_from_fat, dietary_fat_unsaturated, dietary_folic_acid, electrodermal_activity, push_count, atrial_fibrillation_burden, insulin_delivery, number_of_times_fallen, number_of_alcoholic_beverages, nike_fuel, hydration all returns every source. per_range keeps one source per series type for the whole range. per_period keeps one per series type and period: per day for 1day, 1week and 1month, per bucket below a day; not available for raw reads. A week or month whose days different sources won has source: null. reconcile (1day, 1week and 1month only) merges steps, distance, active energy and the other movement series across sources per day, each moment counted once from the best-ranked source recording it, and reads other series as per_period; a merged value names no source. A page holds only as many periods as the server merges at once; a single period needing more is refused (400). Sources rank by provider, then device type priority. Defaults to all.
all, per_range, per_period, reconcile Was this page helpful?