Skip to content

chillibits/particulate-matter-api

Repository files navigation

Particulate Matter API

Codacy Badge CI Master CI Develop codecov Uptime Robot ratio (7 days)

This is the ChilliBits Particulate Matter REST API.

Attention: This repository is still in development. Up to now, there's no stable API version.

Data Structure (MySQL database)

Data structure

The actual measurement data gets collected in a MongoDB to keep the performance up.

Features

  • Chart endpoint

    • Get chart from single sensor in a specific time span
    • Get chart from country average in a specific time span with a certain period
    • Get chart from city average in a specific time span with a certain period
  • Client endpoint

    • Get all clients, which are registered in the system
    • Get information about a single client by its name
  • Data endpoint

    • Get data records from single sensor in a specific time span
    • Get data records from single sensor in a specific time span in a compressed form to reduce transmission capacity
    • Get the latest data record from single sensor
    • Get average of the latest records of specific sensors
    • Get data records from country in a specific time span
    • Get average out of the latest data records of sensors within a specific country
    • Get data records from city in a specific time span
    • Get average out of the latest data records of sensors within a specific city
  • Push endpoint

    • Endpoint for data transmissions (more details in the section 'push endpoint')
  • Ranking endpoint

    • Get ranking by country
    • Get ranking by country in a compressed form
    • Get ranking by city
    • Get ranking by city in a compressed form
  • Sensor endpoint

    • Add a sensor to the database
    • Update a sensor that already exists in the database
    • Get all sensors
    • Delete a sensor from the database
  • Stats endpoint

    • Get stats about the api
  • User endpoint

    • Add user to the database
    • Update an existing user
    • Get user by its email
    • Delete user from the database

Usage

The API documentation can be found at api.pm.chillibits.com.

If any questions occur, please feel free to reach out to us via email.

Push endpoint

If you have a sensor from luftdaten.info / sensor.community, you simply have to enable the option 'Feinstaub-App' in the APIs section. The data gets transmitted to our server automatically.

If you have built your own IoT device, you can also send data to our system. Setup the connection as follows:

  • Request type: POST request
  • Host: api.pm.chillibits.com
  • Schema: http / https
  • Port: 80 / 443

Note: Please use http for the data transmission from sensors to our API and https for transmissions between our API and your service.

The required data format can be found in our API documentation at api.pm.chillibits.com

Register an application

If you're the developer of an application and want to consume data from our API, you have to contact us via email. The registration process is as follows:

  • We'll check the code of your application to ensure, that you're not using our data incorrectly or with a malicious intention. Therefore, we only accept open source applications.
  • After this verification, we send you a mail with all required information and ask you for required information about you / your organization and your application.
  • You answer the mail with all the required information
  • We'll create a client record, which will have the appropriate access rights for our endpoints
  • Let's go and start building your awesome application.

© ChilliBits 2019 - 2021 (Designed and developed by Marc Auberer)