SenseiQ API Portal Guide
A reference for remote systems interrogating the SenseiQ ecosystem — retrieving event, recording, test, and heartbeat data via HTTP.
Overview
This document is the definitive guide to the API web portal used by external systems to access data from the SenseiQ system.
The SenseiQ ecosystem is made accessible to trusted parties so that they may retrieve event, recording, test, and heartbeat data for their own purposes. The SenseiQ Services web site provides an interactive interface for a client to access their sensor data with valid log-in credentials — but clients often wish to access data programmatically from a remote system, and to download that data in a recognisable form.
To deliver this, a web API portal has been created that provides querying capability via HTTP requests. The data stream is returned in JSON — an industry standard most remote systems can interpret. The portal follows RESTful conventions where practical.
Requests are POSTed to the portal as discussed in the request format section. Each request includes login credentials along with parameters describing the query. Because live-data responsiveness matters for some use cases, the API supports session login: when a client logs in, a token is returned that can stand in for the password on subsequent calls. The client is responsible for logging out once the interaction is complete.
Accessing the API
A remote client can access the API at the following URL:
https://isds-services.senseisolutions.co.nz/ISDSWebServer/api-portalRequest format
Requests are POSTed to the URL above as HTTP requests. Query information is provided in plain-text format as a sequence of key/value pairs — all strings, enclosed in single or double quotes. The table below summarises keys that may (or must) appear.
| Key | Value |
|---|---|
username | The user name of the client in the SenseiQ Registry. |
password | The password of the client in the SenseiQ Registry. |
query | The code of the query command (see tables below). |
logintoken | Optional. Login token for an active API session. |
sensorname | Optional. The name of the sensor — e.g. Proto-ISDS-1. |
hostname | Optional. The host name of the sensor computer — e.g. Proto-BB-1. |
source | Optional. 1 = sensor itself, 2 = sensor archive on its server. |
datasetnumber | Optional. Index of the dataset on the sensor/server (0-based). |
starttimeperiod | Optional. Start of period as days-before-today. Defaults to before the first archived dataset. |
endtimeperiod | Optional. End of period as days-before-today. Defaults to today. |
fieldchoices | Optional. Bitmask specifying required time series for query 30 (see Appendix A). |
samplingtimestep | Optional. Resampling time step (float, seconds) for query 30. E.g. 0.1F. |
Example request using fetch:
const res = await fetch(
"https://isds-services.senseisolutions.co.nz/ISDSWebServer/api-portal",
{
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
username: "your-user",
password: "your-password",
query: "1",
}),
}
);
const data = await res.json();
console.log(data.logintoken);Response format
All output from the portal is in JSON. The first field in every response is a requestcode indicating the success or otherwise of the request. If the request fails, only the requestcode is returned. See the request codes table for the full list.
Log into the API
Requestquery 1
| Key | Value |
|---|---|
username | The user name of the client in the SenseiQ Registry. |
password | The password of the client. |
query | 1 |
Response
{
"requestcode": 0,
"logintoken": 87856
}logintoken returned here can be used in future requests in place of the password.Log out of the API
Requestquery 2
| Key | Value |
|---|---|
username | The user name of the client. |
logintoken | The login token from query 1. |
query | 2 |
Response
{
"requestcode": 0
}Start data stream for a sensor
Requestquery 3
| Key | Value |
|---|---|
username | User name. |
logintoken | Login token. |
query | 3 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
Response
{
"requestcode": 0
}Stop data stream for a sensor
Requestquery 4
| Key | Value |
|---|---|
username | User name. |
logintoken | Login token. |
query | 4 |
Response
{
"requestcode": 0
}Get latest sensor measurements
Requestquery 5
| Key | Value |
|---|---|
username | User name. |
logintoken | Login token. |
query | 5 |
Response
{
"requestcode": 0,
"drift-mm": 0.2,
"drift-percent": 0.07,
"dx-mm": 0.14,
"dy-mm": -0.17,
"vx-mm/s": -0.3,
"vy-mm/s": 2.1,
"v-mm/s": 2.2,
"pitch-deg": 0.001,
"roll-deg": 0.002,
"wx-deg/s": 0,
"wy-deg/s": 0,
"ax-g": 0.001,
"ay-g": 0.0007,
"az-g": -0.0002
}Retrieve sensor list for a user
Requestquery 10
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 10 |
Response
{
"requestcode": 0,
"numberofsensors": 5,
"sensors": [
{
"sensormodel": "SenseiQ Premium",
"sensorname": "Proto-ISDS-1",
"localhost": "Proto-BB-1",
"owner": "Sense i Solutions Ltd",
"location": "Room 123",
"building": "SiSL HQ",
"city": "Christchurch",
"county": "New Zealand",
"deploymentstatus": "Deployed",
"deploymentstatuscode": 1
}
// …
]
}owner and location.Recent event alerts for a user's sensors
Requestquery 11
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 11 |
Returns details of all event alerts that occurred recently — typically the last 7 days, though this window may be altered by SiSL administrators.
Response
{
"requestcode": 0,
"numberofalerts": 15,
"alerts": [
{
"eventname": "NZ-ISDS-6_Event#133",
"date": "4.21:56am on 12/5/2025",
"duration-s": 34.6,
"sensor": {
"sensorname": "NZ-ISDS-6",
"localhost": "NZ-BB-6",
"sensororientation": "Sensor pointing up",
"floorseparation-mm": 2350
},
"deployment": {
"owner": "Sense i Solutions Ltd",
"location": "Room 123",
"building": "SiSL HQ",
"city": "Christchurch",
"county": "New Zealand"
},
"alertinfo": {
"orangethreshold-percent": 0.3,
"redthreshold-percent": 1.0,
"alertlevel": "Orange"
},
"maxstats": {
"maxdrift-percent": 0.75,
"maxdrift-mm": 12.4,
"maxdx-mm": 11.8,
"maxdy-mm": 3.1,
"maxax-g": 0.178,
"maxay-g": 0.012,
"maxaz-g": 0.056
}
}
// …
]
}Number of datasets for a sensor
A single shape serves four query codes — one per dataset family: 21 datasets, 41 events, 61 recordings, 81 tests.
Request
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 21 / 41 / 61 / 81 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 = sensor, 2 = server archive |
Response
{
"requestcode": 0,
"numberofdatasets": 17
}Dataset date/time
Codes 22 / 42 / 62 / 82.
Request
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 22 / 42 / 62 / 82 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 or 2 |
datasetnumber | 0-based index in the archive |
Response
{
"requestcode": 0,
"datasetdate": {
"datestring": "12.50:01pm on 25/6/2025",
"year": 2025,
"month": 6,
"day": 25,
"hour": 12,
"minute": 50,
"second": 1,
"nanosecond": 6578478,
"unixmillisecond": 123456789
}
}Dataset name
Codes 23 / 43 / 63 / 83. Parameters identical to query 22.
Response
{
"requestcode": 0,
"datasetname": "Proto-ISDS-1_Event#7"
}Dataset duration
Codes 24 / 44 / 64 / 84. Parameters identical to query 22.
Response
{
"requestcode": 0,
"duration-s": 37.22
}Dataset details
Codes 25 / 45 / 65 / 85. Parameters identical to query 22. The alertinfo and maxstats blocks appear only for events.
Response
{
"requestcode": 0,
"datasetname": "Proto-ISDS-1_Recording#2",
"datasettype": "Recording",
"duration-s": 60.45,
"datasetdate": {
"datestring": "4.21:56am on 12/5/2025",
"year": 2025, "month": 5, "day": 12,
"hour": 4, "minute": 21, "second": 56,
"nanosecond": 19877678,
"unixmillisecond": 123456789
},
"deployment": {
"owner": "Sense i Solutions Ltd",
"location": "Room 123",
"building": "SiSL HQ",
"city": "Christchurch",
"county": "New Zealand"
},
"alertinfo": {
"orangethreshold-percent": 0.3,
"redthreshold-percent": 1.0,
"alertlevel": "Orange"
},
"maxstats": {
"maxdrift-mm": 12.4,
"maxdrift-percent": 0.75,
"maxdx-mm": 11.8,
"maxdy-mm": 3.1,
"maxax-g": 0.178,
"maxay-g": 0.012,
"maxaz-g": 0.056
},
"layout": {
"sensororientation": "Sensor pointing up",
"floorseparation-mm": 2350
}
}All datasets details
Codes 26 / 46 / 66 / 86. Returns an array of dataset detail objects — same shape as query 25.
Request
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 26 / 46 / 66 / 86 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 or 2 |
Response
{
"requestcode": 0,
"numberofdatasets": 15,
"datasets": [
{
"datasetname": "Proto-ISDS-1_Recording#2",
"datasettype": "Recording",
"duration-s": 60.45,
"datasetdate": { "...": "…" },
"deployment": { "...": "…" },
"alertinfo": { "...": "events only" },
"maxstats": { "...": "events only" },
"layout": { "...": "…" }
}
// …
]
}46 / 66 / 86, the top-level key numberofdatasets is replaced by numberofevents, numberofrecordings, or numberoftests respectively; and datasets becomes events, recordings, or tests.Dataset details within a time period
Codes 27 / 47 / 67 / 87.
Request
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 27 / 47 / 67 / 87 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 or 2 |
starttimeperiod | Optional. Days before today. Default: pre-first-dataset. |
endtimeperiod | Optional. Days before today. Default: today. |
Response
{
"requestcode": 0,
"startdate": "9.00:00am on 4/3/2025",
"enddate": "5.00:00pm on 31/6/2025",
"numberofdatasets": 15,
"datasets": [
{ /* same detail shape as query 25 */ }
// …
]
}Retrieve dataset data
Codes 28 (by index) and 29 (latest). Returns the complete dataset with all time series. The shape below shows an event; recordings and tests differ slightly — see recordings and tests.
Request
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 28 or 29 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 or 2 |
datasetnumber | Required for 28. Not required for 29. |
Response
{
"requestcode": 0,
"dataset": {
"datasetinfo": {
"datasetname": "Proto-ISDS-1_Event#5",
"datasettype": "Event",
"sensorname": "Proto-ISDS-1",
"starttime": { /* date object */ },
"deployment": { /* deployment object */ },
"alertinfo": { /* only for events */ },
"layout": { "sensororientation": "…", "floorseparationinmm": 2250.0 }
},
"fieldnames": ["t (s)", "drift (mm)", "drift% (%)", "dx (mm)", "…"],
"fielddata": [
[0.000, 0.02, 0.00, 0.02],
[0.005, 0.12, "…"],
[0.010, 0.09, "…"]
// …
]
}
}null in the fielddata arrays.Retrieve event data
Codes 48 (by index) and 49 (latest). Structurally identical to queries 28 / 29 but constrained to events.
Retrieve recording data
Codes 68 (by index) and 69 (latest). Recordings are returned with separate optical and IMU time series.
Response
{
"requestcode": 0,
"dataset": {
"datasetinfo": { /* no alertinfo for recordings */ },
"opticalfieldnames": ["t (s)", "dxOpt (mm)", "…"],
"opticalfielddata": [
[0.00, 0.02],
[60.00, 0.01]
],
"imufieldnames": ["t (s)", "wx (deg/s)", "…"],
"imufielddata": [
[0.00, 0.02],
[60.00, 0.01]
]
}
}Retrieve test data
Codes 88 (by index) and 89 (latest). Same flat shape as query 28, constrained to tests.
Retrieve heartbeat data
Requestquery 101
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 101 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 or 2 |
Response
{
"requestcode": 0,
"dataset": {
"datasetinfo": { /* as per other datasets */ },
"fieldnames": ["t (day)", "drift (mm)", "drift% (%)", "dx (mm)", "…"],
"fielddata": [
[0.000, 0.02, 0.00, 0.02],
[0.005, 0.12, "…"],
[25.05, 0.01, "…"]
]
}
}days, not seconds.Dataset with selected fields, resampled
Query code 30 retrieves a dataset that includes only a chosen subset of time series, resampled at a lower frequency. Particularly useful for SenseiQ Lite sensors where bandwidth is constrained. A 10 Hz sampling rate (0.1 s time step) is a good default.
Request
| Key | Value |
|---|---|
username | User name. |
logintoken or password | Depending on login state. |
query | 30 |
sensorname | e.g. Proto-ISDS-1 |
hostname | e.g. Proto-BB-1 |
source | 1 or 2 |
datasetnumber | 0-based index |
fieldchoices | Bitwise-OR of field values — see Appendix A |
samplingtimestep | Float in seconds, e.g. 0.1F |
Response
Example: an event with only drift and dx, sampled at 10 Hz.
{
"requestcode": 0,
"dataset": {
"datasetinfo": { /* as per query 28 */ },
"fieldnames": ["t (s)", "drift (mm)", "dx (mm)"],
"fielddata": [
[0.00, 0.02, 0.01],
[0.10, 0.12, 0.05],
[0.20, 0.09, 0.02],
[25.00, 0.01, -0.04]
]
}
}Request Builder
Fill in the form below to generate a ready-to-run snippet for any API query. The builder composes the request locally — nothing is sent to the server.
curl -X POST 'https://isds-services.senseisolutions.co.nz/ISDSWebServer/api-portal' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data 'username=your-user&query=1&sensorname=Proto-ISDS-1&hostname=Proto-BB-1&source=1'Query code summary
A sensor can acquire three dataset types — events (captured during an earthquake), recordings (captured for a fixed period on command), and tests (captured during installation). The word dataset can refer to any of these. Heartbeat data is also queryable.
General
| Query | Response |
|---|---|
1 | Log into the API |
2 | Log out of the API |
3 | Start a live data stream for a sensor |
4 | Stop the live data stream for a sensor |
5 | Get the last measurement from a sensor |
10 | Retrieve a list of all sensors for a user |
11 | Retrieve recent event alerts for a user's sensors |
Dataset
| Query | Response |
|---|---|
21 | Number of datasets at source |
22 | Dataset date/time |
23 | Dataset name |
24 | Dataset duration |
25 | Dataset details |
26 | Details of all datasets |
27 | Details of all datasets in a period |
28 | Data of a dataset |
29 | Data of the latest dataset |
30 | Dataset data with selected fields, resampled |
Event
| Query | Response |
|---|---|
41 | Number of events |
42 | Event date/time |
43 | Event name |
44 | Event duration |
45 | Event details |
46 | Details of all events |
47 | Events in a period |
48 | Event data |
49 | Latest event data |
Recording
| Query | Response |
|---|---|
61 | Number of recordings |
62 | Recording date/time |
63 | Recording name |
64 | Recording duration |
65 | Recording details |
66 | Details of all recordings |
67 | Recordings in a period |
68 | Recording data |
69 | Latest recording data |
Test
| Query | Response |
|---|---|
81 | Number of tests |
82 | Test date/time |
83 | Test name |
84 | Test duration |
85 | Test details |
86 | Details of all tests |
87 | Tests in a period |
88 | Test data |
89 | Latest test data |
Heartbeat
| Query | Response |
|---|---|
101 | Heartbeat dataset |
Request codes
Every response includes a requestcode indicating success or failure. On failure, only this field is returned:
{ "requestcode": 12 }| Code | Meaning |
|---|---|
0 | Query was successful. |
1 | No registry information available. |
2 | The registry is offline. |
3 | Invalid user name. |
4 | Invalid password. |
5 | A new password must be set manually before access is granted. |
6 | The specified sensor is invalid. |
7 | An invalid source has been specified. |
8 | The requested source (sensor or archive) is offline. |
9 | The specified dataset is invalid. |
10 | Missing parameter. |
11 | Invalid parameter. |
12 | Invalid query code. |
13 | User data unavailable. |
14 | Invalid token. |
15 | User not logged into API. |
16 | User log in to API failed. |
17 | User log out of API failed. |
18 | Live data stream could not be started. |
19 | Invalid measurement. |
20 | Invalid event alerts. |
Appendix A · Field choices
Query code 30 allows you to retrieve a dataset containing only a selected subset of time series. The fieldchoices parameter specifies which fields are wanted; it is a long built by bitwise-OR-ing the values below.
To request drift, dx, dy, v, pitch, roll, wx, wy, ax, ay, az, OR the corresponding values together:
fieldchoices = 0x00F81810DL // trailing L signifies a long| Field | Value (hex) |
|---|---|
drift | 0x000000001L |
drift % | 0x000000002L |
dx | 0x000000004L |
dy | 0x000000008L |
dxOpt | 0x000000010L |
dyOpt | 0x000000020L |
dxRot | 0x000000040L |
dyRot | 0x000000080L |
v | 0x000000100L |
vx | 0x000000200L |
vy | 0x000000400L |
vxOpt | 0x000000800L |
vyOpt | 0x000001000L |
vxRot | 0x000002000L |
dvRot | 0x000004000L |
pitch | 0x000008000L |
roll | 0x000010000L |
wx | 0x000020000L |
wy | 0x000040000L |
ax | 0x000080000L |
ay | 0x000100000L |
az | 0x000200000L |
