Barry's Open API JSON-RPC (1.2.0)

Download OpenAPI specification:Download

Barry Denmark APS: hello@barry.energy URL: https://barry.energy License: GPLv3

Introduction

This is Barry's API, an API available to all customers that want to develop custom integrations with Barry. Barry's API is made with JSON-RPC, an API similar to JSON-REST. Sadly there is no good JSON-RPC framework, and we have instead adopted Swagger. This means that we have taken some shortcuts to adapt to the JSON-REST standard. The API is currently in beta and contains only a limited set of methods one can call. We plan to enrich this API in the future with more of the data we have in the app.

Rate Limits

The Barry API is rate-limited to ensure fair and sound use of the resources. Only a certain number of requests are allowed. Barry reserves the right to adjust the rate limit for a given endpoint to provide a high quality of service for all clients. The current limits are:

  • Short Time Throttle - The current limit is set to 3 calls every 3 minutes.

  • Long Time Throttle - The current limit is set to 500 calls every 24 hours.

Data

The API is still currently in beta, and thus, we only expose a few datatypes in the API. We will open up for more information as we go. Note that all datetimes are in UTC and using the ISO 8601 without timezone! The data available in the API are:

  • Get Spot Price - Gives the spot prices in the specified from/to range. Spot prices are delivered ahead of our current time, up to 24 hours ahead. The price is excluding VAT and tariffs.

  • Get Metering Points - Gives information on all of your metering points subscribed to Barry. This method contains metadata on your metering points, including the price area and the MPID/PDL (Metering Point Identification).

  • Get Aggregated Consumption - gives the consumption on an hourly resolution. It accepts a past from and to date and MPID/PDL as input. Note that it will not return any data unless one is a Barry customer. The data usually has two to three days of delay, which is a limitation of the regulatory authorities.

  • Get Total KwH Price - Gives the total price for a given metering point over the given periode. This methode accept a time difference down to the hour. It accepts the MPID/PDL and a from/to datetime. The date can be in past or up to 24 hours in the future (depending on when new spot prices gets in). The endpoint will reflect all prices paid per hour, including grid fees, tarrifs, subscriptions and spot prices.

  • Get Hourly CO2 emission - This methode will list the CO2 emissions for all MPID's active for the current account. It accepts a from and to datetime.

Authentication

Barry is using a JWT bearer token for authentication. This token can be found in the Barry app in the Add-ons section (app version 1.15 or later).

API token in the app.

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

Changelog

  • 1.2 - Added the full price methode, the CO2 methode and described the Rate limits
  • 1.1 - Refactor the authenticathion
  • 1.0 - Initial commit

OpenAPI

Get the spot price for a price area.

This method allows one to fetch an time series of spot prices for a price area.

Authorizations:
Request Body schema: application/json
method
required
string
Default: "co.getbarry.api.v1.OpenApiController.getPrice"

Method name

id
required
integer <int32>
Default: 0

Request ID

jsonrpc
required
string
Default: "2.0"

JSON-RPC Version (2.0)

params
required
Array of strings
Default: ["Price area","Datetime from","Datetime to"]

Responses

Request samples

Content type
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getPrice",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}

Get all meterings points connected to the subscription.

This method allows one to fetch a list with all meterings points and its meta data for the subscription.

Authorizations:
Request Body schema: application/json
method
required
string
Default: "co.getbarry.api.v1.OpenApiController.getMeteringPoints"

Method name

id
required
integer <int32>
Default: 0

Request ID

jsonrpc
required
string
Default: "2.0"

JSON-RPC Version (2.0)

params
required
Array of strings
Default: []

Responses

Request samples

Content type
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getMeteringPoints",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [ ]
}

Get the aggregated consumption for a metering point.

This method allows one to fetch aggregated consumption for a metering point.

Authorizations:
Request Body schema: application/json
method
required
string
Default: "co.getbarry.api.v1.OpenApiController.getAggregatedConsumption"

Method name

id
required
integer <int32>
Default: 0

Request ID

jsonrpc
required
string
Default: "2.0"

JSON-RPC Version (2.0)

params
required
Array of strings

Responses

Request samples

Content type
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getAggregatedConsumption",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}

Get the total price for a metering point.

This method allows one to fetch the total price, grid fees, tarrifs, subscription and spot price, for a metering point.

Authorizations:
Request Body schema: application/json
method
required
string
Default: "co.getbarry.api.v1.OpenApiController.getTotalKwHPrice"

Method name

id
required
integer <int32>
Default: 0

Request ID

jsonrpc
required
string
Default: "2.0"

JSON-RPC Version (2.0)

params
required
Array of strings
Default: ["MPID","Datetime from","Datetime to"]

Responses

Request samples

Content type
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getTotalKwHPrice",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}

Get the hourly CO₂ for a metering point.

This method allows one to fetch the hourly CO₂ for a metering point.

Authorizations:
Request Body schema: application/json
method
required
string
Default: "co.getbarry.api.v1.OpenApiController.getHourlyCo2Emission"

Method name

id
required
integer <int32>
Default: 0

Request ID

jsonrpc
required
string
Default: "2.0"

JSON-RPC Version (2.0)

params
required
Array of strings
Default: ["Datetime from","Datetime to"]

Responses

Request samples

Content type
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getHourlyCo2Emission",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}