Documentation menu

Reference from OpenAPI

Every operation, parameter and response of the v2 API, rendered straight from its OpenAPI 3.1 file.

View as Markdown

This page is built from the OpenAPI 3.1 file, so it always matches it. Load the same file into Postman, Insomnia or a client generator to call the API from your own tools. Requests and parameters explains each parameter in more depth.

Each request has a Try it form. With your API key it sends the request from your browser to the API. Without a key it shows real responses recorded from our reference sensor, ASENSE00000005.

Base URL: https://api.semitronica.pt/asense/v2

Get sensor data

get/

Returns records from table_name for device id between start_time and end_time (both inclusive). A page reads at most limit stored records; when more remain, the response carries next_timestamp.

Authentication

  • API key in the x-api-key header

Parameters

NameInTypeDefaultDescription
table_namerequiredqueryacc | gyr | ain | fft | data | env | connected

Table to read. See https://asense.semitronica.pt/docs/data-model/

idrequiredquerystring

Device ID, ASENSE followed by eight digits.

start_timerequiredqueryinteger

Start of the window, Unix milliseconds, UTC, inclusive.

end_timerequiredqueryinteger

End of the window, Unix milliseconds, UTC, inclusive.

limitqueryinteger256

Most stored records read per page. On acc, gyr and ain one stored record is one packet of samples. A value that is not an integer falls back to 256.

ascendingquerytrue | falsetrue

Sort by time, oldest first. false (newest first) is allowed on data, env and connected only; then next_timestamp is the next page's end_time.

mergequerytrue | falsetrue

Join stored packets. acc, gyr, ain: the whole page becomes one item. fft: the X, Y and Z records of each UTC hour become one item with fft_x, fft_y, fft_z. data, env: no joining. When true, seq, odr and scale are removed from every item. Any value other than false counts as true.

output_formatquerymap | tuple_array | dict_array | combined_tuple | combined_dictmap

Layout of every series. An unknown value falls back to map.

timestamps_onlyquerytrue | falsefalse

On data and env, return only the record times in the window (never paged, ignores limit).

auto_odrquerytrue | falsetrue

acc, gyr, ain. Space samples by the measured time between packets (1.0 to 1.5 s apart). Only true enables it.

enable_correctionquerytrue | false

acc, gyr, ain. Repair single packets whose timestamp is out of step. Default depends on the device.

sync_acc_gyrquerytrue | false

gyr. Move each gyroscope packet to the accelerometer packet recorded up to 200 ms before it. Defaults to the value of enable_correction.

load_prior_elementsquerytrue | false

acc, gyr, ain. Read up to 3 s before start_time to time the first packet, then drop it. Defaults to true when any timing correction is on.

Try it

Your key stays in this page and is sent only to the Asense API. It is gone when you leave or reload the page.

Without a key you see real responses recorded from our reference sensor, ASENSE00000005. Add your key to change the request and send it to your own devices.

Request

curl -H "x-api-key: $ASENSE_API_KEY" \
  "https://api.semitronica.pt/asense/v2/?table_name=data&id=ASENSE00000005&start_time=1790470873632&end_time=1790474473632&limit=3"

Responses

StatusDescriptionBody
200

Records in the window. An empty window returns {"data": []}.

StandardResponse or TimestampsOnlyResponse
400

Missing or invalid parameters.

Error
403

Missing or invalid API key.

object
500

The request could not be completed, for example for an unknown table_name.

Error