Victoria Electricity Price API

Victoria Electricity Price API

You need to programmatically fetch the latest spot electricity price for Victoria (AEMO VIC1) and use it inside a finance or risk workflow. By the end of this guide, you will call the Energy Latest endpoint for the Victoria Electricity symbol, parse the important fields, handle base currency and unit nuances, and ship a small client that is safe for production workloads.

What you’ll build

This post walks you through integrating the Energy Latest endpoint to obtain the most recent Victoria spot price and wire it into a pricing or P&L adjustment pipeline. You will:

Illustration: Victoria Electricity Price API
  • Query the latest price for AEMO Victoria spot electricity (AUD/MWh) with an API key.
  • Extract rate, unit, and effective date fields needed for downstream finance logic.
  • Apply caching and base handling rules to avoid inconsistent conversions.
  • Use a JavaScript client that you can paste directly into your app or service.

Origin catalog facts (verbatim)

  • Symbol name: Victoria Electricity
  • Symbol code: AEMO_VIC1_SPOT
  • Unit: AUD/MWh
  • Auth: api_key query parameter. Placeholder YOUR_API_KEY only.
  • Do not pass base=USD when you also need TTF_GAS or EUA_CO2.
  • No MCP host. Starter $19.99/mo, trial 7 days / 50 calls.
  • curl: curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=AEMO_VIC1_SPOT" --data-urlencode "api_key=YOUR_API_KEY"
  • Read rates.AEMO_VIC1_SPOT, dates.AEMO_VIC1_SPOT, currencies.AEMO_VIC1_SPOT. base may be MIXED.

Endpoint and authentication

The Energy Latest endpoint returns current rates for one or more symbols. Authentication uses an api_key query parameter. For Victoria Electricity, request the AEMO_VIC1_SPOT symbol. Keep your API key server-side when possible.

Official cURL sample (copy/paste):

curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=AEMO_VIC1_SPOT" --data-urlencode "api_key=YOUR_API_KEY"

Notes:

  • HTTP method: GET
  • Endpoint: https://energy-api.com/api/v1/latest
  • Query params: symbols (required), api_key (required)
  • Multiple symbols can be comma-separated, but stay focused on AEMO_VIC1_SPOT for this workflow.

Field map you will actually use

When you call the endpoint, focus on:

  • rates.AEMO_VIC1_SPOT — numeric price for Victoria electricity spot.
  • dates.AEMO_VIC1_SPOT — effective date associated with that price.
  • currencies.AEMO_VIC1_SPOT — currency of the rate (AUD for this symbol).
  • base — the response base indicator. For single-symbol calls like this, base may mirror the symbol currency. In multi-symbol calls, it can be MIXED.

Live Victoria example: interpret the latest price

Use the following JSON as a concrete, real example for AEMO_VIC1_SPOT. The values below must be read exactly as shown when wiring your parser and tests.

{"success":true,"date":"2026-10-06","base":"AUD","rates":{"AEMO_VIC1_SPOT":37.6898},"dates":{"AEMO_VIC1_SPOT":"2026-10-06"},"currencies":{"AEMO_VIC1_SPOT":"AUD"},"base_filter_note":null}

What to extract in code:

  • Latest price: 37.6898
  • Unit: AUD/MWh (from the catalog and currencies.AEMO_VIC1_SPOT field)
  • Effective date: 2026-10-06 (from dates.AEMO_VIC1_SPOT)
  • Base: AUD (clarifies how rates are expressed in aggregate responses)

Additional sample responses for parsing and testing

These samples help you verify your parser across base and symbol variations. Use them to test deserialization and field addressing. Copy them verbatim.

Official sample format (different market, same envelope shape):

{
"success": true,
"date": "2026-10-08",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 106.8959
},
"dates": {
"OMIE_ES_DA": "2026-10-08"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null
}

Victoria example repeated for fixture coverage (useful for unit tests and staging):

{"success":true,"date":"2026-10-06","base":"AUD","rates":{"AEMO_VIC1_SPOT":37.6898},"dates":{"AEMO_VIC1_SPOT":"2026-10-06"},"currencies":{"AEMO_VIC1_SPOT":"AUD"},"base_filter_note":null}

Victoria example again (integration test with idempotent payload):

