This API returns list of users currently signed up to use Spire Healthtag devices for a study or research project. This API just needs access token as input.

Query Params

None

Headers

This API just requires API Access Token available at the Research portal. Set this up as HTTP header before calling the API.

Response format

This API returns User data in a JSON format -
[
{
"user_id": 0,
"email": "string",
"sex": "female",
"birthdate": "2019-02-21",
"first_name": "string",
"height_in_cm": 0,
"weight_in_kg": 0,
"baseline_rr": 0,
"baseline_rr_conf_interval": 0,
"baseline_rrv": 0,
"baseline_rrvstd": 0,
"resting_heart_rate": 0,
"active_minutes_goal": 60,
"steps_goal": 10000,
"sleep_hours_goal": 8,
"bedtime": "string"
}
]

Response CodeDescription
200Successful Operation
401Access token is missing or invalid
403Not a valid key value pair in Authorization header
404The requested API could not be found. Please review your URL
429Too many requests hit the API too quickly

Output Data

Field NameTypeDescription
user_idIntegerUnique ID to identify a user
emailStringLogin email address of the user
sexStringGender of the the person -
- female
- male
birthdateStringDate of birth of the user
first_nameStringFirst Name of the user
height_in_cmFloatHeight of the user
weight_in_kgFloatWeight of the user
baseline_rrFloatBaseline respiratory rate is current value of median of respiratory rates while user is resting (i.e. not sleeping or active). Also, very high quality respiratory rates (i.e. respiratory confidence interval <= 0.6) are used for this calculation
baseline_rr_conf_intervalFloatNo device can predict respiratory rate 100% accurately . Confidence interval helps define a range in which true respiratory rate is likely to be there. There is a 95% probablity that true respiratory rate is within 2 respiratory rate confidence interval (i.e. between rr + 2*rr_conf_interval and rr - 2*rr_conf_interval) range. baseline_rr_conf_interval is median of respiratory confidence interval
baseline_rrvFloatBaseline respiratory rate variability is current value of median of respiratory rates variablity while user is resting (i.e. not sleeping or active). Also, very high quality respiratory rates (i.e. respiratory confidence interval <= 0.6) are used for this calculation. For more detail on RRV, see Output Data section of Processed physiological time series data API
baseline_rrvstdFloatCurrent value of median of standard deviation of Respiratory Rates
resting_heart_rateFloatCurrent value of average heart rate while user is resting
active_minutes_goalIntegerActive minutes goal for the day
steps_goalIntegerNumber of steps goal for the day
sleep_hours_goalIntegerSleep hours goal of the day
bedtimeStringTime at which user plans to go to bed

Program samples to test out API

Use the program samples below to test out APIs with your own research data -

cURL

curl --request GET \
  --url https://research-api.spire.io/v1/users \
  --header 'Authorization: Bearer 284e8f3320a8500c58ea5b8e7829bdd676ea941bb573bb250d51c0b82f68e19d' \
  --header 'accept: application/json'

Python

Python program sample below calls Users API to get users data and saves the data into a Pandas data frame.

import requests
from http import HTTPStatus
import pandas as pd

headers = {'Authorization': str('Bearer 284e8f3320a8500c58ea5b8e7829bdd676ea941bb573bb250d51c0b82f68e19d'), 'Content-type': 'application/json'}
params = {}
user_list = requests.get(f'https://research-api.spire.io/v1/users', params=params, headers=headers)
if user_list.status_code == HTTPStatus.OK:
    user_list_pandas = pd.DataFrame(user_list.json(),columns=user_list.json()[0].keys())
    print (user_list_pandas.head())
else:
    print ("Returned status code is: " + str(user_list.status_code))
    print (user_list.text)

Language
Authorization
Bearer
JWT
URL