Devices are a representation of objects that are connected to the Wia platform and can be used to collect data from the environment. The objects can be physical sensors, cloud integrations or manual uploads.
Wia REST API reference (v1)
A REST API to interact with Wia platform to enable external applications to analyse energy consumption and to automate internal operations relating to the capturing and grouping of energy consumption.
To get started, please ensure you have the correct permissions and appropriate key. If you have not been provided a key, please contact your representative.
The API is organised around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Request
The API endpoint retrieves electricity consumption data in kilowatt-hours (kWh) from electricity meters.
The endpoint utilizes the underlying data from the meters to calculate and return the energy consumed by a customer during a given time period.
To use the API endpoint, the user will need to provide the necessary information, such as the date range for which they wish to retrieve data, the device id or space id to which a group of devices belong, and any other relevant parameters.
The endpoint will then gather underlying stores of meter readings and calculate the total energy consumed by the customer for a specified time resolution
The energy consumption data will be returned in kWh, which is the standard unit of measurement for electricity consumption and the time units are in UTC.
If the metres use current usage to read energy consumption, that is also outputted by the API endpoint with the same format as power consumption.
This API endpoint can be useful for a variety of applications, such as tracking energy usage for billing purposes, identifying energy-saving opportunities, and monitoring energy usage for sustainability initiatives.
The timezone to use for the data retrieval. If not specified, the timezone will be set to Space timezone offset to UTC.
Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'.
The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation.
The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.
The previous time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.
The source of the data to retrieve. Where its grid, solar or wind.
- Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/electricity
- Production
https://api.wia.io/v1/energy/electricity
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/electricity?space.id=string&device.id=string&since=2022-01-01T00%3A00%3A00Z&until=2022-01-01T00%3A00%3A00Z&continuationToken=string&timezone=Europe%2FLondon&interval=2+hours&breakdown=device¤t=hour&previous=hour&source=grid&flow=consumption' \
-H 'Authorization: Bearer <YOUR_Bearer_HERE>'{ "devices": { "dev_abc123": [ … ], "dev_def456": [ … ] }, "result": [ { … } ], "continuationToken": "eyJ0bpo92Dd2twl7ko1=" }
Request
The API endpoint retrieves Gas consumption data in (m³) from gas meters.
The endpoint utilizes the underlying data from the meters to calculate and return the gas consumed by a customer during a given time period.
To use the API endpoint, the user will need to provide the necessary information, such as the date range for which they wish to retrieve data, the device id or space id to which a group of devices belong, and any other relevant parameters.
The endpoint will then gather underlying stores of meter readings and calculate the total gas consumed by the customer during the specified time period such as 15 minutes, 2 hours, 1 day etc.
The gas consumption data will be returned in m³, which is the standard unit of measurement for gas consumption and the time units are in UTC.
This API endpoint can be useful for a variety of applications, such as tracking gas usage for billing purposes, identifying consumption saving opportunities, and monitoring usage for sustainability initiatives.
Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'.
The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation.
The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.
- Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/gas
- Production
https://api.wia.io/v1/energy/gas
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/gas?space.id=string&device.id=string&since=2022-01-01T00%3A00%3A00Z&until=2022-01-01T00%3A00%3A00Z&continuationToken=string&interval=2+hours&breakdown=device¤t=hour&previous=hour' \
-H 'Authorization: Bearer <YOUR_Bearer_HERE>'{ "devices": { "dev_abc123": [ … ], "dev_def456": [ … ] }, "result": [ { … } ], "continuationToken": "eyJ0bpo92Dd2twl7ko1=" }
Request
The API endpoint retrieves Water consumption data in (m³) from water meters.
The endpoint utilizes the underlying data from the meters to calculate and return the water consumed by a customer during a given time period.
To use the API endpoint, the user will need to provide the necessary information, such as the date range for which they wish to retrieve data, the device id or space id to which a group of devices belong, and any other relevant parameters.
The endpoint will then gather underlying stores of meter readings and calculate the total water consumed by the customer during the specified time period such as 15 minutes, 2 hours, 1 day etc.
The water consumption data will be returned in m³, which is the standard unit of measurement for water consumption and the time units are in UTC.
This API endpoint can be useful for a variety of applications, such as tracking water usage for billing purposes, identifying consumption saving opportunities, and monitoring usage for sustainability initiatives.
The timezone to use for the data retrieval. If not specified, the timezone will be set to Space timezone offset to UTC.
Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'.
The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation.
The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC.
- Mock server
https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/water
- Production
https://api.wia.io/v1/energy/water
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.wia.io/_mock/apis/wia-rest-api/docs/energy/water?space.id=string&device.id=string&since=2022-01-01T00%3A00%3A00Z&until=2022-01-01T00%3A00%3A00Z&continuationToken=string&timezone=Europe%2FLondon&interval=2+hours&breakdown=device¤t=hour&previous=hour' \
-H 'Authorization: Bearer <YOUR_Bearer_HERE>'[ { "id": "1234-abcd-5678-efgh", "name": "Test Event", "data": { … }, "timestamp": 1631707200000 } ]