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 10 calls every minute.

  • 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 #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 spot price is excluding VAT and tariffs.

  • Get Price Definitions #get-price-deifnitions - Gives information about price definitions.

  • Get Metering Points #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 #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 Aggregated Consumption for mpids #get-aggregated-consumption-mpids - gives the consumption on an hourly resolution baese on provided mpids. 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 Cost get-total-kWh-price #get-total-kWh-price - Gives the total cost for a given metering point over the given period. This method accepts 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 prices gets in). The endpoint will reflect all prices paid per hour, including grid fees, tarrifs, subscriptions and spot prices.

  • Get Total Cost hourly #get-total-hourly-price - Gives the total cost per hour for a metering point

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

  • Get Hourly CO2 instensity #get-hourly-co2-intensity - Get the hourly CO 2 intencity for a region. It accepts region, 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).

bearerAuth

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

Changelog

  • 1.2 - Added total cost method, the CO2 method and described the Rate limits
  • 1.1 - Refactor the authenticathion
  • 1.0 - Initial commit

Price

Get the spot price for a price area.

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

Request
Security:
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
200List of spot prices for a price area
post/json-rpc#get-spot-price
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getPrice",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}

Get available price definitions.

This method allows all available price definitions.

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

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
200List of price definitions
post/json-rpc#get-price-deifnitions
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getPriceDefinitions",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [ ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}

Common

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.

Request
Security:
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
Responses
200List of meterings points connected to the subscription
post/json-rpc#get-metering-points
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getMeteringPoints",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [ ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}

Consumption

Get the aggregated consumption for a metering point.

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

Request
Security:
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
Default: ["Datetime from","Datetime to"]
Responses
200List of consuprions for selecetd metering point
post/json-rpc#get-aggregated-consumption
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getAggregatedConsumption",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}

Get the aggregated consumption for a metering points.

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

Request
Security:
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
Default: [["mpid1","mpid2"],"Datetime from","Datetime to"]
Responses
200List of consuprions for selecetd metering points
post/json-rpc#get-aggregated-consumption-mpids
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getAggregatedConsumption",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}

Cost

Get the total cost for a metering point.

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

Request
Security:
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
200Total cost for a metering point
post/json-rpc#get-total-kWh-price
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getTotalKwHPrice",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": {
    }
}

Get the total cost per hour for a metering point.

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

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

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
200Total cost per hour including tarrifs for a metering point
post/json-rpc#get-total-hourly-price
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getTotalHourlyPrice",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": {
    }
}

Co2

Get the hourly CO2 for a metering point.

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

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

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
200List of hourly CO2 for a metering point
post/json-rpc#get-hourly-co2-emission
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getHourlyCo2Intensity",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}

Get the hourly CO2 intencity for a region.

This method allows one to fetch the hourly CO2 for a region.

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

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: ["Region","Datetime from","Datetime to"]
Responses
200List of hourly CO2 for a region
post/json-rpc#get-hourly-co2-intensity
Request samples
application/json
{
  • "method": "co.getbarry.api.v1.OpenApiController.getHourlyCo2Intensity",
  • "id": 0,
  • "jsonrpc": "2.0",
  • "params": [
    ]
}
Response samples
application/json
{
  • "jsonrpc": "2.0",
  • "id": 0,
  • "result": [
    ]
}