Get Palladium Jun 2026 (PAM26) - Per Troy Ounce prices using this API in Node.js with fetch
You need a live, per–troy ounce price you can wire straight into a Node.js app for Palladium Jun 2026 (often written as PAM26), so you can price a purchase order, update a trading dashboard, or trigger an alert. By the end of this guide, you’ll query Metals-API for palladium prices in USD, parse the JSON with fetch in Node.js, interpret units and timestamps correctly, and put a caching/refresh strategy around it that won’t burn through requests.
What “Palladium Jun 2026 (PAM26)” means and who needs the live quote
PAM26 typically denotes a June 2026 palladium futures contract, a key reference for automotive catalysts, smart manufacturing inputs, and environmental tech supply chains. Quant teams, traders, and product managers track a live palladium quote to reprice inventory, perform cost-plus bids, and watch exposure to catalytic-converter and electronics demand cycles.
Metals-API serves real-time and historical metals rates in a simple JSON format for integration into portfolio tools, ERP pricing engines, e-commerce, and research notebooks. If you’re specifically targeting a futures contract identifier like PAM26, first verify whether that exact symbol is supported on Metals-API. Palladium spot is commonly available as XPD (per troy ounce). Contract codes can vary by venue, so always confirm symbols on the reference page below.
- Check symbol support: Metals-API Supported Symbols
- Main site and plans: Metals-API Website
Fetch a live palladium price in USD with the /latest endpoint
Start with the /latest endpoint. Rates are returned relative to a base currency (default USD). Depending on your plan, updates can be every 60 minutes or every 10 minutes. We’ll request palladium as XPD in USD. If PAM26 is supported as an explicit symbol on your plan, you would pass that symbol instead; otherwise, use XPD as the spot reference and handle any contract basis/roll logic in your code.
Complete curl request
Replace YOUR_API_KEY with your actual key. If your plan supports a contract-specific symbol and it appears on the symbols list as PAM26, use symbols=PAM26. Otherwise, use XPD for palladium spot.
curl "https://api.metals-api.com/latest?access_key=YOUR_API_KEY&base=USD&symbols=XPD"
Same request in Node.js with fetch
This example is suitable for Node.js 18+ (built-in fetch) or any environment with a fetch polyfill.
import process from "node:process";
const ACCESS_KEY = process.env.METALS_API_KEY || "YOUR_API_KEY";
const url = `https://api.metals-api.com/latest?access_key=${ACCESS_KEY}&base=USD&symbols=XPD`;
async function getPalladiumSpotUSD() {
const res = await fetch(url, { method: "GET" });
if (!res.ok) {
throw new Error(`HTTP ${res.status} ${res.statusText}`);
}
const data = await res.json();
// Basic validation
if (!data.success) {
throw new Error(`API error: ${JSON.stringify(data)}`);
}
const ts = data.timestamp; // UNIX seconds
const base = data.base; // "USD"
const unit = data.unit; // "per troy ounce"
const xpdPerUsd = data.rates?.XPD; // e.g., 0.000744 XPD per 1 USD
if (typeof xpdPerUsd !== "number") {
throw new Error("Missing XPD rate");
}
// Convert to USD per troy ounce: invert (1 / XPD-per-USD)
const usdPerOunce = 1 / xpdPerUsd;
return {
timestamp: ts,
base,
unit,
xpdPerUsd,
usdPerOunce
};
}
getPalladiumSpotUSD()
.then(console.log)
.catch(err => {
console.error(err);
process.exit(1);
});
A realistic JSON response and how to read it
The following is a representative Metals-API response (values shown are illustrative). Your request should match the parameters above:
{
"success": true,
"timestamp": 1790554135,
"base": "USD",
"date": "2026-09-28",
"rates": {
"XPD": 0.000744
},
"unit": "per troy ounce"
}
What you’ll actually use:
- success: Boolean flag you should always check. If false, inspect the error payload (not shown here).
- timestamp: UNIX epoch seconds. Treat as UTC. Use this to time-stamp your cache and UI.
- base: The quote base, here USD. Metals-API returns all rates relative to this base.
- rates.XPD: Palladium per USD (XPD per 1 USD) because unit is per troy ounce.
- unit: “per troy ounce” clarifies the physical unit. 1 troy ounce = 31.1034768 grams.
Inverting the quote to USD per troy ounce: Metals-API expresses metals as metal-per-base-currency. If rates.XPD is XPD per USD, then USD per XPD-ounce is 1 / rates.XPD. Many UIs and P&L calculations prefer USD/oz; always take the reciprocal when you need a price rather than a quantity per dollar.
If you need bid/ask instead of a mid or composite rate
When you need a tradable side for execution logic or to compute spreads, use the Bid/Ask endpoint. If a contract identifier like PAM26 is supported on your plan, pass that symbol; otherwise, use XPD to retrieve spot bid/ask and apply your contract basis or curve.
Example response shape for bid/ask (values are illustrative and shown here with XPT purely for structure; in your requests, use palladium’s symbol):
{
"success": true,
"timestamp": 1790554135,
"base": "USD",
"date": "2026-09-28",
"rates": {
"XPD": {
"bid": 0.000743,
"ask": 0.000745,
"spread": 0.000002
}
},
"unit": "per troy ounce"
}
How to read it:
- rates.XPD.bid and rates.XPD.ask are still per USD (XPD-per-USD). Invert each for USD-per-oz bid/ask.
- spread is the absolute difference in XPD-per-USD terms; invert appropriately if you display USD/oz.
For full parameter options and plan availability, see the Metals-API Documentation.
Using the rate for two practical tasks
1) Repricing a catalog or bill of materials
Goal: Recompute USD prices for components that depend on palladium content. You will use:
- rates.XPD from /latest (XPD per USD), invert to USD/oz.
- timestamp for audit and API-cache control.
- unit to confirm per–troy ounce, then convert to grams if needed (divide USD/oz by 31.1034768 for USD/g).
Example calculation:
- Obtain xpdPerUsd = data.rates.XPD.
- usdPerOz = 1 / xpdPerUsd.
- usdPerGram = usdPerOz / 31.1034768.
- Line item price = palladium_grams_in_part × usdPerGram + fabrication_premium.
Cache the response by timestamp and only refresh based on your plan’s update cadence to avoid unnecessary recalculations.
2) Alerting on a threshold move
Goal: Notify when palladium exceeds a USD/oz threshold (e.g., for hedging or purchase timing). You will use:
- rates.XPD inverted to USD/oz to test against your threshold.
- timestamp to ensure the alert corresponds to a fresh tick for your SLA.
Implementation sketch:
- Poll /latest every N minutes (align with your plan’s update frequency).
- Compute usdPerOz = 1 / rates.XPD.
- If usdPerOz ≥ threshold and lastAlertAt is older than your cooldown, send an alert and record timestamp.
Node.js fetch example with threshold alert logic
This snippet fetches palladium, converts to USD/oz, and runs a basic threshold check. It includes caching guidance in comments.
import process from "node:process";
const ACCESS_KEY = process.env.METALS_API_KEY || "YOUR_API_KEY";
const BASE = "USD";
const SYMBOL = "XPD"; // If your plan supports PAM26 and it's listed, set SYMBOL = "PAM26".
const THRESHOLD_USD_PER_OZ = 2000; // example threshold
const REFRESH_SECONDS = 600; // align with your plan (e.g., 600s ~= 10 min)
let cache = { value: null, fetchedAt: 0 };
async function fetchLatestPalladium() {
const now = Math.floor(Date.now() / 1000);
if (cache.value && now - cache.fetchedAt < REFRESH_SECONDS) {
return cache.value;
}
const url = `https://api.metals-api.com/latest?access_key=${ACCESS_KEY}&base=${BASE}&symbols=${encodeURIComponent(SYMBOL)}`;
const res = await fetch(url);
if (!res.ok) throw new Error(`HTTP ${res.status} ${res.statusText}`);
const data = await res.json();
if (!data.success) throw new Error(`API error: ${JSON.stringify(data)}`);
cache = { value: data, fetchedAt: now };
return data;
}
async function run() {
const data = await fetchLatestPalladium();
const unit = data.unit; // "per troy ounce"
const ts = data.timestamp; // UNIX seconds UTC
const xpdPerUsd = SYMBOL in data.rates ? data.rates[SYMBOL] : undefined;
if (typeof xpdPerUsd !== "number") throw new Error("Missing palladium rate");
// Convert to USD per oz
const usdPerOz = 1 / xpdPerUsd;
console.log({
symbol: SYMBOL,
base: data.base,
unit,
timestamp: ts,
usdPerOz
});
if (usdPerOz >= THRESHOLD_USD_PER_OZ) {
// fire your notifier here (email/SMS/webhook)
console.log(`ALERT: ${SYMBOL} crossed ${THRESHOLD_USD_PER_OZ} USD/oz at ts=${ts}`);
}
}
run().catch(err => {
console.error(err);
process.exit(1);
});
Practical details that save time
- Units: Metals-API quotes metals per troy ounce unless otherwise stated in the response unit field. 1 troy ounce = 31.1034768 grams. Convert carefully for BOM or per-gram SKUs.
- Base currency: If base=USD, rates.XPD is XPD per 1 USD. Invert to obtain USD per ounce. If you need EUR or another base, set base accordingly; always re-check inversion logic.
- Timestamps and timezone: timestamp is UNIX seconds; treat all dates as UTC for storage, caching, and scheduling.
- Caching: The /latest feed updates according to your plan (for example, every 60 or every 10 minutes). Cache each response for at least that long to avoid redundant calls. Also include a small jitter to prevent thundering herds at the update boundary.
- Weekends and market closures: Metal markets can be less active outside business hours. If rates don’t change across checks, your timestamp may advance while price remains the same. Handle this gracefully in alerts and UI refreshes.
- Validation: Always check success and the presence of the expected symbol key before using the value. Null checks are critical in production pipelines.
- Numeric stability: When inverting small decimals (metal-per-USD), ensure you’re using adequate numeric precision and rounding consistent with your pricing policy.
About palladium (XPD) in modern supply chains
Palladium sits at the crossroads of automotive technology and environmental solutions. It’s essential to catalytic converters that reduce emissions, and demand shifts with powertrain innovation. In smart manufacturing, palladium shows up in electronics and sensor assemblies where reliable conductivity is a must, while digital supply chains rely on transparent, auditable data flows to budget raw material costs and hedge exposures in real time. A consistent live quote helps teams integrate cost checks into build pipelines, procurement bots, and ERP order approvals.
Confirming PAM26 support and mapping to your workflows
If you specifically require the PAM26 contract rather than spot palladium, verify symbol availability first:
- Use the symbols directory to locate the exact code you need: Browse all supported metals symbols.
- If your plan and the exchange coverage include a contract-like symbol, pass it in symbols=... to /latest (and to the Bid/Ask endpoint if you need tradable sides).
- If PAM26 is not available directly, a common approach is to fetch XPD (spot), then apply your own forward curve, storage/financing basis, or vendor-provided spread to approximate the Jun 2026 price in your system.
For additional endpoints (historical, OHLC, and more) that you can use to backfill charts or compute realized volatility, see the Metals-API Documentation. Historical and time-series queries are available, but this guide focuses on live pricing.
Quick Python alternative (optional)
If you also maintain Python pipelines alongside Node.js, here is a minimal Python snippet using requests to fetch palladium and invert to USD/oz.
import os
import requests
ACCESS_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
url = f"https://api.metals-api.com/latest?access_key={ACCESS_KEY}&base=USD&symbols=XPD"
r = requests.get(url, timeout=10)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise SystemExit(f"API error: {data}")
xpd_per_usd = data["rates"]["XPD"] # XPD per 1 USD
usd_per_oz = 1 / xpd_per_usd
print({
"timestamp": data["timestamp"],
"base": data["base"],
"unit": data["unit"],
"usd_per_oz": usd_per_oz
})
Caching, refresh frequency, and cost control
- Refresh interval: Align your poll interval with your plan’s update cadence (e.g., 60 minutes or 10 minutes). Polling more frequently than updates wastes requests without fresher data.
- Global cache: Centralize rate fetching behind a small service or module so all app components reuse the same cached payload. Store both raw XPD-per-USD and derived USD/oz.
- Conditional UI updates: If timestamp or the rate hasn’t changed from the last call, skip re-rendering chart components to reduce compute and noisy alerts.
- Backoff and jitter: Add retry with exponential backoff for transient network errors, and randomize the poll start time to spread load across your fleet.
- Auditability: Persist the timestamp, base, and unit with any derived prices you calculate, so downstream systems can reproduce the inputs and validate conversions.
Where to go next
- Get your API key and try live calls: Sign up at Metals-API
- Look up exact symbol codes (including any contract-style codes on your plan): Explore the Supported Symbols
- Dive deeper into endpoints, parameters, and examples: Read the Metals-API Documentation
FAQ
Does Metals-API support the exact futures code “PAM26”?
Contract-style codes depend on coverage and plan. Always confirm on the Supported Symbols page. If the exact code isn’t listed, fetch palladium spot (XPD) and apply your own forward adjustments or vendor curves.
Why is the palladium number so small in the JSON?
Rates are metal-per-USD (“per troy ounce”). A small decimal like 0.000744 means 0.000744 ounces per 1 USD. Invert it to get USD per ounce (1 / 0.000744).
What timezone is the timestamp?
UNIX epoch seconds in UTC. Convert to your local display as needed and use it to control cache expiry and alert freshness.
How often should I refresh?
Match your plan’s update frequency for /latest (e.g., every 60 or every 10 minutes). Polling faster won’t produce newer data and will consume requests.
Can I get OHLC or historical data for backfills?
Yes. Metals-API offers OHLC and historical/time-series endpoints. See the documentation for parameters and examples. This article focused on live quotes.
Ready to wire live palladium prices into your Node.js app? Get an API key and start integrating in minutes at the Metals-API Website. If you require PAM26 specifically, verify symbol availability first on the Supported Symbols directory and plug it straight into the same requests shown here.