Getting Started¶
The REST JSON API has a single endpoint that returns everything at once: connected devices, their live sensor readings, and the product specifications. The fastest way to understand it is to walk through a real session.
For these examples we use curl and jq — feel free to use any HTTP client you prefer, the sequence is always the same.
Step 1 — Install Dracal Utilities¶
Download and install the Dracal Utilities installer from the download page. This installs the Dracal Device Service, which exposes the REST JSON API on your machine.
Step 2 — Plug in a device¶
Connect a Dracal device to your computer via USB. The service will detect it automatically.
Step 3 — Discover connected devices¶
Query the API to see what devices are plugged in:
curl -s http://localhost:11395/3.6.0/devices/usb | jq ".devices | keys"
curl -s http://localhost:11395/3.6.0/devices/usb | jq '.devices | keys'
curl -s http://localhost:11395/3.6.0/devices/usb | jq '.devices | keys'
Output:
[
"E22421"
]
The response tells us that one device is connected: serial number E22421. That serial number is the key we'll use to access everything about this device.
Step 4 — Discover channels¶
Now let's find out what measurements this device can provide:
curl -s http://localhost:11395/3.6.0/devices/usb | jq ".devices[\"E22421\"].channel_list"
curl -s http://localhost:11395/3.6.0/devices/usb | jq '.devices["E22421"].channel_list'
curl -s http://localhost:11395/3.6.0/devices/usb | jq '.devices["E22421"].channel_list'
Output:
[
"atmospheric_pressure",
"temperature",
"relative_humidity",
"dew_point",
"humidex",
"heat_index",
"altitude"
]
Seven channels available. The first three (atmospheric_pressure, temperature, relative_humidity) are direct hardware measurements. The last four (dew_point, humidex, heat_index, altitude) are virtual channels — values computed from the physical readings rather than measured directly by a sensor.
Since we care about the three physical channels, let's read all of them in the next step.
Step 5 — Get values¶
All three physical channels can be read in a single query:
curl -s http://localhost:11395/3.6.0/devices/usb | jq ".devices[\"E22421\"].channels | {atmospheric_pressure: .atmospheric_pressure.value, temperature: .temperature.value, relative_humidity: .relative_humidity.value}"
curl -s http://localhost:11395/3.6.0/devices/usb | jq '.devices["E22421"].channels | {atmospheric_pressure: .atmospheric_pressure.value, temperature: .temperature.value, relative_humidity: .relative_humidity.value}'
curl -s http://localhost:11395/3.6.0/devices/usb | jq '.devices["E22421"].channels | {atmospheric_pressure: .atmospheric_pressure.value, temperature: .temperature.value, relative_humidity: .relative_humidity.value}'
Output:
{
"atmospheric_pressure": { "magnitude": 101.956, "unit": "kPa", "timestamp": "2026-03-04T18:42:51.593Z" },
"temperature": { "magnitude": 22.96, "unit": "°C", "timestamp": "2026-03-04T18:42:51.593Z" },
"relative_humidity": { "magnitude": 24.26, "unit": "%rh", "timestamp": "2026-03-04T18:42:51.593Z" }
}
Every reading follows the same structure: a numeric magnitude, its unit, and a UTC timestamp.
Next steps¶
You now know enough to retrieve any sensor value from any connected device. The Explained section covers the full response structure in detail, and the Examples page has more curl/jq recipes for common tasks.