Skip to main content
POST
/
devices
/
{device_id}
/
meters
/
search
Retrieve device meter records
curl --request POST \
  --url https://api.flatpeak.com/devices/{device_id}/meters/search \
  --header 'Content-Type: application/json' \
  --data '
{
  "device_id": "dev_63a6087272941ef077a8fd3e",
  "location_id": "loc_641b90b758fb8e6293716e40",
  "starting_after": "mre_69a696dbbd198e0ed4d57fcf",
  "ending_before": "mre_69c2375acb796746fd4ed963",
  "limit": 100,
  "group_by": "NON_FIXED",
  "order_by": "NEWEST",
  "energy_flow_direction": "IMPORT",
  "start_time": "2023-11-07T05:31:56Z",
  "end_time": "2023-11-07T05:31:56Z"
}
'
{
  "object": "list",
  "url": "/devices/{device_id}/meters/search",
  "has_more": true,
  "data": {
    "device_id": "dev_63a6087272941ef077a8fd3e",
    "id": "mre_69a696dbbd198e0ed4d57fcf",
    "object": "meter_log",
    "count": 34,
    "records": [
      {
        "start_time": "2023-11-07T05:31:56Z",
        "end_time": "2023-11-07T05:31:56Z",
        "energy_flow_direction": "IMPORT",
        "value": 5.41234
      }
    ]
  }
}

Path Parameters

device_id
string
required

Flatpeak Device ID

Body

application/json
device_id
string

Flatpeak Device ID

Example:

"dev_63a6087272941ef077a8fd3e"

location_id
string

Flatpeak Location ID

Example:

"loc_641b90b758fb8e6293716e40"

starting_after
string
Example:

"mre_69a696dbbd198e0ed4d57fcf"

ending_before
string
Example:

"mre_69c2375acb796746fd4ed963"

limit
integer

Page size of returned results. Default is 100, maximum is 25000 to give a full year of half-hourly consumption details.

Example:

100

group_by
string

Aggregates records over a specified time period. The default is that data is returned in non-fixed time periods. Accepted values are: NON_FIXED, HALF_HOUR, HOUR, DAY, WEEK, MONTH.

Example:

"NON_FIXED"

order_by
string

Ordering of data returned. Default is that data is returned in reverse order from latest available record. Valid values: OLDEST, to give results ordered forward. NEWEST, (default), to give results ordered from most recent backwards.

Example:

"NEWEST"

energy_flow_direction
enum<string>

Direction of energy flow this applies to. IMPORT (from grid) or EXPORT (to grid).

Available options:
IMPORT,
EXPORT
Example:

"IMPORT"

start_time
string<date-time>

RFC 3339 timestamp marking the start of the data window, e.g. 2023-06-15T09:00:00Z or 2023-06-15T08:00:00+01:00; use either UTC or time offset—if offsets differ, end_time takes precedence.

Example:

"2023-11-07T05:31:56Z"

end_time
string<date-time>

RFC 3339 timestamp marking the end of the data window, e.g. 2023-06-15T13:00:00Z or 2023-06-15T12:00:00+01:00; use either UTC or time offset—if offsets differ, end_time takes precedence; max range is 90 days.

Example:

"2023-11-07T05:31:56Z"

Response

200 - application/json

Example response

object
string
required

Object type, list.

Example:

"list"

url
string
required

Represents the URL slug for the object.

Example:

"/devices/{device_id}/meters/search"

has_more
boolean
required

Is set to true if more objects are available.

data
Meter Log · object