Skip to main content
POST
/
meters
/
records
Retrieve meter records
curl --request POST \
  --url https://api.flatpeak.com/meters/records \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "dev_63a6087272941ef077a8fd3e",
  "starting_after": "mre_69a696dbbd198e0ed4d57fcf",
  "ending_before": "mre_69c2375acb796746fd4ed963",
  "limit": 100,
  "group_by": "NON_FIXED",
  "order_by": "NEWEST",
  "energy_flow_direction": "INBOUND",
  "start_time": "2023-11-07T05:31:56Z",
  "end_time": "2023-11-07T05:31:56Z"
}
'
{
  "object": "list",
  "url": "/site-meters",
  "has_more": true,
  "data": {
    "count": 123,
    "energy_flow_direction": "INBOUND",
    "records": [
      {
        "start_time": "2023-11-07T05:31:56Z",
        "end_time": "2023-11-07T05:31:56Z",
        "value": 123,
        "confidence": 1
      }
    ],
    "id": "mre_69a696dbbd198e0ed4d57fcf",
    "object": "meter_log",
    "device_id": "dev_63a6087272941ef077a8fd3e"
  }
}

Authorizations

Authorization
string
header
required

Authenticate with bearer you obtained from authentication endpoint.

Body

application/json
id
string

Flatpeak Device ID

Example:

"dev_63a6087272941ef077a8fd3e"

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
string

Energy flow direction. Set to INBOUND or OUTBOUND. Defaults to INBOUND.

Example:

"INBOUND"

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

Represents the object’s type. i.e. list.

Example:

"list"

url
string
required

Represents the URL slug for the object.

Example:

"/site-meters"

has_more
boolean
required

Is set to true if more objects are available.

data
Meter Log · object