ClimateSafe
Using our API is easy. Using any language, make an HTTP request to our server at any of the endpoints below and receive your response in JSON
format! In order for us to continue providing this service, please do not make spam or unnecessarily large numbers of requests to any API endpoint.
Retrive all raw, unprocessed data points from our database. No parameters required :)
GET
/api/get-all-data
const resp = await fetch("/api/get-all-data");
const data = await resp.json();
{
"data": {
"summary": {
"numDataPoints": 961,
"numDataPointsLast24Hours": 906
},
"full_data": [
{
"_id": "62cc793d8c34511237db59d9",
"created_at": "2022-07-11T19:25:49.776Z",
"temp": null,
"humidity": null,
"co": null,
"combust_gas": null,
"gas_smoke": null,
"phot_sensitive": null,
"air_pollution": null,
"alert": false,
"hardware_id": "demo-board",
"lpg": null,
"alertSent": false
},
{
"_id": "62cc79df283305f3431720af",
"created_at": "2022-07-11T19:28:31.471Z",
"temp": null,
"humidity": null,
"co": null,
"combust_gas": null,
"gas_smoke": null,
"photo_sensitive": null,
"air_pollution": null,
"alert": false,
"hardware_id": "demo-board",
"lpg": null,
"alertSent": false
},
{
"_id": "62cc7aa0283305f3431720b0",
"created_at": "2022-07-11T19:31:44.010Z",
"temp": "26",
"humidity": "40",
"co": "8",
"combust_gas": "smoke",
"gas_smoke": "40",
"photo_sensitive": null,
"air_pollution": "50",
"alert": "true",
"hardware_id": "demo-board",
"lpg": null,
"alertSent": false
},
{
"_id": "62cc7aba283305f3431720b1",
"created_at": "2022-07-11T19:32:10.478Z",
"temp": "26",
"humidity": "40",
"co": "8",
"combust_gas": "smoke",
"gas_smoke": "40",
"photo_sensitive": null,
"air_pollution": "50",
"alert": "true",
"hardware_id": "demo-board",
"lpg": null,
"alertSent": false
},
{
"_id": "62cc7ad4283305f3431720b2",
"created_at": "2022-07-11T19:32:36.001Z",
"temp": "26",
"humidity": "40",
"co": "8",
"combust_gas": "smoke",
"gas_smoke": "40",
"photo_sensitive": "true",
"air_pollution": "50",
"alert": "true",
"hardware_id": "demo-board",
"lpg": null,
"alertSent": false
}
]
}
Retrive a summary of the averages of all data points
GET
/api/averages
const resp = await fetch("/api/averages");
const data = await resp.json();
{
"data": {
"coAvg": 8.33795870833334,
"tempAvg": 24.321410586062402,
"humidityAvg": 50.83711167086482
}
}