data
/api/data/
List methods: get
Detail methods: None
This is a read-only resource (it only accepts GET requests) designed to help developers access data more conveniently.
It returns an array of objects, one per user, according to the filter options:
[
{
'data': {
<datatype>: [
[timestamp, value],
[timestamp, value],
[timestamp, value],
...
],
...
},
'user': user URI,
},
...
]
Filters are combined in the most restrictive fashion, ie. ANDed together. For instance, a filter that includes a record and a timestamp__range that falls completely outside the record will return no data. This also means that specifying more than one Range, Record, or TrainingRoutine will return results only where they all overlap.
For JSON and CSV formats, the result size is constrained to 65536 values per datatype. If your request would return more data than that, the result is subsampled as described in the max_values filter description below.
65536 represents about 18 hours of 1Hz data so hopefully will be sufficient for your needs. For the raw datatypes at 64Hz, 128Hz, and 256Hz, use the binary format to download large samples.
This resource also supports four output formats: the default
application/json
, text/csv
, application/octet-stream
and application/x-edf
.
Use the Accept header to specify the desired output format.
The CSV format will return a table of user, timestamp, [datatypes] where each datatype is represented by its URI. If the data requested represents just one user, the user column is omitted since in the majority of cases it is not required.
Synchronous data is returned as a RIFF/WAV file and asynconous data is returned as a series of timestamp/value pairs encoded as long longs (8 bytes).
The binary data format is designed to provide raw access to the format we
use to store the data, thus certain options will not work with this output
format. The seconds
, flat
, and max_values
flags have no effect and
only data from a single record may be returned per request.
The WAV files conform to the specification with the following exceptions:
-
The values for the raw ECG datatypes (datatype/4113/, datatype/4114/, datatype/4115/) and the raw accelerometer data (datatype/4145/, datatype/4146/, datatype/4147/) are stored as signed 16 bit integers, the rest are unsigned.
-
The frequency for the SDANN and HRV at one minute (datatype/260/, datatype/262/) is 1/60 Hz which is not easily represented in the WAV header. To accomplish this, the value should be interpreted as 1/x.
Fields
This resource contains no fields.
Filtering Options
- datatype: exact, in, gt, gte, lt, lte, range
- end: exact
- flat: exact
- max_values: exact
- no_timestamps: exact
- range: exact
- record: exact
- scaled: exact
- seconds: exact
- start: exact
- timestamp: range, gt, gte, lt, lte
- user: exact
A synonym for timestamp__lt.
If you know your data will contain only one datatype from a single
user, you may pass flat=1
and you will receive only the raw
array of data. But be careful, if you flatten a result that
has multiple users or datatypes, all the data will be mixed
together with no way to know which value pertains to which
datatype and/or user.
The maximum number of values to return per datatype. If you wish to return a subsample of the data, you may limit the size of the returned values with this filter. Note that the values are not a true sub-sample but every nth element where n is the smallest number that will return a total number of samples less than max_values.
Omit the timestamps. If you wish to have only the values, passing this filter will remove the timestamps and lower the size of the resulting array.
if present, in json output, the ECG are scaled in μV.
Provide the timestamps in normal seconds rather than hexoseconds (256ths of a second). The floor of the value is returned. If you request a datatype with a resolution > 1Hz and specify seconds, you will receive multiple values for each timestamp.
A synonym for timestamp__gte.
May be specified multiple times to define a range, or with __range=start,end.
Sorting Options
No sorting supported
© 2024 by Carré Technologies Inc.