The Stream API is an HTTP API that allows clients to query data streams for a given patient.
It exposes endpoints for every type of data stream that can be queried (e.g. local field potentials, accelerometry, events, etc). Each endpoint is documented in detail, below.
Throughout this document, the following terminology is used:
A client is associated with exactly one patient. Patients may have multiple clients, depending on how many apps are sending or accessing data. Patients and clients are resources in the Rune platform with unique identifiers, and they are used to control access to patient data.
Authentication is required for all API requests. There are several authentication methods:
Both the access tokens and the client keys are comprised of two parts: a key ID and an access key. These are analagous to a username and password. Usage is described in detail below.
Access tokens provide read access to all the patients in your organization. This is the recommended authentication method for the Stream API.
To use an access token for authentication, the HTTP request must include two headers:
X-Rune-User-Access-Token-Id
- access token IDX-Rune-User-Access-Token-Secret
- access token secretIt is highly recommended that you "rotate" user access tokens every 3-6 months, by creating a new token and deactivating the old one. Store your access tokens securely, and do not share them.
Client keys provide read and write access to one patient.
To use a client key pair for authentication, the HTTP request must include two headers:
X-Rune-Client-Key-Id
- client key IDX-Rune-Client-Access-Key
- client access key (secret)Note that each client may only fetch data for its associated patient.
You can create any number of client keys for a given client, through the Rune web app. If you forget a key, you can always create a new key pair and disable the old.
It is highly recommended that you "rotate" keys for a patient every 3-6 months, by creating a new client key, configuring it in the client (e.g. the patient's app), then disabling the old key. You should do this immediately if you believe the key may have been compromised (e.g. stolen from the device, posted over any insecure/public communication channel, etc).
Endpoint URLs ending in .json
return JSON-formatted data. All resources
support this data format. Endpoint URLs ending in .csv
return CSV data.
Some resources support this data format.
Standard HTTP status codes are used to indicate success or failure. In the event of most errors, the response body is JSON that includes additional information, with the following format:
{
"success": false,
"error": {
"message": "Human-readable error description",
"type": "EnumeratedErrorKind"
}
}
There is a limit on the amount of data that may be returned from a single API request. If the queried time range contains more than one page’s worth of data, you must make multiple API requests to fetch the complete result.
A custom header field is used to paginate query results. If an API response
includes a X-Rune-Next-Page-Token
header, make another
request to fetch the next page of data. In the next request, provide the
value of this header in the next_page_token
query parameter.
Keep the rest of the query parameters identical. When the end of pagination
has been reached, the X-Rune-Next-Page-Token
header field will not exist
in the response.
The maximum amount of data that is returned in a single request can be
specified via the page_size
parameter. The default page size is different
for JSON and CSV endpoints (see endpoint documentation for details). Clients
should be careful about managing their memory usage, as responses may
contain a large volume of data.
Query accelerometry data for any device that records it. Acceleration values are always in units of Gs (9.8 m/s^2).
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
expression
determines the structure of the result
object.timestamp
determines the format of the timestamps.partition_size
segments each array into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "accel" Determines what kind of accelerometry data is returned. For
For the following expressions,
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
{- "success": true,
- "result": {
- "cardinality": 3,
- "time": [
- 1565304080600,
- 1565304080700,
- 1565304080800
], - "x": [
- 0,
- 1.4,
- 1
], - "y": [
- 0.1,
- 0.3,
- 1.2
], - "z": [
- 0.1,
- 0.7,
- 0.2
]
}
}
A successful request returns CSV data. The format depends on several query parameters:
expression
determines the columns of data that are returned.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "accel" Determines what kind of accelerometry data is returned. For
For the following expressions,
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 3600000 ] Default: 2000000 Maximum number of events to return per page. If |
time,x,y,z 1565304080.1,0,0.1,0.1 1565304080.2,1.4,0.3,0.7 1565304080.3,1,1.2,0.2
Query band power data that is calculated on-device.
This data is distinct from data that is available from the
band_power(spectrogram(lfp))
expression of the LFP endpoint,
which is calculated by Rune Labs.
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
expression
determines the structure of the result
object.timestamp
determines the format of the timestamps.partition_size
segments each array into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
anatomy | string Example: anatomy=GPi,STN,M1 CSV of the target anatom(y|ies) where the device is attached or implanted. Only applies to multi-sensor devices. Can be omitted to return data from all sensors across any anatomy. |
band | string Example: band=16.4hz-19.8hz,8.5hz-9.6hz CSV of the band power ranges to return data for. |
channel | string Example: channel=0,1,2,3 CSV of the device channels to return data for. Only applies to multi-sensor devices. |
sensor | string Example: sensor=0-2,5-6 CSV of the device sensors (e.g. electrode pair) to return data for. Only applies to multi-sensor devices. |
expression | string Default: "power" Enum: "power" "availability(power)" Determines what kind of data is returned.
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
filename | string If provided, causes the endpoint to return a response with an attachment content disposition. Used to trigger a file download in browsers. |
{- "success": true,
- "result": {
- "cardinality": 10,
- "streams": [
- {
- "parameters": {
- "algorithm": "medtronic-percept-1",
- "anatomy": "GPi",
- "band": "16.4hz-19.8hz",
- "channel": "1",
- "sensor": "5-4"
}, - "power": [
- -0.00008373,
- -0.000079019,
- -0.000081054,
- -0.000083195,
- -0.000082553
], - "time": [
- 1575652125.616,
- 1575652125.617,
- 1575652125.618,
- 1575652125.619,
- 1575652125.62
]
}, - {
- "parameters": {
- "algorithm": "medtronic-percept-1",
- "anatomy": "GPi",
- "band": "16.4hz-19.8hz",
- "channel": "1",
- "sensor": "6-4"
}, - "power": [
- -0.000069811,
- -0.000070346,
- -0.000068526,
- -0.000069918,
- -0.000070132
], - "time": [
- 1575652231.4490001,
- 1575652231.45,
- 1575652231.451,
- 1575652231.4520001,
- 1575652231.4530003
]
}
]
}
}
A successful request returns CSV data. The format depends on several query parameters:
expression
determines the columns of data that are returned.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
anatomy | string Example: anatomy=GPi,STN,M1 CSV of the target anatom(y|ies) where the device is attached or implanted. Only applies to multi-sensor devices. Can be omitted to return data from all sensors across any anatomy. |
band | string Example: band=16.4hz-19.8hz,8.5hz-9.6hz CSV of the band power ranges to return data for. |
channel | string Example: channel=0,1,2,3 CSV of the device channels to return data for. Only applies to multi-sensor devices. |
sensor | string Example: sensor=0-2,5-6 CSV of the device sensors (e.g. electrode pair) to return data for. Only applies to multi-sensor devices. |
expression | string Default: "power" Enum: "power" "availability(power)" Determines what kind of data is returned.
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
filename | string If provided, causes the endpoint to return a response with an attachment content disposition. Used to trigger a file download in browsers. |
timestamp,algorithm,anatomy,band,channel,sensor,power 1590706215.314000,medtronic-percept-1,GPi,16.4hz-19.8hz,0,7-5,0.1 1590706231.971000,medtronic-percept-1,GPi,16.4hz-19.8hz,0,7-5,1.2 1590706240.604000,medtronic-percept-1,STN,16.4hz-19.8hz,0,7-5,2.3 1590706248.245000,medtronic-percept-1,STN,16.4hz-19.8hz,2,0-2,3.4 1590706257.554000,medtronic-percept-1,STN,16.4hz-19.8hz,2,0-2,-4.5
There are two distinct types of event records, each of which can be queried from a dedicated endpoint:
Unlike other streams, events and spans have no notion of sampling frequency or interpolation.
Both events and spans are categorized through a nested, three-level
classification, in the form of namespace.category.enum
.
device
, which includes all events generated by
patient devices. Another common namespace is patient
, which includes
items that were recorded by a patient. Other namespaces include (but
are not limited to) custom events recorded by researchers, clinicians,
or sourced from external health databases.medication
, settings
, therapy
, etc).medication
category,
each specific medication that the patient has taken could be an
enumerated event type. However, the device.implant
event type does not
have an enumeration.When querying, event types can be selected at any of the three levels of classification. For example:
patient
as the event type would return all events logged
by the patient.patient.medication
would return all logged medication events.patient.medication.propranolol
would list all events when
the patient recorded taking Propranolol.A span represents something that occurred over time. This
is represented in the record via the start_time
and end_time
keys. A span may also represent some amount of uncertainty in
the start and/or end time, via the start_time_min
and end_time_max
keys. This is most relevant for patient-reported events. For example,
if a patient logs that they had a headache for 1-2 hours, starting at 3pm,
it would be represented with the following timestamps:
start_time_min
: 3pmstart_time
: 3pmend_time
: 4pmend_time_max
: 5pmThe four possible timestamps always have the following relationship:
start_time_min <= start_time < end_time <= end_time_max
Both events and spans include a JSON payload. The contents of the payload varies between different event types.
Returns events in a JSON-formatted response.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id | string ID of the device from which data was reported. |
event | string The type of event to query, in the form |
start_time | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
{- "result": {
- "cardinality": 2,
- "event": [
- {
- "display_name": "device.implant",
- "device_id": "Device123",
- "event_enum": null,
- "event_namespace": "device",
- "event_type": "implant",
- "id": "event-RCS02-01234567890abcdef",
- "payload": { },
- "time": 1557216000
}, - {
- "display_name": "device.implant",
- "device_id": "Device789",
- "event_enum": null,
- "event_namespace": "device",
- "event_type": "implant",
- "id": "event-RCS02-01234567890abcdfa",
- "payload": { },
- "time": 1557302400
}
], - "time": [
- 1557216000,
- 1557302400
]
}, - "success": true
}
Returns spans in a JSON-formatted response.
All spans that overlap with the queried time range are included in the response. In other words, if a span starts before but ends after the beginning of the queried time range, it will be included in the response.
This endpoint only supports token-based pagination. It does not support the offset-based pagination query parameters.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
device_id | string ID of the device from which data was reported. |
event | string The type of span to query, in the form |
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
{- "result": {
- "cardinality": 2,
- "span": [
- {
- "start_time_min": 1608525000,
- "start_time": 1608525000,
- "end_time": 1608553800,
- "end_time_max": 1608553800,
- "created_time": 1608582149.5474365,
- "device_id": "ABCDE",
- "display_name": "patient.sleep.normal",
- "event_namespace": "patient",
- "event_type": "sleep",
- "event_enum": "normal",
- "id": "event-123456-01234567890abcdefg",
- "payload": {
- "category": "Sleep",
- "hours_slept": "8.0",
- "name": "Sleep",
- "nap": false,
- "quality": "typical",
- "times_woken_up": "0"
}
}, - {
- "start_time_min": 1608574833.252,
- "start_time": 1608574833.252,
- "end_time": 1608578433.252,
- "end_time_max": 1608582033.252,
- "created_time": 1608582073.095411,
- "device_id": "ABCDE",
- "display_name": "patient.symptom.drowsiness",
- "event_namespace": "patient",
- "event_type": "symptom",
- "event_enum": "drowsiness",
- "id": "event-123456-01234567890hijklmn",
- "payload": {
- "category": "Symptom",
- "duration": "1-2h",
- "intensity": 2,
- "name": "Drowsiness"
}
}
]
}, - "success": true
}
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
expression
determines the structure of the result
object.timestamp
determines the format of the timestamps.partition_size
segments each array into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "bpm" Enum: "bpm" "availability(bpm)" Determines what kind of data is returned:
For the following expressions,
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
{- "result": {
- "cardinality": 3,
- "bpm": [
- 64,
- 65,
- 62
], - "time": [
- 1565304080,
- 1565304085,
- 1565304090
]
}
}
A successful request returns CSV data. The format depends on several query parameters:
expression
determines the columns of data that are returned.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "bpm" Enum: "bpm" "availability(bpm)" Determines what kind of data is returned:
For the following expressions,
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 3600000 ] Default: 2000000 Maximum number of events to return per page. If |
time,bpm 1565304080,64 1565304085,65 1565304090,62
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
expression
determines the structure of the result
object.timestamp
determines the format of the timestamps.partition_size
segments each array into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. NOTE: Cannot be used in combination with the legacy |
anatomy | string Example: anatomy=GPi,STN,M1 CSV of the target anatom(y|ies) where the device is attached or implanted. Only applies to multi-sensor devices. Can be omitted to return data from all sensors across any anatomy. NOTE: Cannot be used in combination with the legacy |
channel | string Example: channel=0,1,2,3 CSV of the device channels to return data for. Only applies to multi-sensor devices. Note that this parameter has the same meaning as NOTE: Cannot be used in combination with the legacy |
channels | string Example: channels=0,1,2,3 (Deprecated. Use Comma-separated list of device-sensing channels, identified by channel number (e.g. 0, 1, 2, or 3). NOTE: Cannot be used in combination with the |
sensor | string Example: sensor=0-2,5-6 CSV of the device sensors (e.g. electrode pair) to return data for. Only applies to multi-sensor devices. NOTE: Cannot be used in combination with the legacy |
expression | string Default: "lfp" Determines what kind of data is returned. Some expressions
involve statistical aggregations or downsampling (e.g.
|
low_freq | integer [ 0 .. 200 ] Default: 0 For expressions that return frequency data (e.g. spectrograms), this
is the lowest frequency to select (in Hz). Note that this is
not related to the |
high_freq | integer [ 0 .. 200 ] Default: 125 For expressions that return frequency data (e.g. spectrograms), this
is the highest frequency to select (in Hz). Note that this is
not related to the |
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
filename | string If provided, causes the endpoint to return a response with an attachment content disposition. Used to trigger a file download in browsers. |
{- "success": true,
- "result": {
- "cardinality": 10,
- "streams": [
- {
- "parameters": {
- "algorithm": "example-dbs-v2",
- "anatomy": "GPi",
- "channel": "1",
- "sensor": "5-4"
}, - "potential": [
- -0.00008373,
- -0.000079019,
- -0.000081054,
- -0.000083195,
- -0.000082553
], - "time": [
- 1575652125.616,
- 1575652125.617,
- 1575652125.618,
- 1575652125.619,
- 1575652125.62
]
}, - {
- "parameters": {
- "algorithm": "example-dbs-v2",
- "anatomy": "GPi",
- "channel": "1",
- "sensor": "6-4"
}, - "potential": [
- -0.000069811,
- -0.000070346,
- -0.000068526,
- -0.000069918,
- -0.000070132
], - "time": [
- 1575652231.4490001,
- 1575652231.45,
- 1575652231.451,
- 1575652231.4520001,
- 1575652231.4530003
]
}
]
}
}
A successful request returns CSV data. The format depends on several query parameters:
channels
will trigger use of the legacy response schema.
Omit or use channel
instead for the (latest) version 1.0 schema.expression
determines the columns of data that are returned.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. NOTE: Cannot be used in combination with the legacy |
anatomy | string Example: anatomy=GPi,STN,M1 CSV of the target anatom(y|ies) where the device is attached or implanted. Only applies to multi-sensor devices. Can be omitted to return data from all sensors across any anatomy. NOTE: Cannot be used in combination with the legacy |
channel | string Example: channel=0,1,2,3 CSV of the device channels to return data for. Only applies to multi-sensor devices. Note that this parameter has the same meaning as NOTE: Cannot be used in combination with the legacy |
channels | string Example: channels=0,1,2,3 (Deprecated. Use Comma-separated list of device-sensing channels, identified by channel number (e.g. 0, 1, 2, or 3). NOTE: Cannot be used in combination with the |
sensor | string Example: sensor=0-2,5-6 CSV of the device sensors (e.g. electrode pair) to return data for. Only applies to multi-sensor devices. NOTE: Cannot be used in combination with the legacy |
expression | string Default: "lfp" Enum: "lfp" "availability(lfp)" "spectrogram(lfp)" Determines what kind of data is returned:
|
low_freq | integer [ 0 .. 200 ] Default: 0 For expressions that return frequency data (e.g. spectrograms), this
is the lowest frequency to select (in Hz). Note that this is
not related to the |
high_freq | integer [ 0 .. 200 ] Default: 125 For expressions that return frequency data (e.g. spectrograms), this
is the highest frequency to select (in Hz). Note that this is
not related to the |
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 3600000 ] Default: 2000000 Maximum number of events to return per page. If |
filename | string If provided, causes the endpoint to return a response with an attachment content disposition. Used to trigger a file download in browsers. |
timestamp,algorithm,anatomy,channel,sensor,potential 1590706215.314000,example-dbs-v2,GPi,0,7-5,0.1 1590706231.971000,example-dbs-v2,GPi,0,7-5,1.2 1590706240.604000,example-dbs-v2,STN,0,7-5,2.3 1590706248.245000,example-dbs-v2,STN,2,0-2,3.4 1590706257.554000,example-dbs-v2,STN,2,0-2,-4.5
Query rotation data for any device that records it. Rotation
is represented as three vectors: x
, y
, z
.
Each vector contains the angular velocity along its respective
axis.
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
channels
will trigger use of the legacy response schema.
Omit or use channel
instead for the (latest) version 1.0 schema.expression
determines the structure of the result
object.timestamp
determines the format of the timestamps.partition_size
segments each array into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "rotation" Enum: "rotation" "availability(rotation)" Determines what kind of data is returned.
For the following expressions,
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
{- "success": true,
- "result": {
- "cardinality": 3,
- "time": [
- 1565304080600,
- 1565304080700,
- 1565304080800
], - "x": [
- 0,
- 1.4,
- 1
], - "y": [
- 0.1,
- 0.3,
- 1.2
], - "z": [
- 0.1,
- 0.7,
- 0.2
]
}
}
A successful request returns CSV data. The format depends on several query parameters:
expression
determines the columns of data that are returned.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "rotation" Enum: "rotation" "availability(rotation)" Determines what kind of data is returned.
For the following expressions,
|
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 3600000 ] Default: 2000000 Maximum number of events to return per page. If |
time,x,y,z 1565304080.1,0,0.1,0.1 1565304080.2,1.4,0.3,0.7 1565304080.3,1,1.2,0.2
Fetch raw data that was uploaded to the Rune Platform.
To use this endpoint, you will need a dataset ID, which is generated by the Rune Data API on upload. Rune’s GraphQL API can be used to find dataset IDs for a given patient.
A dataset may be composed of several streams (files). Each request to this endpoint returns one stream: you may need to make multiple requests to download an entire dataset.
Note that unlike other Stream API endpoints, this endpoint returns the raw binary of the original data. It does not have a standard JSON or CSV structure.
The typical use for this endpoint is download a raw dataset into local storage. This is not the optimal way to download entire archives. If for any reason you need to export all data for all your patients, please contact support@runelabs.io, and our team will provide you with a copy of the raw data in a more efficient way.
session_id required | string Example: session_id=dataset-37a2a3dc70c825d9ed1dc5bfcc3137b7c63c84f42c89b075975fb99bfb81c105 The dataset ID to download. Confusingly, this is NOT the |
stream_name required | string Example: stream_name=metadata The name of the specific stream to download from the dataset. Stream names vary, according to the schema of the dataset. |
{- "success": false,
- "error": {
- "message": "string",
- "type": "string"
}, - "result": null
}
Stateful streams are a category of data distinguished by the fact that they persistently hold a constant value over time, until an update event sets a new value at a given point in time. After an update event sets the value of a field, that value persists until the next update event, and so on.
Because many different streams can be categorized as stateful, data from these endpoints are grouped into event types. Much like events, these represent different types of data. Each event type contains different state fields, which store numeric values. Each update event may affect one or more of the state fields.
As an example, suppose a device periodically emits status
events.
Each event contains two fields:
is_on
reflects a change in the on/off status for the devicebattery_level
represents the charge status of the battery, as a
percentage (0-1).Suppose the device is turned on at time T0 with a battery level of 90%,
and it issues its first status update. At time T1, the device emits a
status update that the battery level is at 70%. At time T2, the
device is turned off, with a battery level of 65%. If you queried the
state of the status
stream for this device, you would see the following:
is_on=1
and battery_level=0.9
is_on=1
and battery_level=0.7
is_on=0
and battery_level=0.65
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
expression
, event
, and fields
determine the structure of
the result
object.timestamp
determines the format of the timestamps.partition_size
segments each stream into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "state" Enum: "state" "availability(state)" "event_type" "update" Determines what kind of data is returned:
|
event required | string Example: event=stimulation_state Type of state event to return data for. This parameter
is NOT required for the |
fields required | string Example: fields=ld0.threshold.low,ld0.threshold.high Comma-separated list of state fields to return as timeseries data.
This parameter is NOT required for the |
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the Only supported for the availability expression. |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the Only supported for the availability expression. |
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
{- "success": true,
- "result": {
- "cardinality": 3,
- "time": [
- 1565304080.1,
- 1565304500.2,
- 1565304910.3
], - "ld0.threshold.low": [
- 500,
- 500,
- 501
], - "ld0.threshold.high": [
- 503,
- 505,
- 505
]
}
}
A successful request returns CSV data. The format of the result depends on several query parameters:
expression
, event
, and fields
determine the structure of
the result
object.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
algorithm | string Example: algorithm=example-dbs-v2 ID of algorithm used to generate the stream. Can be generally omitted unless known. In some cases, we'll publish an improved algorithm (e.g. a increase in timestamp accuracy), and data will be available in both the new and old version for compatibility. |
expression | string Default: "state" Enum: "state" "availability(state)" Determines what kind of data is returned:
|
event required | string Example: event=stimulation_state Type of state event to return data for. |
fields required | string Example: fields=ld0.threshold.low,ld0.threshold.high Comma-separated list of state fields to return as timeseries data. |
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the Only supported for the availability expression. |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the Only supported for the availability expression. |
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 3600000 ] Default: 2000000 Maximum number of events to return per page. If |
time,ld0.threshold.low,ld0.threshold.high 1565304080.1,500,503 1565304500.2,500,505 1565304910.3,501,505
A successful request returns a JSON object, with a result
key
containing timeseries data. The format of the result depends on
several query parameters:
expression
and severity
determine the structure of
the result
object.timestamp
determines the format of the timestamps.partition_size
segments each stream into sub-arrays.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
symptom required | string Name of the symptom (e.g. |
expression | string Default: "probability" Determines what kind of data is returned:
For the following expressions,
|
severity | string Example: severity=mild,moderate,severe A comma-delimited list of symptom severities OR This parameter is only used when
Timeseries Alignment: When |
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 10000 ] Default: 10000 Maximum number of events to return per page. If |
partition_size | integer If set, break up result data for each stream into subsets of
|
filename | string If provided, causes the endpoint to return a response with an attachment content disposition. Used to trigger a file download in browsers. |
{- "success": true,
- "result": {
- "cardinality": 3,
- "time": [
- 1565304080.1,
- 1565304080.2,
- 1565304080.3
], - "probability": [
- 0.5,
- 0.7,
- 0.6
]
}
}
A successful request returns CSV data. The format depends on several query parameters:
expression
and severity
determine the columns of data
that are returned.timestamp
determines the format of the timestamps.See details for each query parameter, as well as the response examples.
patient_id required | string Patient ID. If authenticating with a client key pair, this parameter may be omitted: the patient is inferred from the key pair. |
device_id required | string ID of the device from which data was reported. |
start_time required | float Unix timestamp with the start of the time range to query. This is
inclusive: all returned timestamps will be |
end_time required | float Unix timestamp with the end of the time range to query.
This is exclusive: all returned timestamps will be |
symptom required | string Name of the symptom (e.g. |
expression | string Default: "probability" Determines what kind of data is returned:
For the following expressions,
|
severity | string Example: severity=mild,moderate,severe A comma-delimited list of symptom severities OR This parameter is only used when
Timeseries Alignment: When |
frequency | float The time frequency (in Hz) of the returned timeseries.
This is the reciprocal of the |
resolution | float Time interval between returned points, in seconds. This is the
reciprocal of the |
interpolation | string Default: "" Enum: "" "linear" null "previous" "zero" How to fill in timestamps with no data, when
|
timestamp | string Default: "unix" Enum: "unix" "datetime" "iso" Timestamp format. |
timezone | integer Default: 0 Example: timezone=-28800 The timezone offset, in seconds, used to calculate string-based
timestamp formats such as |
timezone_name | string Default: "" Example: timezone_name=America/Los_Angeles The name from the IANA timezone database used to calculate string-based
timestamp formats such as |
next_page_token | string <byte> A token provided in the request to obtain the subsequent page of
records in a dataset. The value is obtained from the
|
page | integer >= 0 Default: 0 (Deprecated. Use The page number, to be used if the query result exceeds the pagination
limit. Numbering starts at 0 (i.e. |
page_size | integer [ 0 .. 3600000 ] Default: 2000000 Maximum number of events to return per page. If |
filename | string If provided, causes the endpoint to return a response with an attachment content disposition. Used to trigger a file download in browsers. |
time,probability 1565304080.1,0.5 1565304080.2,0.7 1565304080.3,0.6