ISO-NE Massachusetts Day-Ahead Spot Price
You need a reliable way to fetch the ISO-NE Massachusetts Day-Ahead spot power price and wire it into a finance stack for valuation, hedging, or risk dashboards. By the end of this guide, you will request the live quote for ISONE_MA_DA, parse rates and dates correctly, handle mixed base currencies, and cache results—using PHP for production integration plus a JavaScript example for quick verification.
What the ISO-NE Massachusetts Day-Ahead spot price represents for finance
The ISO-NE Massachusetts Day-Ahead price is a USD/MWh quotation that many finance teams use for P&L on physical/financial power positions, settlement estimation, and collateral models. A clean integration gives you daily valuations, scenario analysis inputs, and automated risk checks powered by a single source-of-truth feed.
In practice, you will read three fields for this symbol: the numeric price, the effective date for that price, and the reporting currency. Once normalized, the value can drop into risk engines, backtesting jobs, or pricing functions with predictable behavior, even across U.S. market holidays and weekends.
Origin catalog facts for this symbol
- Symbol name: ISO-NE Massachusetts Day-Ahead
- Symbol code: ISONE_MA_DA
- Unit: USD/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=ISONE_MA_DA" --data-urlencode "api_key=YOUR_API_KEY"
- Read rates.ISONE_MA_DA, dates.ISONE_MA_DA, currencies.ISONE_MA_DA. base may be MIXED.
Endpoint you will call and required parameters
Use the latest endpoint with a GET request and URL-encoded query parameters:
- Method: GET
- URL: https://energy-api.com/api/v1/latest
- Required params:
- symbols: set to ISONE_MA_DA for ISO-NE Massachusetts Day-Ahead
- api_key: your API key string (use YOUR_API_KEY in examples)
Do not pass base=USD if you are also requesting TTF_GAS or EUA_CO2 in the same call. For a single symbol call to ISONE_MA_DA, you can omit base entirely. Always expect base to be MIXED for multi-symbol requests where currencies differ.
Official cURL you can copy
curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=ISONE_MA_DA" --data-urlencode "api_key=YOUR_API_KEY"
This request returns the most recent available daily point for the requested symbol. All parsing should refer to the rates, dates, and currencies maps keyed by the symbol code.
Real API response for ISONE_MA_DA (copyable fixture)
Use this to validate your parser against a concrete ISONE_MA_DA payload:
{"success":true,"date":"2026-11-19","base":"USD","rates":{"ISONE_MA_DA":44.9654},"dates":{"ISONE_MA_DA":"2026-11-19"},"currencies":{"ISONE_MA_DA":"USD"},"base_filter_note":null,"missing_symbols":null}
Fields you will read:
- rates.ISONE_MA_DA: 44.9654 (numeric price)
- dates.ISONE_MA_DA: 2026-11-19 (effective date for that rate, YYYY-MM-DD)
- currencies.ISONE_MA_DA: USD (currency for the symbol)
- base: USD for this response; for multi-symbol calls it can be MIXED
PHP implementation: fetch, parse, and harden for production
The following PHP snippet requests ISONE_MA_DA, validates the response, normalizes types, and returns a structured object suitable for pricing or risk ingestion. It also demonstrates a simple file cache to reduce repetitive calls in batch jobs.
PHP: client and parser
<?php
declare(strict_types=1);
/**
* Simple Energy API client for ISO-NE Massachusetts Day-Ahead (ISONE_MA_DA).
* - Uses GET /api/v1/latest with query params
* - Parses rates, dates, and currencies by symbol key
* - Includes a file cache for 10 minutes to reduce API calls in cron jobs
*/
final class EnergyApiClient
{
private string $baseUrl = 'https://energy-api.com/api/v1/latest';
private string $apiKey;
private int $timeout;
private string $cacheDir;
private int $ttlSeconds;
public function __construct(string $apiKey, string $cacheDir = '/tmp', int $ttlSeconds = 600, int $timeout = 10)
{
$this->apiKey = $apiKey;
$this->timeout = $timeout;
$this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR);
$this->ttlSeconds = $ttlSeconds;
}
public function latest(string $symbol): array
{
$cacheKey = $this->cacheKey($symbol);
if ($this->isCacheFresh($cacheKey)) {
$cached = file_get_contents($cacheKey);
if ($cached !== false) {
$json = json_decode($cached, true);
if (is_array($json)) {
return $json;
}
}
}
$url = $this->baseUrl . '?' . http_build_query([
'symbols' => $symbol,
'api_key' => $this->apiKey,
]);
$ch = curl_init($url);
if ($ch === false) {
throw new RuntimeException('Failed to initialize cURL');
}
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => $this->timeout,
CURLOPT_TIMEOUT => $this->timeout,
CURLOPT_FAILONERROR => false,
]);
$body = curl_exec($ch);
$errno = curl_errno($ch);
$err = curl_error($ch);
$http = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($errno !== 0) {
throw new RuntimeException("Network error ($errno): $err");
}
if ($http < 200 || $http >= 300) {
throw new RuntimeException("HTTP $http returned by Energy API");
}
$json = json_decode((string)$body, true);
if (!is_array($json)) {
throw new RuntimeException('Malformed JSON response');
}
if (!($json['success'] ?? false)) {
throw new RuntimeException('API marked success=false');
}
// Persist to cache for replay/parsing debug and rate reduction
@file_put_contents($cacheKey, json_encode($json, JSON_UNESCAPED_SLASHES));
return $json;
}
private function cacheKey(string $symbol): string
{
$fname = 'energy_latest_' . preg_replace('/[^A-Z0-9_]/i', '_', $symbol) . '.json';
return $this->cacheDir . DIRECTORY_SEPARATOR . $fname;
}
private function isCacheFresh(string $cachePath): bool
{
if (!is_file($cachePath)) {
return false;
}
$mtime = (int) @filemtime($cachePath);
if ($mtime === 0) {
return false;
}
return (time() - $mtime) < $this->ttlSeconds;
}
}
/**
* Domain parser for ISONE_MA_DA: returns normalized quote structure.
*/
final class IsoNeMassParser
{
public static function parse(array $payload, string $symbol): array
{
$rates = $payload['rates'] ?? [];
$dates = $payload['dates'] ?? [];
$currs = $payload['currencies'] ?? [];
$base = $payload['base'] ?? null;
if (!array_key_exists($symbol, $rates)) {
throw new InvalidArgumentException("Missing rate for $symbol");
}
if (!array_key_exists($symbol, $dates)) {
throw new InvalidArgumentException("Missing date for $symbol");
}
if (!array_key_exists($symbol, $currs)) {
throw new InvalidArgumentException("Missing currency for $symbol");
}
$price = (float) $rates[$symbol];
$date = (string) $dates[$symbol];
$ccy = (string) $currs[$symbol];
// Date validation: expect YYYY-MM-DD
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $date)) {
throw new InvalidArgumentException("Unexpected date format for $symbol: $date");
}
return [
'symbol' => $symbol,
'price' => $price, // USD/MWh for ISONE_MA_DA
'price_currency' => $ccy, // "USD"
'price_date' => $date, // Local market calendar date
'response_base' => $base, // Can be "USD" or "MIXED" in multi-symbol calls
'unit' => 'USD/MWh',
];
}
}
// Usage example
try {
$apiKey = 'YOUR_API_KEY';
$symbol = 'ISONE_MA_DA';
$client = new EnergyApiClient($apiKey, '/tmp', 600, 10);
$payload = $client->latest($symbol);
$quote = IsoNeMassParser::parse($payload, $symbol);
// Print or integrate into valuation logic
echo "Symbol: {$quote['symbol']}\n";
echo "Date: {$quote['price_date']}\n";
echo "Price: {$quote['price']} {$quote['price_currency']} ({$quote['unit']})\n";
echo "Base: {$quote['response_base']}\n";
} catch (Throwable $e) {
// Production tip: log with correlation IDs, do not echo in web contexts.
fwrite(STDERR, "Energy API error: " . $e->getMessage() . PHP_EOL);
exit(1);
}
JavaScript example: quick verification in Node.js
This minimal example fetches ISONE_MA_DA and prints the price, date, and currency. Useful for CI checks or ad-hoc validation alongside your PHP service.
import https from 'node:https';
import { URL } from 'node:url';
const API_KEY = 'YOUR_API_KEY';
const SYMBOL = 'ISONE_MA_DA';
function getLatest(symbol) {
const u = new URL('https://energy-api.com/api/v1/latest');
u.searchParams.set('symbols', symbol);
u.searchParams.set('api_key', API_KEY);
return new Promise((resolve, reject) => {
https.get(u, (res) => {
let data = '';
res.setEncoding('utf8');
res.on('data', (chunk) => (data += chunk));
res.on('end', () => {
if (res.statusCode < 200 || res.statusCode >= 300) {
return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
}
try {
const json = JSON.parse(data);
if (!json.success) return reject(new Error('API success=false'));
resolve(json);
} catch (e) {
reject(e);
}
});
}).on('error', reject);
});
}
const main = async () => {
const payload = await getLatest(SYMBOL);
const price = payload.rates?.[SYMBOL];
const date = payload.dates?.[SYMBOL];
const ccy = payload.currencies?.[SYMBOL];
const base = payload.base;
if (price == null || date == null || ccy == null) {
throw new Error('Missing expected fields in response');
}
console.log(`ISONE_MA_DA ${date}: ${price} ${ccy} (unit USD/MWh), base=${base}`);
};
main().catch((err) => {
console.error('Energy API error:', err.message);
process.exit(1);
});
Official JSON sample (from documentation)
Compare your parser against the official structure. Always read rates, dates, and currencies by symbol key.
{
"success": true,
"date": "2026-11-20",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 141.7108
},
"dates": {
"OMIE_ES_DA": "2026-11-20"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null,
"missing_symbols": null
}
Note the top-level base can be EUR (or MIXED when you query symbols with different currencies). Your ISONE_MA_DA integrations should not assume base=USD; they should always read the per-symbol currency from currencies.ISONE_MA_DA.
Validation fixtures you can reuse in tests
For reproducible unit tests, here are two copyable fixtures that match the endpoint format and help verify your field selectors and date handling.
Fixture A: ISONE_MA_DA (same as the real response above)
{"success":true,"date":"2026-11-19","base":"USD","rates":{"ISONE_MA_DA":44.9654},"dates":{"ISONE_MA_DA":"2026-11-19"},"currencies":{"ISONE_MA_DA":"USD"},"base_filter_note":null,"missing_symbols":null}
Fixture B: Official structure pattern
{
"success": true,
"date": "2026-11-20",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 141.7108
},
"dates": {
"OMIE_ES_DA": "2026-11-20"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null,
"missing_symbols": null
}
Financial integration notes that save time
- Units: ISO-NE Massachusetts Day-Ahead is quoted in USD/MWh. Keep this unit in valuation formulas to avoid silent kWh vs MWh errors.
- Currency: Read currencies.ISONE_MA_DA for the authoritative currency. Do not infer from base. Base can be MIXED if you expand to multi-symbol requests.
- Date semantics: dates.ISONE_MA_DA is the effective market date (YYYY-MM-DD). For finance books, carry this as the price date on positions. If your accounting date differs, map explicitly.
- Timezone: The response provides dates (not datetimes). If you attach timestamps, use a controlled convention (e.g., 00:00:00 America/New_York) only in your system, not as an inferred API fact.
- Caching: For dashboards and intraday risk snapshots, a 5–15 minute cache is typical. For end-of-day runs, you can cache the daily point until the next publication cycle.
- Non-trading days: Power markets still publish daily points; however, availability times vary by market calendars. When the API returns the same date across runs, do not “extrapolate”—just persist the last official point and mark it as unchanged.
- Error handling: Check success=true and presence of rates.ISONE_MA_DA, dates.ISONE_MA_DA, and currencies.ISONE_MA_DA. If missing_symbols is not null, fail fast and alert.
- Batching: You can pass multiple symbols in symbols, but if you ever include TTF_GAS or EUA_CO2, do not pass base=USD. For clean ISO-NE-only flows, omit base entirely.
Mapping to valuation and risk
Once parsed, the fields map cleanly into finance workflows:
- Mark-to-market: Use price (USD/MWh) times your position MWh to compute notional exposure or P&L deltas.
- Collateral: Feed current USD/MWh into margin calls for power-linked derivatives, with dates.ISONE_MA_DA as the price date.
- Backtesting: Store the daily time series as (date, price, currency), and avoid recalculating currency conversions unless you explicitly need them for multi-currency books.
- Auditability: Persist the raw JSON payload alongside normalized records, so you can later verify base, currency, and symbol-specific fields for audits.
Observability and deployment checklist
- Logging: Log request URL (without the api_key), HTTP code, success flag, and symbol list.
- Metrics: Track success rate, latency, cache hit ratio, and number of symbols per call if you batch.
- Retries: Network-level retries with backoff help, but do not retry on 4xx. Avoid retry storms by honoring short caches for dashboard refreshes.
- CI tests: Validate parsers with the fixtures above to ensure you always read rates/dates/currencies by symbol keys.
- Schema stability: Anchor against keys success, date, base, rates, dates, currencies, base_filter_note, missing_symbols, but only depend on rates/dates/currencies for valuation logic.
End-to-end runbook (concise)
- Call GET /api/v1/latest with symbols=ISONE_MA_DA and api_key.
- Check success=true; read price from rates.ISONE_MA_DA.
- Read price date from dates.ISONE_MA_DA; store as YYYY-MM-DD string.
- Read currency from currencies.ISONE_MA_DA; expect USD for this symbol.
- Persist both raw JSON and normalized record (symbol, date, price, currency, unit).
- Cache for 5–15 minutes unless you require immediate updates.
- Publish into your finance system (valuation, risk, or reporting).
FAQ
Q: Do I need to pass base=USD for ISONE_MA_DA?
A: No. Read currencies.ISONE_MA_DA for the authoritative currency. Base can be MIXED in multi-symbol calls; you should not set base=USD when requesting TTF_GAS or EUA_CO2 together with other symbols.
Q: Which fields are safe to store for finance books?
A: Store symbol, dates.ISONE_MA_DA (YYYY-MM-DD), rates.ISONE_MA_DA (numeric), currencies.ISONE_MA_DA (USD), plus the unit USD/MWh. Optionally store base and the full raw payload for audits.
Q: How should I handle missing_symbols or null values?
A: If missing_symbols is not null or the rate/date/currency for ISONE_MA_DA is absent, treat the fetch as failed and alert. Do not attempt to fill forward unless your policy explicitly allows it.
Q: Can I query multiple symbols at once?
A: Yes, you can pass a comma-separated symbols list. Always read rates/dates/currencies by key. If you include TTF_GAS or EUA_CO2 in the same request, do not pass base=USD.
Q: What about timezones or intraday timestamps?
A: The endpoint returns dates, not timestamps. If your system requires timestamps, attach a local convention in your data layer, but keep the original date unchanged for auditability.
Next step
Spin up your integration by creating an API key and running the cURL above, then drop in the PHP client and parser to push ISONE_MA_DA into your finance workflows. Start here: Register. For request/response specifics and symbol coverage, see the Documentation.
Ready to get started?
Get your API key and start querying energy commodity prices in minutes.
Get API Key