Hey, I did a quick introspection of the iPhone app traffic. Here’s a short summary:
It uses OAuth 2.0 / OpenID Connect flow, with okta (when using a username and password).
POST
to https://redenergy.okta.com/api/v1/authn
with request body:
{
"password": "xxxx",
"username": "[email protected]",
"options": {
"warnBeforePasswordExpired": false,
"multiOptionalFactorEnroll": false
}
}
returns a response with a session token.
Requests discovery document:
GET https://login.redenergy.com.au/oauth2/default/.well-known/openid-configuration
This returns the endpoints for login:
{
"issuer": "https://login.redenergy.com.au/oauth2/default",
"authorization_endpoint": "https://login.redenergy.com.au/oauth2/default/v1/authorize",
"token_endpoint": "https://login.redenergy.com.au/oauth2/default/v1/token",
"userinfo_endpoint": "https://login.redenergy.com.au/oauth2/default/v1/userinfo",
"registration_endpoint": "https://login.redenergy.com.au/oauth2/v1/clients",
"jwks_uri": "https://login.redenergy.com.au/oauth2/default/v1/keys",
...
}
Sends auth request with locally generated nonce, and session token to:
GET /oauth2/default/v1/authorize?nonce=6jl-XNAylmt...
Returns a short lived auth code in the response.
Client sends POST https://login.redenergy.com.au/oauth2/default/v1/token
and receives back a JSON response with access token, refresh token etc.
An Oauth python library should make most of the above straight forward
From here, you can do a GET to https://selfservice.services.retail.energy/v1/customers/current
(there are other endpoints, but this one seems to have the data we’re interested in)
Response
(personal details removed)
{
"currentUsage": {
"fromDate": "2027-12-18",
"toDate": "2028-01-15",
"consumptionMj": 0.000,
"consumptionKwh": 213.974,
"isConsumptionDollarGstInclusive": false,
"consumptionDollar": 85.38,
"generationKwh": 50.659,
"generationDollar": -2.53,
"demandCharges": [],
"maxDemand": 0.000,
"demandUom": null,
"demandDollar": 0.00,
"carbonEmissionTonne": 0.2469,
"isPricingReliable": true,
"pricingUnavailabilityReasons": [],
"averageMinTemperatureC": 0.0,
"averageMaxTemperatureC": 0.0,
"serviceToPropertyDollar": 26.00,
"potdDollar": 0.00,
"gstDollar": 10.90,
"totalChargesDollar": 117.14,
"demandKw": 0.000
},
"estimatedUsage": {
"fromDate": "2024-12-18",
"toDate": "2025-03-17",
"consumptionMj": 0.000,
"consumptionKwh": 1200.333,
"isConsumptionDollarGstInclusive": false,
"consumptionDollar": 264.98,
"generationKwh": 157.218,
"generationDollar": -7.85,
"demandCharges": [],
"maxDemand": 0.000,
"demandUom": null,
"demandDollar": 0.00,
"carbonEmissionTonne": 0.7662,
"isPricingReliable": false,
"pricingUnavailabilityReasons": [
"PRICING_IS_ESTIMATED_ONLY"
],
"averageMinTemperatureC": 0.0,
"averageMaxTemperatureC": 0.0,
"serviceToPropertyDollar": 80.69,
"potdDollar": 0.00,
"gstDollar": 33.83,
"totalChargesDollar": 300.54,
"demandKw": 0.000
},
"estimationStatus": "STANDARD_ESTIMATE",
"latestBillPeriodUsageTrendPercent": -32.8,
"billedUsageTrend": {
"asOfDate": "2025-01-16",
"latestBillPeriodUsageTrendPercent": -32.8,
"priorBillSummary": {
"billId": "742Evergreen|3",
"invoiceNumber": 987654321,
"fromDate": "2024-06-20",
"toDate": "2024-09-18",
"consumptionKwh": 1150.000,
"consumptionMj": 0.000
},
"latestBillSummary": {
"billId": "742Evergreen|4",
"invoiceNumber": 123456789,
"fromDate": "2024-09-19",
"toDate": "2024-12-17",
"consumptionKwh": 773.000,
"consumptionMj": 0.000
}
},
"latestUsageDate": "2025-01-15",
"estimationType": "PRESENT",
"asOfDate": "2025-01-16",
"currentUsageExplanation": {
"summary": "Usage is actual usage since consumer has an INTERVAL meter and GCMDS data is complete for the period",
"detail": ""
},
"projectedUsageExplanation": {
"summary": "Usage has been estimated by scaling 29 days actual usage to 90 days",
"detail": "Multiplying factor = 3.1034"
},
"estimationAlgorithmVersion": "V3_0"
}
Hope this helps!