Welcome to the Smart Biogas REST API documentation!
API tokens are distributed to users with administration roles. If you are an administrator, log in to Smart Biogas and go to the 'My Organisation' section of the platform. Here you will see an API key that is unique to your user. You will need to submit this key in an authorization header along with every request you make. If you do not see your API key, get in touch with a member of staff at support@smart-biogas.com
Root end point: https://app.smartbiogas.io/api/v1/
At present, there is 1 API endpoints available:
With each request, include the provided API token as an authorization header as follows:
Authorization: Token <token>
GET /devices/<deviceID>/reports
This allows you to retrieve all data reports from a particular device given a date-time range. The start of the range is inclusive and the end is exclusive. The date-time range is provided via the query parameters start and end as integer unix timestamps at the granularity of a second. The endpoint allows you to retrieve up to 30 days of data at a time.
Devices send data every ~1 hour but you will see timestamp, pressure and flow data for every 1 minute. All other data is only provided once an hour.
curl -H "Authorization: Token <token>" "https://app.smartbiogas.io/api/v1/devices/<device_id>/reports?start=1610542493&end=1610546064"
Outputs
Parameter |
Type | Description |
timestamp | number | Unix Timestamp for the creation of the data report in seconds. |
static_pressure_pa | number |
The static pressure in pascal. |
flow_lph | number | The flow of gas in litres per hour. |
gas_consumption_l | number | Gas consumption counter in litres. |
battery_v | number | Battery voltage at the time of sending in volts. |
battery_a | number | Battery amperage at the time of sending in amps. |
solar_v
|
number | The voltage of the solar input at the time of sending in volts. |
temperature_degc
|
number | The temperature in degrees of Celcius. |
rssi_db
|
number |
Signal strength in dB. The scale is from 0 to -120. The closer to 0, the stronger the signal. |