{"success":true,"date":"2026-10-06","base":"AUD","rates":{"AEMO_VIC1_SPOT":37.6898},"dates":{"AEMO_VIC1_SPOT":"2026-10-06"},"currencies":{"AEMO_VIC1_SPOT":"AUD"},"base_filter_note":null}

JavaScript: minimal client that fetches and parses AEMO_VIC1_SPOT

The snippet below calls the Latest endpoint, checks HTTP and API-level success, and returns a typed object with the values your finance code actually consumes. Replace YOUR_API_KEY with your real key in deployment. Keep keys outside the browser for production.

async function fetchVictoriaSpot(apiKey) {
const url = new URL("https://energy-api.com/api/v1/latest");
url.searchParams.set("symbols", "AEMO_VIC1_SPOT");
url.searchParams.set("api_key", apiKey);

const res = await fetch(url.toString(), { method: "GET" });
if (!res.ok) {
const body = await res.text().catch(() => "");
throw new Error(`HTTP ${res.status}: ${body}`);
}

const data = await res.json();

if (!data || data.success !== true) {
throw new Error("API returned an unsuccessful payload");
}

// Required fields
const price = data?.rates?.AEMO_VIC1_SPOT;
const priceDate = data?.dates?.AEMO_VIC1_SPOT;
const currency = data?.currencies?.AEMO_VIC1_SPOT;
const base = data?.base;

if (typeof price !== "number" || !priceDate || !currency) {
throw new Error("Missing expected fields: rates.AEMO_VIC1_SPOT, dates.AEMO_VIC1_SPOT, currencies.AEMO_VIC1_SPOT");
}

return {
symbol: "AEMO_VIC1_SPOT",
price,
unit: "AUD/MWh", // from catalog facts; also aligns with currencies.AEMO_VIC1_SPOT === "AUD"
priceDate, // e.g., "2026-10-06"
currency, // e.g., "AUD"
base // e.g., "AUD" or possibly "MIXED" in multi-symbol responses
};
}

// Example usage:
fetchVictoriaSpot("YOUR_API_KEY")
.then(data => {
// Finance pipeline: valuation, indexation, or hedge reconciliation
console.log("Victoria spot:", data);
})
.catch(err => {
console.error("Failed to fetch Victoria spot:", err);
});

How to think about base, currencies, and units

For Victoria Electricity, the unit is AUD/MWh. That means the numeric value in rates.AEMO_VIC1_SPOT represents Australian dollars per megawatt-hour. When the response includes base, it can indicate a shared reference for the payload. In single-symbol calls like the example above, base often matches the symbol currency, but in multi-symbol calls base may be MIXED. Always read currencies.AEMO_VIC1_SPOT when deciding how to label or convert the price.

If you plan to combine Victoria with other symbols (for baskets or spreads), be mindful of mixed bases. Do not pass base=USD when you also need TTF_GAS or EUA_CO2. When bases differ, normalize downstream in your own code using FX or carbon conventions external to this endpoint.

Production pointers that save time

  • Idempotent reads: The Latest endpoint is a GET and safe to cache.
  • Caching: Cache responses for a short horizon (e.g., 30–120 seconds) if your finance workflow tolerates brief staleness. This reduces latency and call volume.
  • Dates and timezone: Use the dates.AEMO_VIC1_SPOT field, not the top-level date, when you present or store the effective price date. Persist ISO strings as provided.
  • Missing fields: Guard for null or undefined in base_filter_note and other optional fields.
  • Batching: If you extend to multiple symbols, pass a comma-separated list to symbols, then branch logic per symbol from the rates, dates, and currencies objects.
  • Retries: For transient network errors, retry with exponential backoff. If data.success !== true, log the body and halt rather than recycling bad payloads.
  • No MCP: There is no MCP host requirement here; call the documented endpoint directly.

Server-side integration sketch (Node.js/Express)

The following pattern wraps the upstream API so client apps don’t expose YOUR_API_KEY. It also introduces simple in-memory caching suitable for low-volume production or internal tools. For scale or compliance, replace with a dedicated cache and secret manager.

import express from "express";
import fetch from "node-fetch";

const app = express();
const PORT = process.env.PORT || 8080;
const ENERGY_API_KEY = process.env.ENERGY_API_KEY || "YOUR_API_KEY";

// 60s in-memory cache
let cache = { ts: 0, data: null };

