home api list

Hexostore API Documentation

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:

Fields

This resource contains no fields.

Filtering Options

datatype: exact, in, gt, gte, lt, lte, range

end: exact

A synonym for timestamp__lt.

flat: exact

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.

max_values: exact

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.

no_timestamps: exact

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.

range: exact

record: exact

scaled: exact

if present, in json output, the ECG are scaled in μV.

seconds: exact

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.

start: exact

A synonym for timestamp__gte.

timestamp: range, gt, gte, lt, lte

May be specified multiple times to define a range, or with __range=start,end.

user: exact

Sorting Options

No sorting supported

© 2024 by Carré Technologies Inc.