Historical New South Wales Electricity Prices
You need reliable historical spot prices for New South Wales electricity and a straightforward way to fetch, validate, and use them in your application. By the end of this guide, you will query the Energy API for New South Wales Electricity (symbol AEMO_NSW1_SPOT), interpret the JSON fields you receive, handle units and base currency, and integrate the values into your models or dashboards.
What you will build
This tutorial walks you through a clean, repeatable workflow to request and consume the AEMO New South Wales spot electricity series. You will learn the exact symbol, units, and required authentication, see a working curl you can paste into a terminal, and copy a compact Python example that extracts the fields you actually need. The approach scales from ad-hoc validation to production ingestion jobs.
The symbol, units, and authentication you must use
The Energy API tracks New South Wales spot electricity under:
- Symbol name: New South Wales Electricity
- Symbol code: AEMO_NSW1_SPOT
- Unit: AUD/MWh
- Authentication: api_key query parameter (value is YOUR_API_KEY)
Do not pass unrelated parameters or additional bases for this symbol. Specifically, do not pass base=USD, and do not try to combine this request with TTF_GAS or EUA_CO2 in the same call. Keep your initial request focused on AEMO_NSW1_SPOT to avoid avoidable filtering or mismatched units.
Endpoint and request parameters
Use the timeseries endpoint to fetch date-bounded data:
- Method: GET
- Endpoint: /api/v1/timeseries
- Query parameters:
- start: inclusive start date (YYYY-MM-DD)
- end: inclusive end date (YYYY-MM-DD)
- symbols: AEMO_NSW1_SPOT
- api_key: YOUR_API_KEY
The response includes top-level keys such as success, date, base, rates, dates, currencies, and base_filter_note. For New South Wales Electricity, read the values at rates.AEMO_NSW1_SPOT, dates.AEMO_NSW1_SPOT, and currencies.AEMO_NSW1_SPOT. These correspond to the numeric price, the quoted date, and the associated currency respectively.
Copy-pasteable curl request
Run this curl command exactly as written, substituting your own date range as needed and your API key for YOUR_API_KEY:
curl -G "https://energy-api.com/api/v1/timeseries" --data-urlencode "start=2026-01-01" --data-urlencode "end=2026-03-31" --data-urlencode "symbols=AEMO_NSW1_SPOT" --data-urlencode "api_key=YOUR_API_KEY"
Official sample JSON and field mapping
The following block is the official sample response. It demonstrates the response structure you will parse. Note that the symbol and currency in this sample illustrate the shape of the payload:
{
"success": true,
"date": "2026-10-11",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 141.491
},
"dates": {
"OMIE_ES_DA": "2026-10-11"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null
}
Field usage you will mirror for AEMO_NSW1_SPOT:
- success: Boolean indicating a valid response.
- date: API processing date or the latest reference date in the response context.
- base: The base currency context for the symbols returned.
- rates: Map of symbol to numeric value.
- dates: Map of symbol to the specific date for the rate.
- currencies: Map of symbol to its currency code.
- base_filter_note: Optional informational note when base filtering applies.
Real response example for New South Wales Electricity
The following is a real response snapshot for AEMO_NSW1_SPOT. Use it as a concrete reference for the symbol, units, and currency mapping when working with New South Wales electricity prices:
For AEMO_NSW1_SPOT you will typically read:
- rates.AEMO_NSW1_SPOT: the price value in AUD/MWh.
- dates.AEMO_NSW1_SPOT: the corresponding date.
- currencies.AEMO_NSW1_SPOT: the currency code (AUD).
Python example: request and parse AEMO_NSW1_SPOT
This minimal Python example calls the same endpoint you used via curl and extracts the fields your downstream code will use. Replace YOUR_API_KEY with your key and adjust the dates to your needs.
import requests
from urllib.parse import urlencode
base_url = "https://energy-api.com/api/v1/timeseries"
params = {
"start": "2026-01-01",
"end": "2026-03-31",
"symbols": "AEMO_NSW1_SPOT",
"api_key": "YOUR_API_KEY"
}
url = f"{base_url}?{urlencode(params)}"
resp = requests.get(url, timeout=30)
resp.raise_for_status()
data = resp.json()
# Validate the shape and extract key fields
if not data.get("success"):
raise RuntimeError("Energy API response indicates failure")
symbol = "AEMO_NSW1_SPOT"
price = data["rates"].get(symbol)
price_date = data["dates"].get(symbol)
currency = data["currencies"].get(symbol)
base_currency = data.get("base")
# Use or store the parsed values
print("Symbol:", symbol)
print("Date:", price_date)
print("Price:", price, "AUD/MWh")
print("Currency:", currency)
print("Base context:", base_currency)
How to choose dates, align units, and avoid surprises
Set start and end to the exact historical window you plan to backfill or validate. If you only need a current snapshot, you can still pass a tight window (e.g., a single day) using equal start and end. This avoids fetching unrelated data and keeps integration steps simple while you test.
The unit for AEMO_NSW1_SPOT is AUD/MWh. Keep this unit consistent end to end. When you display or store the value, include the unit so that later joins to other series (e.g., different markets) do not silently mix incompatible measures. The currencies map will confirm AUD for the symbol so you can assert alignment in code.
The dates map contains the date associated with the price. Align your downstream indexes to this date. If you maintain a time-based warehouse schema or partitioned storage, use the dates.AEMO_NSW1_SPOT value as the authoritative partition key to avoid off-by-one errors during backfills.
Caching and daily refresh logic
Because electricity spot data changes over calendar days, a daily refresh cadence is a common baseline. Cache the parsed response by the dates.AEMO_NSW1_SPOT value so you do not overwrite historical points unintentionally. If you maintain a rolling window (for example, the last 90 days), refresh only that range instead of refetching multi-year histories repeatedly.
If the API returns success but does not include a value for the requested date, handle it gracefully by leaving the previous day’s value intact or flagging a data gap for later retry. Build a simple exponential backoff for transient network errors and log the base and currency fields so you can quickly identify mismatches during audits.
Working with single-day snapshots vs. ranges
The response examples show a symbol-to-value map rather than a multi-day array. Code your parser to read rates.AEMO_NSW1_SPOT and dates.AEMO_NSW1_SPOT for the actual price and date of interest. If you request a broader range, structure your ingestion around repeated calls or scheduled runs per day. Keep your transformations simple and oriented around the documented fields.
Data hygiene: base currency and conversions
For New South Wales Electricity, you expect AUD as both the currency of the symbol and the base. Read base and currencies.AEMO_NSW1_SPOT and assert they match your expectations in tests. Do not pass base=USD, and do not combine this call with unrelated series such as TTF_GAS or EUA_CO2. Keeping the call single-symbol and single-currency avoids noisy transformations that could break unit safety.
Error handling, observability, and idempotency
On every request:
- Check success is true before using the payload.
- Validate that rates.AEMO_NSW1_SPOT is present and is numeric.
- Ensure dates.AEMO_NSW1_SPOT is a valid date string and index by it.
- Confirm currencies.AEMO_NSW1_SPOT is AUD for this symbol.
Log the URL you requested (without the api_key value), the HTTP status, and a compact version of the parsed fields. For idempotent backfills, write using upserts keyed by (symbol, date) so reprocessing the same window does not create duplicates.
Scheduling and non-market days
Electricity spot markets operate continuously with daily pricing, but individual days can differ in liquidity and volatility. Your ingestion job should not assume weekends or holidays are missing; instead, always trust the dates.AEMO_NSW1_SPOT from the response. If a specific date produces no value, retain your last known good dataset and retry later rather than synthesizing a value.
Replaying history safely
When rebuilding history, iterate over your date range using small batches so failures are contained. Treat each date as an independent retrieval and write. That way, a single transient error cannot corrupt a large span of historical data. Keep an audit log of (requested_start, requested_end, symbol, parsed_date, parsed_value, currency, base) for reproducibility.
Linking to production setup and docs
When you are ready to run this in production, create your API key and test with a small backfill window to validate unit and date handling. Then scale to your full historical range as needed. For reference materials and endpoint behavior, consult the official documentation.
Troubleshooting quick checks
- If you receive an authentication error, confirm the api_key query parameter is present and spelled correctly, and that you are using YOUR_API_KEY where needed in tests.
- If the response succeeds but the price is missing, check you requested the correct symbol (AEMO_NSW1_SPOT) and that your date window includes the date in dates.AEMO_NSW1_SPOT.
- If you are mixing this dataset with others, assert currency alignment using currencies.AEMO_NSW1_SPOT and keep transformations explicit.
- If you see unexpected values, log base and currencies to verify no implicit conversions are occurring in your code.
FAQ
What is the exact unit for New South Wales Electricity prices?
The unit is AUD/MWh. Read and store values as such. The currencies map for AEMO_NSW1_SPOT will reflect AUD.
How do I authenticate?
Use the api_key query parameter with your key value. Example: api_key=YOUR_API_KEY.
Can I request multiple symbols in one call?
This guide focuses on a single symbol (AEMO_NSW1_SPOT). Keep this call focused to avoid mixing units or currencies. If you later add more symbols, validate each symbol’s currency and unit individually.
Why does the response include both base and currencies?
base indicates the base currency context for the response, while currencies maps each symbol to its own currency. For AEMO_NSW1_SPOT, both will align to AUD.
How should I store the date?
Use the value at dates.AEMO_NSW1_SPOT as your canonical date key. It is the reference for the corresponding price in rates.AEMO_NSW1_SPOT.
Next steps
Create your API key, run the curl above for a small window, and confirm your pipeline stores rates.AEMO_NSW1_SPOT, dates.AEMO_NSW1_SPOT, and currencies.AEMO_NSW1_SPOT with the AUD/MWh unit. When it looks correct, expand your backfill window and automate a daily refresh. If you are not yet registered, start here: Register. For endpoint details and field reference, keep the Documentation open while you integrate.
Ready to get started?
Get your API key and start querying energy commodity prices in minutes.
Get API KeyRelated posts
Discover how Energy API enables real-time monitoring and orchestration of DERs to relieve distribution grid co...
Read more →
Discover how to leverage Energy API for backtesting renewable hedging strategies. Simulate volatility and opti...
Read more →
Discover how the Energy API streamlines the reconciliation of green hydrogen guarantees, enhancing ESG reporti...
Read more →
Discover how to enhance your intraday market-making with a Finance API. Learn effective risk limits, inventory...
Read more →
Discover how to integrate the Energy API to fetch real-time electricity prices for South Australia. Enhance yo...
Read more →