Get daily readings for an account¶
Returns wholesale price history for an account based on the given period.
Authentication Required
Requires account user level access.
-
Arguments
input
: DailyReadingInput
-
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 getDailyReadings($input:DailyReadingInput!){
dailyReadings(input:$input){
meterPointId
readAt
meterReading
dailyUsage
source
}
}
"""
VARIABLES = {
"input": {
"accountNumber": "A-12345",
"esiId": "1008123456789",
"fromDatetime": "2021-10-01 05:00:00+00: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 getDailyReadings($input:DailyReadingInput!){
dailyReadings(input:$input){
meterPointId
readAt
meterReading
dailyUsage
source
}
}
`
const variables = {
"input": {
"accountNumber": "A-12345",
"esiId": "1008123456789",
"fromDatetime": new Date("2021-10-01T05:00:00-00: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 getDailyReadings($input:DailyReadingInput!){
dailyReadings(input:$input){
meterPointId
readAt
meterReading
dailyUsage
source
}
}
`
export const variables = {
"input": {
"accountNumber": "A-12345",
"esiId": "1008123456789",
"fromDatetime": new Date("2021-10-01T05:00:00-00: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
to_datetime
is before thefrom_datetime
: Please correct the datetimes. The from_datetime argument is later than the to_datetime. - If no readings are found for the given period: No daily readings found for the given period.