The current fixed stations are stored in an InfluxDB database service, each station write a data series time in separated tables. We will change it to different schema soon. For now the next endpoints are enabled.
For now, the shared series time of each stations could be listed in our Grafana dashboard here:
Each series time could be fetched via the next endpoint:
the full documentation of InfluxDB query syntax could be consulted here
curl -G 'http://influxdb.canair.io:8086/query?db=canairio' --data-urlencode 'q=select * from "PM25_Berlin_CanAirIO_v2" WHERE time >= now() - 12h' > PM25_Berlin_CanAirIO_v2.json
Fixed stations names
For get the complete list of fixed stations names:
curl -G 'http://influxdb.canair.io:8086/query?db=canairio' --data-urlencode 'q=show measurements'
But the more important stations of CanAirIO with more stable data is listed here.
In your OS please install before the
python3-virtualenv package, then:
create and activate your virtual space:
virtualenv venv && source venv/bin/activate
install the next package for run the test:
pip3 install influxdb ipython
enter to ipython console with the command
ipython and execute the next lines for import the influxDb client and instance it:
from influxdb import InfluxDBClient client = InfluxDBClient(host='influxdb.canair.io', port=8086, database='canairio')
after that, run a query:
client.query('select * from "PM2.5_BOG_FON_Hayuelos_E01" WHERE time >= now() - 10m')
you should have an output similar to next:
for get the all names of fixed stations:
All tracks request
For now we don’t have this development, CanAirIO is a opensource initiative and you able to send any pull request for help us in improve our API. For now we have published some backups of last one year, for example:
Please read the
README file in the link for details.