Get interval readings for an account¶
Returns wholesale price history for an account in 15-minute intervals based on the given period (should be less than 24 hours). Prices can only be returned for non fixed-rate products currently.
Info
Interval readings are split into fifteen minute intervals. This means, in a day we can have ninety-six readings.
To prevent an unwanted response or very long waiting time, we require that the difference between fromDatetime
and toDatetime
should not be more than a day.
If you're looking for historical pricing for more than a day use the Daily Readings endpoint.
Authentication Required
Requires account user level access.
-
Arguments
input
: IntervalReadingInput
-
Returns
Example¶
import datetime
import pprint
import requests
# API_URL = "https://api.oeus-kraken.energy/v1/graphql/" # prod
API_URL = "https://api.oeus-kraken.systems/v1/graphql/" # test
JWT_TOKEN = "PLACE_JWT_TOKEN_HERE"
HEADERS = {
"Authorization": f"JWT {JWT_TOKEN}"
}
QUERY = """
query getIntervalReadings($input: IntervalReadingInput!) {
intervalReadings(input: $input) {
meterPointId
fromDatetime
toDatetime
consumption
price
}
}
"""
VARIABLES = {
"input": {
"accountNumber": "A-12345",
"esiId": "1008123456789",
"fromDatetime": "2021-11-01T22:30:00-05:00",
"toDatetime": "2021-11-01T23:00:00-05:00",
}
}
session = requests.Session()
session.headers.update(HEADERS)
response = session.post(
url=API_URL,
json={"query": QUERY, "variables": VARIABLES}
)
pprint.pprint(response.json())
const axios = require("axios")
// const apiUrl = "https://api.oeus-kraken.energy/v1/graphql/" // Prod
const apiUrl = "https://api.oeus-kraken.systems/v1/graphql/" // Test
const jwtToken = "PLACE_JWT_TOKEN_HERE"
let headers = {
"Authorization": `JWT ${jwtToken}`
}
const query = `
query getIntervalReadings($input: IntervalReadingInput!) {
intervalReadings(input: $input) {
meterPointId
fromDatetime
toDatetime
consumption
price
}
}
`
const variables = {
"input": {
"accountNumber": "A-12345",
"esiId": "1008123456789",
"fromDatetime": new Date("2021-11-01T22:30:00-05:00"),
"toDatetime": new Date("2021-11-01T23:00:00-05:00"),
}
}
axios({
url: apiUrl,
method: "post",
data: {
query: query,
variables: variables,
},
headers: headers,
}).then((response) => {
console.log(JSON.stringify(response.data, null, 4));
});
import axios from 'axios';
// const API_URL = "https://api.oeus-kraken.energy/v1/graphql/" // Prod
export const apiUrl = "https://api.oeus-kraken.systems/v1/graphql/" // Test
export const jwtToken = "PLACE_JWT_TOKEN_HERE"
let headers = {"Authorization": `JWT ${jwtToken}`}
export const query = `
query getIntervalReadings($input: IntervalReadingInput!) {
intervalReadings(input: $input) {
meterPointId
fromDatetime
toDatetime
consumption
price
}
}
`
export const variables = {
"input": {
"accountNumber": "A-12345",
"esiId": "1008123456789",
"fromDatetime": new Date("2021-11-01T22:30:00-05:00"),
"toDatetime": new Date("2021-11-01T23:00:00-05:00"),
}
}
axios({
url: apiUrl,
method: "post",
data: {
query: query,
variables: variables,
},
headers: headers,
}).then((response) => {
console.log(JSON.stringify(response.data, null, 4));
});
Expected error messages
- If the given timeframe is more than a day:
Interval reading period should not exceed more than 1 day. Please provide a shorter range or use DailyReadings.
- If the account doesn't have any interval readings in the given timeframe:
No interval readings found for the given period.