-
Notifications
You must be signed in to change notification settings - Fork 20
EN APIs
Change language: DE
next page: Pinouts NodeMCU v2, v3
We have some API endpoints to access the sensor data using GET requests and no credentials. The endpoints are covered here.
The API accepts the sensor data and serves as a basis for the graphical representation on https://maps.sensor.community/ . In addition, the data from the "public" sensors is exported as CSV once a day (around 8:00 am) and made available at http://archive.sensor.community/.
The API also receives the sensor data and saves it in a CSV file (one file per sensor and day). Furthermore, the data is stored in an InfluxDB database and graphically processed via Grafana. The file archive can be accessed at https://api-rrd.madavi.de/csvfiles.php, the graphical representation at https://api-rrd.madavi.de/grafana/d/GUaL5aZMz/pm-sensors?orgId=1 .
There are two domains where the same data is served.
- https://api.sensor.community - This is optimized for receiving data. DON'T use this to request data.
- https://data.sensor.community - This is faster and more reliable for serving data, so should be used for reporting cases. Where it is not supported for a certain endpoint, the previous domain must be used.
For performance reasons, data is not immediately available.
An endpoint covering data in the last minute is updated every minute. While an endpoint covering data for the last 24 hours is updated every 5 minutes.
- https://data.sensor.community/static/v1/data.json - all measurements of the last 5 minutes for all sensors.
-
https://data.sensor.community/airrohr/v1/filter/{query}
- all measurements of the last 5 minutes filtered by query-
type={sensor type}
: comma-separated list of sensor types, e.g. SDS011,BME280 -
area={lat,lon,distance}
: all sensors within a max radius e.g. 52.5200,13.4050,10 (Berlin) -
box={lat1,lon1,lat2,lon2}
: all sensors in a 'box' with the given coordinates e.g. 52.1,13.0,53.5,13.5 -
country={country code}
: comma-separated list of country codes. Example BE,DE,NL
-
Important: The client needs to send a user agent header. In the best case the user agent string should give us a chance to contact the source of i.e. excessive requests. (since 2022/11/04)
-
https://data.sensor.community/airrohr/v1/sensor/{apiID}/
- all measurements of the last 5 minutes for one sensor (NOT chipID. API-ID can be found by clicking on your sensor on the Map).
- https://data.sensor.community/static/v2/data.json - average of all measurements per sensor of the last 5 minutes for all sensors.
- https://data.sensor.community/static/v2/data.1h.json - average of all measurements per sensor of the last hour.
- https://data.sensor.community/static/v2/data.24h.json - average of all measurements per sensor of the 24 hours.
- https://data.sensor.community/static/v2/data.dust.min.json - same as data.json but dust sensors only .
- https://data.sensor.community/static/v2/data.temp.min.json - same as data.json but temp./humidity/air pressure sensors only.
For the NodeMCU, the chipID is used as the ID. For other systems, X-Sensor is composed of a name for the system (e.g. raspi for Raspberry) and a unique ID (Raspberry: Serial in /proc/cpuinfo).
Example POST for SDS011:
header
Content-Type: application/json
X-Pin: 1
X-Sensor: esp8266-12345678
**Data
{
"software_version": "your_version",
"sensordatavalues":[
{"value_type":"P1","value":"66.04"},
{"value_type":"P2","value":"53.32"}
]
}
Example POST for DHT22:
**Header
Content-Type: application/json
X-Pin: 7
X-Sensor: esp8266-12345678
**Data
{
"software_version": "your_version",
"sensordatavalues":[
{"value_type":"temperature","value":"22.30"},
{"value_type":"humidity","value":"34.70"}
]
}
Other sensors:
BMP180: value_types: temperature, pressure; X-Pin: 3
BME280: value_types: temperature, humidity, pressure; X-Pin: 11
PMS1003 - PMS 7003: value_types: P1 (PM10), P2 (PM2.5); X-Pin: 1
The address of the API endpoint for delivering the data is https://api.sensor.community/v1/push-sensor-data/ (or https://api-rrd.madavi.de/data.php for Madavi.de).
Don't send a timstamp with the data. This should be set by the server.
Opensensemap is a free platform for open sensor data. The website and API are open source. In addition to numerous projects that supply data to this platform, the fine dust sensor can also transfer its data to this platform. Users can display their values there and have them processed as a graph. A "box" created there has its own ID, which must be entered on the configuration page of the fine dust sensor. Then the API point must be activated in the configuration. Detailed description of the API: https://api.opensensemap.org/
Russian private air monitoring project. Consist of data receiving server and closed source map for displaying collected data. Data license is not currently specified. Archive data is not currently available. The data can be collected using API:
https://github.com/zakarlyukin/aircms/blob/master/docs/index.rst#push-sensors-data-to-storage
The data can be saved on a web server with this function. The "Send to own API" menu item on the configuration page of the fine dust sensor must be activated accordingly and the target address with server, path, port and optionally user and password must be entered. A simple PHP script is available for saving and later evaluating the data:
https://github.com/opendata-stuttgart/madavi-api/blob/master/data_simple.php
This saves the supplied data in a daily .csv file. The data is delivered in .json format and not in $_post format! This script can also be used as a basis for storing the data in your own database (program it yourself).
Issue #69 gives more hints and code examples for PHP:
https://github.com/opendata-stuttgart/meta/issues/69#issuecomment-314222830
Another example: a Python script as systemd service receives the data and sends it to Domoticz:
https://github.com/joba-1/airrohr2domoticz
Note: If HTTPS encryption is to be used, this must be done over port 443. The SSL certificate used on the server may be max. 2048 bits in size, because the memory of the NodeMCU can not handle more. Only the following SSL/TLS ciphers are supported (among other things for performance reasons):
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA\
InfluxDB is a special database for time-based measurements or events. If an own InfluxDB server is available, the sensor data can also be sent directly to it.
The default settings must be adapted accordingly for your own application. (Server, port, path, user) Only the address must be entered for the server, without additions such as HTTP or HTTPS, whereby the latter is not supported anyway.
Further information about InfluxDB
https://www.influxdata.com/
(For HTTPS, the same restrictions apply as for "Send to own API.")
- Wiki home, EN
- Bezugsquellen Einzelteile, EN
- Firmware einspielen, EN
- Zusammenbau der Komponenten (Schaltung), EN
- Zusammenbau der Komponenten (Montage Einzelteile), EN
- Sensor-Konfiguration, EN
- Eintrag in der Datenbank, EN
- Links (Grafiken, Sensor-Infos), EN
- Translations
- Data format
- APIs, EN
- Anschluss weitere Sensoren und Hardware
- Senden an Sensor.Community (z.B. mit Raspberry Pi)
- NodeMCU Pinouts v2, v3
- Datenblätter, Spezifikationen
- Unterstützte Sensoren
- Studien
- ähnliche Projekte
- Korrektur Luftfeuchte, EN
- EN: How to use the SDS011 as a mobile sensor
- FR: Comment utiliser SDS011 comme capteur PM mobile
- 2020-04-0 Stadtbücherei - Weihnachtsferien
- 2020-04-0 Shackspace
- 2020-03-24 Stadtbücherei - Weihnachtsferien
- 2020-03-10 Shackspace
- 2020-02-23 Stadtbücherei
- 2020-02-09 Shackspace
- 2020-01-0 Stadtbücherei
- 2020-01-0 Shackspace
- 2019-12-24 Stadtbücherei - Weihnachtsferien
- 2019-12-10 Shackspace
- 2019-11-26 Stadtbücherei
- 2019-11-12 Shackspace
- 2019-10-22 Stadtbücherei
- 2019-10-08 Shackspace
- 2019-09-24 Stadtbücherei
- 2019-09-10 Shackspace
- 2019-09-24 Stadtbücherei
- 2019-09-10 Shackspace
- 2019-08-27 Stadtbücherei
- 2019-08-13 Shackspace - Sommerferien
- 2019-07-23 Stadtbücherei
- 2019-07-09 Shackspace
- 2019-06-25 Stadtbücherei
- 2019-06-11 Shackspace - Pfingstferien
- 2019-05-28 Stadtbücherei
- 2019-05-14 Shackspace
- 2019-04-23 Stadtbücherei - Osterferien
- 2019-04-09 Shackspace
- 2019-03-26 Stadtbücherei
- 2019-03-12 Shackspace
- 2019-02-26 Stadtbücherei
- 2019-02-12 Shackspace
- 2019-01-22 Stadtbücherei
- 2019-01-08 Shackspace
- 2018-12-18 Stadtbücherei - Weihnachtsferien
- 2018-12-11 Shackspace
- 2018-11-27 Stadtbücherei
- 2018-11-13 Shackspace
- 2018-10-23 Stadtbücherei
- 2018-10-09 Shackspace
- 2018-09-25 Stadtbücherei
- 2018-09-11 Shackspace
- 2018-08-28 Stadtbücherei
- 2018-08-14 Shackspace - Sommerpause
- 2018-07-24 Stadtbücherei
- 2018-07-10 Shackspace
- 2018-06-26 Stadtbücherei
- 2018-06-12 Shackspace
- 2018-05-22 Stadtbücherei
- 2018-05-08 Shackspace
- 2018-04-24 Stadtbücherei
- 2018-04-10 Shackspace
- 2018-03-27 Stadtbücherei
- 2018-03-13 Shackspace
- 2018-03-03 Open Data Day 2018
- 2018-02-27 Stadtbücherei
- 2018-02-13 Shackspace
- 2018-01-23 Stadtbücherei
- 2018-01-09 Shackspace
- 2017-12-26 Stadtbücherei
- 2017-12-12 Shackspace
- 2017-11-28 Stadtbücherei
- 2017-11-14 Shackspace
- 2017-10-24 Stadtbücherei
- 2017-10-10 Shackspace
- 2017-09-26 Stadtbücherei
- 2017-09-12 Shackspace
- 2017-08-22 Stadtbücherei
- 2017-08-08 Shackspace
- 2017-07-25 Stadtbücherei
- 2017-07-11 Shackspace
- 2017-06-27 Stadtbücherei
- 2017-06-13 Shackspace
- 2017-05-23 Stadtbücherei
- 2017-05-09 Shackspace
- 2017-04-25 Stadtbücherei
- 2017-04-11 Shackspace
- 2017-03-28 Stadtbücherei
- 2017-03-14 Shackspace
- 2017-03-04 Open Data Day 2017
- 2017-02-28 Stadtbücherei
- 2017-02-14 Shackspace
- 2017-01-24 Stadtbücherei
- 2017-01-10 Shackspace
- 2016-12-20 Stadtbücherei
- 2016-12-13 Shackspace
- 2016-11-22 Stadtbücherei
- 2016-11-08 Shackspace
- 2016-10-25 Stadtbücherei
- 2016-10-11 Shackspace
- 2016-09-27 Stadtbücherei
- 2016-09-13 Shackspace
- 2016-08-23 Stadtbücherei
- 2016-08-09 Shackspace
- 2016-07-26 Stadtbücherei
- 2016-07-12 Shackspace
for more, see Protokolle