# The API endpoint retrieves electricity consumption 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. Endpoint: GET /energy/electricity Version: v1 Security: ApplicationKey ## Query parameters: - `space.id` (string) Id of Space - `device.id` (string) Id of Device - `since` (any) Retrieve from this timestamp onwards - `until` (any) Retrieve until this timestamp - `continuationToken` (string) The continuation token to retrieve the next set of data. - `timezone` (string) The timezone to use for the data retrieval. If not specified, the timezone will be set to Space timezone offset to UTC. Example: "Europe/London" - `interval` (string) Interval for the data aggregation in the format number unit, where unit can be 'minute', 'hour', 'day', 'week', or 'month'. Example: "2 hours" - `breakdown` (string) The breakdown of the data to retrieve. If not specified, the data will be retrieved for the entire organisation. Enum: "device", "country" - `current` (string) The current time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC. Enum: "hour", "day", "week", "month", "year" - `previous` (string) The previous time period to retrieve data for. When specified, the return timestamps will be aligned to time period for each timezone in UTC. Enum: "hour", "day", "week", "month", "year" - `source` (string) The source of the data to retrieve. Where its grid, solar or wind. Enum: "grid", "solar", "wind", "generator", "other" - `flow` (string) Whether the energy usage is consumed or produced. View guides for an more in-depth usage. Enum: "consumption", "production", "import", "export" ## Response 200 fields (application/json): - `result` (array, required) - `result.energy` (string) Example: "1000" - `result.timestamp` (integer) Example: 1631707200000 - `continuationToken` (string,null) Example: "eyJ0bpo92Dd2twl7ko1="