To use the Hivemind API, you simply make a request to one of the URL endpoints below, using your API key.
All API requests begin with http://hivemind.co.nz/api/, and include the API key in the URL parameter named api_key. Our demo hub on the homepage is publicly available for testing with serial number H0 (no API key needed).
Request readings between two given dates.
URL and query parameters | ||
|---|---|---|
| URL:serial_number | Hub serial number | Specify which hub to show data for. |
| start_date | ISO-format datetime, UTC | Restrict readings to after this date. |
| end_date | ISO-format datetime, UTC | Restrict readings to before this date. |
| by_rows | Boolean (1 or 0) | Return readings as rows ordered by time, one column per series, instead of separate series. |
| column_labels | Boolean (1 or 0) | Values as key-value dicts, instead of structured lists. Verbose. |
[{"type": "weights"
"device": "S5566",
"hub": "H3834",
"readings": [
["2013-02-23 13:23:35", 57.5],
["2013-02-23 19:23:35", 58.4],
["2013-02-24 01:23:35", 59.1],
["2013-02-24 07:23:35", 60.1],
],
},
{"type": "battery"
"device": "S5566",
"hub": "H3834",
"readings": [
["2013-02-23 13:23:35", 0.8],
["2013-02-23 19:23:35", 0.8],
["2013-02-24 01:23:35", 0.8],
["2013-02-24 07:23:35", 0.8],
],
},
{...},
]
{"columns": ["time", "hub_serial", "S5566:weights", "S5566:battery"],
"records": [["2013-02-23 13:23:35", "H3834", 57.5, 0.8],
["2013-02-23 19:23:35", "H3834", 58.4, 0.8],
["2013-02-24 01:23:35", "H3834", 59.1, 0.8],
["2013-02-24 07:23:35", "H3834", 60.1, 0.8],
[...],
]
}
[{"time": "2013-02-23 13:23:35", "hub_serial": "H3834", "weight": 57.5, "battery": 0.8},
{"time": "2013-02-23 19:23:35", "hub_serial": "H3834", "weight": 58.4, "battery": 0.8},
{"time": "2013-02-24 01:23:35", "hub_serial": "H3834", "weight": 59.1, "battery": 0.8},
{"time": "2013-02-24 07:23:35", "hub_serial": "H3834", "weight": 60.1, "battery": 0.8},
{...},
]
Request new readings since previous request to /new/ for this hub.
URL and query parameters | ||
|---|---|---|
| URL:serial_number | Hub serial number | Specify which hub to show data for |
| by_rows and column_labels | As per /readings/ above | |
Reset date of previous request to /new/ and return all readings.
URL and query parameters | ||
|---|---|---|
| URL:serial_number | Hub serial number | Specify which hub to show data for |
| by_rows and column_labels | As per /readings/ above | |
Serial numbers and metadata for all hubs in your account.
{"H1234": {
"battery_level": 0.9,
"battery_quality": "good",
"label": "My hub",
"serial_number": "H1234",
},
"H5678": {
"battery_level": 0.5,
"battery_quality": "ok",
"label": "My other hub",
"serial_number": "H5678",
},
{...},
}
Serial numbers for all hubs in your account.
{"battery_level": 0.9,
"battery_quality": "good",
"label": "My hub",
"serial_number": "H1234",
}