The Asense API v2 provides access to historical and high-frequency sensor data, including Accelerometer, Gyroscope, Magnetometer, and environmental metrics.
🔐 Authentication
All requests must include the API Key in the header:
x-api-key: YOUR_API_KEY
📄 Pagination (Cursor-based)
The API handles large datasets via pagination.
- Make an initial request with
start_timeandend_time. - Check the response object for the
next_timestampfield. - If
next_timestampexists, make a subsequent request using this value as your newstart_time. - Repeat until
next_timestampis no longer returned.
🔀 Output Formats
The structure of time-series vectors (e.g., acc_x) changes based on the output_format parameter.
| Format | Structure | Example |
|---|---|---|
map (Default) | Object with timestamp keys | {"17642...": 0.045} |
tuple_array | Array of [time, val] | [[17642..., 0.045], ...] |
dict_array | Array of Objects | [{"time": 17642..., "val": 0.045}, ...] |
combined_tuple | Grouped Array (e.g., x,y,z) | [[time, x, y, z], ...] |
combined_dict | Grouped Object | [{"time":..., "x":..., "y":..., "z":...}] |
Version: v2
Available authorizations
ApiKeyAuth (API Key Authentication)
Name: x-api-key
In: header
[GET] /
Get Sensor Data
Retrieve data from specific tables within a time window.
Parameters
| Name | Located in | Description | Required | Schema |
|---|---|---|---|---|
| table_name | query | The specific data table to query. • acc: Accelerometer (High Freq) + Environmental Data. • gyr: Gyroscope (High Freq). • fft: Fast Fourier Transform (Frequency Domain). • ain: Analog Inputs (High Freq). • data: Aggregated Data, Location, Statistics & Spectrograms. | Yes | string, Available values: "acc", "gyr", "fft", "ain", "data" |
| id | query | Unique Device ID. Format is ASENSE followed by 8 digits. | Yes | string |
| start_time | query | Start Unix Timestamp in milliseconds. | Yes | long |
| end_time | query | End Unix Timestamp in milliseconds. | Yes | long |
| merge | query | If true, aggregates high-frequency packets into larger objects to reduce overhead. • Default: true for acc, gyr, fft, ain. • Note: When true, the root time field represents the start of the packet, while internal vector keys represent exact sample times. | No | string, Available values: "true", "false", Default: true |
| output_format | query | Controls the JSON structure of the returned vectors. See "Output Formats" section in description. | No | string, Available values: "map", "tuple_array", "dict_array", "combined_tuple", "combined_dict", Default: map |
| timestamps_only | query | (Only for table_name=data). If true, returns a lightweight list of available timestamps without payload data. | No | string, Available values: "true", "false", Default: false |
Responses
| Code | Description | Schema |
|---|---|---|
| 200 | Successful Response | application/json: |
| 400 | Bad Request (Missing parameters or invalid time) | application/json: { "error": string } |
| 500 | Internal Server Error |
Schemas
StandardResponse
| Name | Type | Description | Required |
|---|---|---|---|
| next_timestamp | long | Pagination Cursor. If present, indicates more data is available. Use this value as start_time in your next request. | No |
| data | [ ] | List of sensor data objects. | No |
TimestampsOnlyResponse
Structure returned when timestamps_only=true.
| Name | Type | Description | Required |
|---|---|---|---|
| count | integer | No | |
| timestamps | [ long ] | No |
AccItem
Returns High-Frequency Accelerometer data plus environmental data.
- Merge behavior: If
merge=true, returns long vectors. Iffalse, returns raw packets.
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Yes | |
| datetime | dateTime | Yes | |
| odr | number | Output Data Rate in Hz. | No |
| scale | number | Sensor scale configuration. | No |
| acc | TimeSeriesVector | Timeseries of high-frequency triaxial accelerometer measurements (g, ms). | output_format=combined_tuple or output_format=combined_dict |
| acc_x, acc_y, acc_z | TimeSeriesVector | Timeseries of high-frequency single-axis accelerometer measurements (g, ms). | output_format=map, output_tuple_array, or output_format=dict_array |
| tamb | TimeSeriesVector | Ambient Temperature (°C). | No |
| w_s | TimeSeriesVector | Wind Speed (m/s). | No |
| w_d | TimeSeriesVector | Wind Direction (Degrees 0-360). | No |
GyrItem
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Yes | |
| datetime | dateTime | Yes | |
| odr | number | Output Data Rate in Hz. | No |
| gyr | TimeSeriesVector | Timeseries of high-frequency triaxial gyroscope measurements (°/s, ms). | output_format=combined_tuple or output_format=combined_dict |
| gyr_x, gyr_y, gyr_z | TimeSeriesVector | Timeseries of high-frequency single-axis gyroscope measurements (°/s, ms). | output_format=map, output_tuple_array, or output_format=dict_array |
AinItem
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Yes | |
| datetime | string | No | |
| ain | TimeSeriesVector | Timeseries of high-frequency dual-channel voltage measurements (mV, ms). | output_format=combined_tuple or output_format=combined_dict |
| ain_a, ain_b | TimeSeriesVector | Timeseries of high-frequency single-channel voltage measurements (mV, ms). | output_format=map, output_tuple_array, or output_format=dict_array |
FftItem
Frequency Domain data.
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Yes | |
| datetime | string | Yes | |
| odr | number | No | |
| fft | FrequencySeriesVector | Single-channel (merge=false) or triaxial (merge=true) Spectrogram of Accelerometer Data, calculated over a period of 20 seconds. | merge=false and any output_format, or merge=true and output_format=combined_tuple or output_format=combined_dict |
| fft_x, fft_y, fft_z | FrequencySeriesVector | Single-channel Spectrogram of Accelerometer Data, calculated over a period of 20 seconds. | merge=true and output_format=map, output_tuple_array or output_format=dict_array |
| axis | int | 0, 1 or 2, identifying the axis of the fft (X, Y or Z) | merge=false |
DataItem
Contains aggregated metrics calculated on-device, and location data.
Always requested with merge=false.
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | No | |
| datetime | string | No | |
| time | integer | Unix Timestamp (ms). | No |
| lat | number | GPS Latitude (Decimal Degrees). | No |
| long | number | GPS Longitude (Decimal Degrees). | No |
| tamb | number | Ambient Temperature (°C). | No |
| w_s | number | Wind Speed (m/s). | No |
| w_d | number | Wind Direction (Degrees). | No |
| aavgx | number | Average Acc X (g). | No |
| aavgy | number | Average Acc Y (g). | No |
| aavgz | number | Average Acc Z (g). | No |
| amaxx | number | Max Acc X (g). | No |
| amaxy | number | Max Acc Y (g). | No |
| amaxz | number | Max Acc Z (g). | No |
| aminx | number | Min Acc X (g). | No |
| aminy | number | Min Acc Y (g). | No |
| aminz | number | Min Acc Z (g). | No |
| theta | number | Inclinometer Theta (Degrees). | No |
| phi | number | Inclinometer Phi (Degrees). | No |
| in_a | number | Input Voltage A (mV). | No |
| in_b | number | Input Voltage B (mV). | No |
| mx1 | number | Spectrogram Peak 1 Amplitude. | No |
| nx1 | number | Spectrogram Peak 1 Frequency (Hz). | No |
| w_s_avg | Rolling average of wind speed over the last hour (10-minute steps). • Map Format: Returns keys w_s_avg_0 through w_s_avg_5. • Array Format: Returns a vector of 6 points. | No |
TimeSeriesVector
Represents a series of data points over time. Structure depends on output_format.
| Name | Type | Description | Required |
|---|---|---|---|
| TimeSeriesVector | Represents a series of data points over time. Structure depends on output_format. |
FrequencySeriesVector
Represents FFT data (Frequency vs Amplitude).
| Name | Type | Description | Required |
|---|---|---|---|
| FrequencySeriesVector | Represents FFT data (Frequency vs Amplitude). |