app.get("/api/vic-spot", async (req, res) => {
const now = Date.now();
if (cache.data && now - cache.ts < 60_000) {
return res.json(cache.data);
}

try {
const url = new URL("https://energy-api.com/api/v1/latest");
url.searchParams.set("symbols", "AEMO_VIC1_SPOT");
url.searchParams.set("api_key", ENERGY_API_KEY);

const r = await fetch(url);
if (!r.ok) {
const txt = await r.text().catch(() => "");
return res.status(r.status).send(txt);
}
const json = await r.json();

if (!json || json.success !== true) {
return res.status(502).json({ error: "Upstream failure", body: json });
}

const payload = {
symbol: "AEMO_VIC1_SPOT",
price: json?.rates?.AEMO_VIC1_SPOT,
priceDate: json?.dates?.AEMO_VIC1_SPOT,
currency: json?.currencies?.AEMO_VIC1_SPOT,
base: json?.base,
unit: "AUD/MWh"
};

// Validate required fields
if (typeof payload.price !== "number" || !payload.priceDate || !payload.currency) {
return res.status(502).json({ error: "Missing required fields", body: json });
}

cache = { ts: now, data: payload };
res.json(payload);
} catch (err) {
res.status(500).json({ error: String(err) });
}
});

app.listen(PORT, () => {
console.log(`Server listening on ${PORT}`);
});

Validation checks for finance workflows

Before computing marks, P&L, or hedge deltas with Victoria Electricity prices, confirm:

  • Unit audit: Label as AUD/MWh consistently across your data model.
  • Date alignment: Use dates.AEMO_VIC1_SPOT for accrual or end-of-day snapshots.
  • Cross-source checks: If you store historicals, verify that latest aligns with your archival logic to avoid double-counting or backfills overwriting spot.
  • Mixed baskets: When you introduce multiple energy symbols, check base and currencies per symbol before aggregating into a single monetary figure.
  • Error budgets: Gracefully degrade when upstream is unavailable; maintain last-known-good with a TTL and a provenance tag.

Trial, plan basics, and call budgeting

The Starter plan is $19.99/mo. The trial is 7 days with 50 calls. Design your polling or on-demand triggers accordingly:

  • Local dev: Hit the endpoint manually during development and store responses as fixtures.
  • CI tests: Replay the provided JSON examples to validate parsers without burning trial calls.
  • Staging: Add a cache layer to cut call frequency during integration tests.

For more detail and any changes to quotas or usage policies, see the official Documentation.

Putting it together in a finance context

With AEMO_VIC1_SPOT integrated, your valuation or risk service can convert procurement scenarios, index-linked contracts, or electricity exposure into AUD-denominated amounts at the latest spot. Ensure that downstream systems always read currency and unit explicitly rather than assuming a portfolio default, and normalize bases when composing spreads or baskets that include additional energy symbols.

If you later extend beyond Victoria, avoid setting a forced base=USD when requesting TTF_GAS or EUA_CO2 together with other symbols; let the response indicate when base is MIXED and convert in your own ledger or analytics layer to preserve auditability.

FAQ

Q: What symbol should I request for Victoria spot electricity?
A: Use AEMO_VIC1_SPOT. The unit is AUD/MWh.

Q: How do I authenticate?
A: Pass your API key as a query parameter named api_key. Example: api_key=YOUR_API_KEY.

Q: Which fields matter for pricing?
A: rates.AEMO_VIC1_SPOT (numeric price), dates.AEMO_VIC1_SPOT (effective date), currencies.AEMO_VIC1_SPOT (AUD), and base (can be MIXED in multi-symbol calls).

Q: Should I pass base=USD?
A: Do not pass base=USD when you also need TTF_GAS or EUA_CO2. Use the returned currencies per symbol and normalize in your own system.

Q: Are there special non-trading day rules?
A: The endpoint returns the latest available value per symbol. Rely on dates.AEMO_VIC1_SPOT to anchor the effective date, and add your own caching/refresh policy as needed.

Ready to integrate Victoria Electricity into your finance stack? Create an account and start your 7-day, 50-call trial, then ship with the Starter plan when you’re ready. Register and review the Documentation to implement the endpoint and field parsing exactly as shown above.

Ready to get started?

Get your API key and start querying energy commodity prices in minutes.

Get API Key

Related posts