Skip to content

Variable API

The Variable API provides REST access to the live and historical values of inSCADA variables.

Reads the live value of a single variable.

Terminal window
curl -b cookies.txt http://localhost:8081/api/variables/23227/value \
-H "X-Space: claude"

Response:

{
"flags": { "scaled": true },
"date": "2026-03-28T11:50:25.959+03:00",
"value": 330.48,
"extras": { "raw_value": 606.56 },
"variableShortInfo": {
"dsc": "Total active power",
"frame": "Energy-Frame",
"project": "Energy Monitoring Demo",
"device": "Energy-Device",
"name": "ActivePower_kW",
"connection": "LOCAL-Energy"
},
"dateInMs": 1774687825959
}

Reads the live values of multiple variables in bulk.

ParameterTypeDescription
projectIdIntegerProject ID
namesStringComma-separated variable names
Terminal window
curl -b cookies.txt \
"http://localhost:8081/api/variables/values?projectId=153&names=ActivePower_kW,Voltage_V,Current_A" \
-H "X-Space: claude"

Response:

{
"ActivePower_kW": {
"flags": { "scaled": true },
"date": "2026-03-28T11:50:33.950+03:00",
"value": 323.66,
"extras": { "raw_value": 606.56 },
"variableShortInfo": {
"name": "ActivePower_kW",
"dsc": "Total active power",
"project": "Energy Monitoring Demo"
},
"dateInMs": 1774687833950
},
"Voltage_V": {
"flags": { "scaled": true },
"value": 236.7,
"extras": { "raw_value": 228.0 },
"variableShortInfo": { "name": "Voltage_V", "dsc": "Line voltage" }
},
"Current_A": {
"flags": { "scaled": true },
"value": 33.12,
"extras": { "raw_value": 58.92 },
"variableShortInfo": { "name": "Current_A", "dsc": "Line current" }
}
}

Writes a value to a variable.

Terminal window
curl -b cookies.txt -X POST http://localhost:8081/api/variables/23234/value \
-H "X-Space: claude" -H "Content-Type: application/json" \
-d '{"value": 55.0}'

Queries logged variable data with pagination.

ParameterTypeDescription
projectIdIntegerProject ID
namesStringComma-separated variable names
startDateLongStart time (epoch ms)
endDateLongEnd time (epoch ms)
pageIntegerPage number (starts from 0)
sizeIntegerPage size

Returns statistics for a specified time range.

ParameterTypeDescription
projectIdIntegerProject ID
namesStringComma-separated variable names
startDateLongStart time (epoch ms)
endDateLongEnd time (epoch ms)

GET /api/variables/loggedValues/stats/hourly

Section titled “GET /api/variables/loggedValues/stats/hourly”

Hourly grouped statistics.

GET /api/variables/loggedValues/stats/daily

Section titled “GET /api/variables/loggedValues/stats/daily”

Daily grouped statistics.

MethodEndpointDescription
GET/api/variables?projectId=XVariable list
GET/api/variables/{id}Variable details
POST/api/variablesCreate a new variable
PUT/api/variables/{id}Update a variable
DELETE/api/variables/{id}Delete a variable
Terminal window
curl -b cookies.txt "http://localhost:8081/api/variables?projectId=153" \
-H "X-Space: claude"

Response (abbreviated):

[
{
"id": 23227,
"name": "ActivePower_kW",
"dsc": "Total active power",
"type": "Float",
"unit": "kW",
"projectId": 153,
"connectionId": 153,
"deviceId": 453,
"frameId": 703,
"logType": "Periodically",
"logPeriod": 10,
"engZeroScale": 0.0,
"engFullScale": 1000.0,
"fractionalDigitCount": 2,
"isActive": true,
"keepLastValues": true
},
{
"id": 23229,
"name": "Voltage_V",
"dsc": "Line voltage",
"type": "Float",
"unit": "V",
"engZeroScale": 200.0,
"engFullScale": 260.0
}
]