Skip to content

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

Returns

1
2
3
4
5
6
7
8
9
query getDailyReadings($input:DailyReadingInput!){
    dailyReadings(input:$input){
        meterPointId
        readAt
        meterReading
        dailyUsage
        source
    }
}
1
2
3
4
5
6
7
8
9
# Input variables
{
    "input": {
        "accountNumber": "A-12345",
        "esiId": "1008123456789",
        "fromDatetime": "2022-05-22T13:41:36.424078-05:00",
        "toDatetime": "2022-05-23T13:41:36.424078-05:00",
    }
}

Example

1
2
3
4
5
6
7
8
9
query getDailyReadings($input:DailyReadingInput!){
    dailyReadings(input:$input){
        meterPointId
        readAt
        meterReading
        dailyUsage
        source
    }
}
1
2
3
4
5
6
7
8
9
# Input variables
{
    "input": {
        "accountNumber": "A-12345",
        "esiId": "1008123456789",
        "fromDatetime": "2021-10-01 05:00:00+00:00",
        "toDatetime": "2021-11-01T23:00:00-05:00",
    }
}
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));
});
 {
    "data": {
        "dailyReadings": [
            {
                "meterPointId": 111,
                "readAt": "2021-10-01 05:00:00+00:00",
                "meterReading": "100.00000",
                "dailyUsage": "10.00000",
                "source": "SMART_METER_TEXAS",
            },
            {
                "meterPointId": 111,
                "readAt": "2021-10-02 05:00:00+00:00",
                "meterReading": "110.00000",
                "dailyUsage": "10.00000",
                "source": "SMART_METER_TEXAS",
            },
            {
                "meterPointId": 111,
                "readAt": "2021-10-03 05:00:00+00:00",
                "meterReading": "120.00000",
                "dailyUsage": "10.00000",
                "source": "SMART_METER_TEXAS",
            },
            {
                "meterPointId": 111,
                "readAt": "2021-10-04 05:00:00+00:00",
                "meterReading": "130.00000",
                "dailyUsage": "10.00000",
                "source": "SMART_METER_TEXAS",
            },
            {
                "meterPointId": 111,
                "readAt": "2021-10-05 05:00:00+00:00",
                "meterReading": "140.00000",
                "dailyUsage": "10.00000",
                "source": "SMART_METER_TEXAS",
            },
        ]
    }
 }

Expected error messages

  • If to_datetime is before the from_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.
Back to top