-
Notifications
You must be signed in to change notification settings - Fork 7
API Documentation
Interactive documentation:
Staging: https://staging.api.sensors.africa
Production: https://api.sensors.africa
NOTE: [WIP] Is not in production but may be working in staging.
We have some 'API' endpoints to access the sensor data. The data is saved once a minute due to performance reasons:
http://api.sensors.africa/v1/now/ - all measurements of the last 5 minutes for all publicly accessible sensors
http://api.sensors.africa/v1/data/ - all measurements for all publicly accessible sensors in our database
http://api.sensors.africa/v1/sensor/{apiID}/ - all measurements of the last 5 minutes for one sensor
http://api.sensors.africa/v2/cities - get all supported cities
http://api.sensors.africa/v2/data/air - get average, min and max for air data for all cities
- city = {city slug} ; filter city using slug e.g. dar-es-salaam. Example
- from = {YYYY-mm-dd} ; filter results from date. Example
- to = {YYYY-mm-dd} ; filter results to date which must be provided with from. Example
- value_type = {sensor value type} ; comma separated list of value types P1,P2,temperature,humidity. Example
[WIP] http://api.sensors.africa/v1/filter/{query} - 5 minutes filtered by query:
- type = {sensor type}: comma separated list of sensor types, i.e. 'SDS011, BME280'
- area = {lat, lon, distance}: all sensors within a max. radius
- box = {lat1, lon1, lat2, lon2}: all sensors in a 'box' with the given coordinates
- country = {country code}: i.e. 'KE, TZ, NG, ZA, ...'
[WIP] http://api.sensors.africa/static/v2/data.json - average of all measurements per sensor of the last 5 minutes for all sensors
[WIP] http://api.sensors.africa/static/v2/data.1h.json - average of all measurements per sensor of the last hour
[WIP] http://api.sensors.africa/static/v2/data.24h.json - average of all measurements per sensor of the 24 hours
[WIP] http://api.sensors.africa/static/v2/data.dust.min.json - same as data.json but dust sensors only
[WIP] http://api.sensors.africa/static/v2/data.temp.min.json - same as data.json but temp./humidity/air pressure sensors only