here's the response on why it's not accurate and more details on their api:
We don't yet have a fully public API that we guarantee backwards compatibility for. We're planning to launch a fully supported public API in the next 12 months, but until then this API will give you indicative prices.
Note that you will need to switch to the new API when it is released.
Here are the full details for accessing our current API:
1. GUI (ie Postman)
Ensure you enter the method as POST
and the postcode payload in the Body
, not Params
.
2. Windows based curl
curl -v -i -L https://api.amberelectric.com.au/prices/listprices -H "Content-Type: application/json" --data "{\"postcode\":\"3000\"}"
3. Unix based curl
curl -X POST \\<https://api.amberelectric.com.au/prices/listprices> \\-H 'Content-Type: application/json' \\-d '{ "postcode": "3000" }'
From the data there, the formula for usage prices is:
data.staticPrices.E1.totalfixedKWHPrice + data.staticPrices.E1.lossFactor * data.variablePricesAndRenewables.[period].wholesaleKWHPrice
And the formula for Export to Grid prices is:
data.staticPrices.B1.totalfixedKWHPrice - data.staticPrices.B1.lossFactor * data.variablePricesAndRenewables.[period].wholesaleKWHPrice
See the bottom of this email for a full example.
All timestamps in the data are market time (ie Brisbane time) and at period end , not start (so if it's 9:15am, the current period is the 9:30am one). These prices are GST inclusive, so divide by 1.1 if you need them exclusive.
Let me know if you have further questions - hopefully the example below will make things clear!
Example: Get the current general price for postcode 3000 @ 18:15 on 13/10/2020 in Melbourne
( full results in attached file listprices-postcode_3000-time_2020-10-13T17_15_57.json )
From the formula, first find the static prices (prices that do not change every 30 minutes). Use data.staticPrices.E1
as this represents the static prices for general usage.
{
"serviceResponseType": 1,
"data": {
"currentNEMtime": "2020-10-13T17:15:57",
"postcode": "3000",
...
"staticPrices": {
"E1": {
"dataAvailable": true,
"networkDailyPrice": "28.63043692",
"basicMeterDailyPrice": "0",
"additionalSmartMeterDailyPrice": "22",
"amberDailyPrice": "32.87671233",
"totalDailyPrice": "83.50714925",
"networkKWHPrice": "7.766",
"marketKWHPrice": "1.718",
"greenKWHPrice": "4.2471",
"carbonNeutralKWHPrice": "0.11",
"lossFactor": "1.04063232",
"offsetKWHPrice": "0.11",
"totalfixedKWHPrice": "9.59400",
...
},
"E2": {
...
},
"B1": {
...
}
},
"variablePricesAndRenewables": [ ... ]
},
"message": ""
}
Note: data.staticPrices.E2
is for controlled load usage and data.staticPricesB1
is for solar exports.
Store the two static price fields:
totalfixedKWHPrice = 9.59400
lossFactor = 1.04063232
Now find the variable price (price that updates every 5 minutes and is averaged over a 30 minute block). Variable prices are stored with 30 minute timestamps in market time (Brisbane time).
13/10/2020 is daylight savings time in Melbourne, so for 18:15 in Melbourne , find the timestamp for 17:15 in market time (since market time ignores daylight savings). 30 minute timestamps are stored by the 30 minute period end , so the timestamp in market time is 2020-10-13T17:30:00.
{
"serviceResponseType": 1,
"data": {
...
"staticPrices": { ... },
"variablePricesAndRenewables": [
{
"periodType": "ACTUAL",
"semiScheduledGeneration": "1140.9",
"operationalDemand": "5017.25",
"rooftopSolar": "182.761",
"createdAt": "2020-10-13T17:15:41",
"wholesaleKWHPrice": "4.2856000000000005",
"region": "VIC1",
"period": "2020-10-12T17:30:00",
"renewablesPercentage": "0.25454965383727074",
"periodSource": "30MIN",
"percentileRank": "0.4915254237288136"
},
...
{
"periodType": "ACTUAL",
"operationalDemand": "30532.94000",
"rooftopSolar": "190.04",
"wholesaleKWHPrice": "5.39879",
"region": "VIC1",
"period": "2020-10-13T17:30:00",
"periodSource": "5MIN",
"latestPeriod": "2020-10-13T17:15:00",
"usage": "30532.94000",
"renewablesPercentage": "0.17017",
"percentileRank": "0.8050847457627118"
},
{
"periodType": "FORECAST",
"semiScheduledGeneration": "645.927",
"operationalDemand": "5140.97",
"rooftopSolar": "56.497",
"forecastedAt": "2020-10-13T17:00:00",
"forecastedAt+period": "2020-10-13T17:00:00+2020-10-13T18:00:00",
"createdAt": "2020-10-13T17:15:41",
"wholesaleKWHPrice": "5.2541863",
"region": "VIC1",
"period": "2020-10-13T18:00:00", "renewablesPercentage": "0.13514737082505765",
"periodSource": "30MIN",
"percentileRank": "0.7796610169491526"
},
...
]
},
"message": ""
}
Store the variable price field:
wholesaleKWHPrice = 5.39879
A few things to note here:
- For the current live price, find the latest period with type
ACTUAL
- Periods with type
FORECAST
are prices in the future
Now calculate the current price:
currentWholesalePrice = data.staticPrices.E1.totalfixedKWHPrice + data.staticPrices.E1.lossFactor * data.variablePricesAndRenewables.[period].wholesaleKWHPrice
currentWholesalePrice = 9.59400 + (1.04063232 * 5.39879)
currentWholesalePrice = 15.21 cents
As indicated by periodSource
and latestPeriod
fields, this price updates every 5 minutes. If you want to match the live price in the Amber app, you should create an average of these 5 minute live prices over each 30 minute block.