Sending data to WiHi
WiHi welcomes any and all data contributions regardless of the underlying hardware manufacturer.
WiHi exposes a simple REST-based API (api.wihi.cc) for data contributions.
Hit the /station
endpoint with a POST
request containing your API key in the header as a bearer token. Your API key can be found in your profile.
A sample POST
request using curl
that can be executed from any terminal looks like this:
curl -X POST
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json" -d '{"station_id":...}'
https://api.wihi.cc/station
JSON format
Each individual observation should be a JSON object with the following schema:
{
"station_id": "string", // your WiHi station id
"timestamp_start": "int", // start timestamp of the observation
"timestamp_end": "int", // end timestamp of the observation
"precipitation": "float64", // also known as precipitation_accumulated by some manufacturers
"battery": "float64",
"leaf_wetness": "float64",
"temperature_avg": "float64",
"tempurature_max": "float64",
"temperature_min": "float64",
"relative_humidity_avg": "float64",
"relative_humidity_max": "float64",
"relative_humidity_min": "float64",
"dewpoint_avg": "float64",
"dewpoint_min": "float64",
"midnight": "int",
"pressure": "float64",
"wind_speed": "float64",
}
Note that:
-
the
station_id
must be specified, otherwise, the observation is dropped.station_id
's can currently be found in the user profile. -
if the observation is a point observation, omit the
timestamp_end
field. Conversely, if thetemperature_end
field is non-empty, then the observation is interpreted to be an (observation) range. -
if the station does not contain a particular observation type, it can be omitted. For example, if your station does not capture the
relative_humidity_avg
field, omit it in the observation JSON. -
each jsonl file has a max limit of 9MBs. If this is a limiting step for you, please contact us and we can build a custom pipeline!
If the data from your station doesn't look like the above or if you're unsure of anything, please ping us on discord or reach out to us by email!