Reference for the JSON endpoints behind the UI pages. Person names go in the
URL exactly as they appear in persons.lst, URL-encoded if they contain
spaces (e.g. /measurements/Seres%20Dezso -- replace the whole
:person placeholder, colon included). Errors come back as
{"error": "..."} with status 400.
| Method | Path | Returns |
|---|---|---|
| GET | /persons |
Array of person display names from persons.lst. |
| GET | /measurements/:person |
The person's whole data file in the packed format described below (just the header if nothing is logged yet). |
| GET | /last/:person |
The newest measurement as {"timestamp","sys","dia","pulse","local"},
or null if there is none. timestamp is UTC epoch-ms,
local the Europe/Budapest time as yyyy/mm/dd hh:mm.
|
| Method | Path | Body / notes |
|---|---|---|
| POST | /measurement |
JSON body {"person","sys","dia","pulse","timestamp"}.
timestamp is optional (empty = now), otherwise
YYYY-MM-DDTHH:MM in Europe/Budapest time. Returns the saved
measurement (same shape as /last). A measurement newer than
the last one is appended to the file's end; an older (backfilled) one
triggers a sorted rewrite of the file.
|
| PUT | /last |
JSON body {"person","sys","dia","pulse"}. Overwrites the values
of the newest measurement; its time stays. 400 if the person
has no measurement yet.
|
| DELETE | /last/:person |
Deletes the newest measurement and returns it (same shape as
/last). 400 if there is none.
|
Systolic 50-300, diastolic 30-200, pulse 20-250,
and systolic must be greater than diastolic. The person must be listed in
persons.lst.
One file per person, data/<name>.fastjson (also served under
/data/): a flat JSON array. The first cell is the number of fields per
record, then the field names, then the records back to back, oldest first:
[4,"epoch","sys","dia","pulse", 1792002600000,130,85,70, 1792044000000,120,80,60]
epoch is UTC epoch milliseconds.
# log a measurement now
curl -X POST http://localhost:8905/measurement \
-H "Content-Type: application/json" \
-d '{"person":"Seres Dezso","sys":120,"dia":80,"pulse":60}'
# backfill one
curl -X POST http://localhost:8905/measurement \
-H "Content-Type: application/json" \
-d '{"person":"Seres Dezso","sys":125,"dia":82,"pulse":64,"timestamp":"2026-10-14T08:00"}'
# all measurements of a person (packed format, see above)
curl http://localhost:8905/measurements/Seres%20Dezso
# newest measurement
curl http://localhost:8905/last/Seres%20Dezso
# fix the newest one's values
curl -X PUT http://localhost:8905/last \
-H "Content-Type: application/json" \
-d '{"person":"Seres Dezso","sys":118,"dia":76,"pulse":62}'
# delete the newest one
curl -X DELETE http://localhost:8905/last/Seres%20Dezso
Log a measurement
Month view
Year overview