Nickel (NI) - Per Troy Ounce Spot Price API JSON
You need to show nickel’s per‑troy‑ounce spot price in your app and keep it in sync with live markets. By the end of this guide you’ll call the Metals-API latest endpoint for Nickel (NI), read the JSON, extract both ounces-per-USD and USD-per-ounce, convert to grams if needed, and implement caching and edge-case handling so your pricing, quoting, or risk tools stay reliable.
What you’re building: a clean “USD per troy ounce” Nickel quote
Metals-API returns Nickel with base USD by default. That means you get:
- rates.NI: nickel troy ounces per 1 USD (oz/USD)
- rates.USDNI: USD per 1 nickel troy ounce (USD/oz) — the field most UIs display
We’ll hit the latest endpoint, parse these two values, and expose USD/oz in your system. If you prefer grams or kilograms, we’ll derive those cleanly from the troy ounce quote.
Symbols and units you’ll use
Verify the exact codes on the Metals-API Supported Symbols. For nickel latest quotes, use these keys from the response:
| Field | Meaning | Unit | How to use it |
|---|---|---|---|
| NI | Nickel quoted as troy ounces per 1 USD | oz/USD | Invert to get USD/oz if USDNI is absent |
| USDNI | Nickel quoted as USD per 1 troy ounce | USD/oz | Display directly to users as the spot price |
| USD | Base currency indicator | — | Confirms prices are relative to USD |
Units:
- All metals are quoted per troy ounce unless otherwise noted. 1 troy ounce = 31.1034768 grams.
- To convert USD/oz → USD/g: divide by 31.1034768. To convert USD/oz → USD/kg: multiply USD/g by 1000.
Reference product pages and general info at metals-api.com, and keep the Metals-API Documentation open while you implement.
Get the latest Nickel spot in JSON (curl)
Request only the fields you need. Here we fetch both NI (oz/USD) and USDNI (USD/oz) to avoid client-side inversion math and rounding differences.
curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=NI,USDNI,USD"
Real response example (copy exact values for tests)
{"success":true,"timestamp":1790727240,"date":"2026-09-30","base":"USD","rates":{"NI":2.0271563682219,"USD":1,"USDNI":0.4933018565692296}}
What these fields mean in practice
- success: request status flag. If false, check the error object in your response (consult docs).
- timestamp: Unix epoch seconds for when this snapshot was computed. Use it for cache keys and staleness checks.
- date: ISO calendar date of the snapshot.
- base: the base currency is USD.
- rates.NI: 2.0271563682219 oz per 1 USD (oz/USD). You can invert this if you ever need to: USD/oz = 1 / NI.
- rates.USDNI: 0.4933018565692296 USD per troy ounce (USD/oz). This is what most frontends will display.
Python example: display USD/oz and convert to grams
This snippet fetches the latest nickel price, picks USD/oz if available (USDNI), or falls back to 1/NI. It also computes per‑gram and per‑kilogram prices for manufacturing workflows.
import requests
API_URL = "https://metals-api.com/api/latest"
API_KEY = "YOUR_API_KEY"
params = {
"access_key": API_KEY,
"symbols": "NI,USDNI,USD"
}
resp = requests.get(API_URL, params=params, timeout=10)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError(f"Metals-API error: {data}")
rates = data["rates"]
# Prefer direct USD/oz if present
usd_per_oz = rates.get("USDNI")
if usd_per_oz is None:
ni_oz_per_usd = rates["NI"] # oz/USD
usd_per_oz = 1.0 / ni_oz_per_usd
OZT_TO_G = 31.1034768
usd_per_g = usd_per_oz / OZT_TO_G
usd_per_kg = usd_per_g * 1000
print({
"timestamp": data["timestamp"],
"date": data["date"],
"usd_per_oz": usd_per_oz,
"usd_per_g": usd_per_g,
"usd_per_kg": usd_per_kg
})
Why this pattern is robust
- Symbol selection: requesting NI and USDNI lets you use server-provided USD/oz directly and avoid floating point inversion drift.
- Fallback: if USDNI isn’t present for your plan, 1/NI gives you USD/oz consistently.
- Units: keep conversions centralized (OZT → g → kg) so you don’t repeat math all over your codebase.
Devs’ checklist: correctness and latency in production
Getting the number once is easy. Shipping it reliably takes a few more steps.
1) Updates and caching
- Update cadence depends on your plan (e.g., 60-minute or 10-minute intervals). Align your cache TTL to the update interval of your subscription to avoid unnecessary calls.
- Cache by (symbol set + base + rounded interval). For example, key: latest:USD:NI,USDNI:2026-09-30T12:00 block.
- Pin to timestamp: if your business logic needs stability during a quoting session, hold the same snapshot (timestamp) across the session.
2) Time zones, weekends, and market hours
- Use the response timestamp (Unix seconds) for sequencing rather than the local clock.
- On weekends or holidays, expect the last available snapshot to persist until markets reopen; handle “no change” safely in charts and PnL.
3) Base currency and inversion
- Default base is USD. With base=USD, NI is oz/USD (ounces per dollar). USDNI is the direct USD/oz quote.
- If for any reason USDNI isn’t in your response, derive USD/oz as 1/NI and format consistently in your UI.
4) Units: troy ounces vs grams
- Manufacturing BOMs often need grams or kilograms. Always convert from the canonical USD/oz number in one utility function to avoid rounding mismatches across services.
- Remember: troy ounces, not avoirdupois. 1 ozt = 31.1034768 g.
5) Error handling
- Check success in the JSON. If false, inspect the error payload (see the Documentation for structure) and alarm on authentication or quota issues.
- Implement a bounded retry with backoff only for transient network failures, not for authentication errors.
6) Presentation: rounding and significant digits
- Store high precision internally; format for users (e.g., 2–4 decimals for USD/oz depending on your product requirements).
- Ensure your UI annotates units clearly (USD per troy ounce, USD per gram) to avoid purchasing errors.
Add historical and analytics when you’re ready
To backfill charts, compute daily changes, or analyze volatility, explore the Historical and Time-Series endpoints. Keep nickel-only requests tight for performance, and reuse the same symbol codes (NI, USDNI) so your analytics layer and live quotes match. The endpoint reference and parameters are detailed in the Documentation.
When you need a definitive symbol inventory or want to confirm additional cross rates, consult the Symbols page.
Where nickel data fits: trading, pricing, and automation
- Dynamic quoting: Reprice nickel-bearing components (battery foils, alloys) every 10–60 minutes based on USD/oz, auto-converted to USD/kg for BOMs.
- Risk triggers: Alert when USDNI crosses thresholds; feed signals into a hedging workflow.
- Procurement analytics: Blend USD/oz nickel with FX rates to cost in non‑USD currencies downstream.
For market context beyond raw ticks, see exchange resources like the LME’s nickel contract page: LME Nickel overview (use as a reference; your app should source live numbers from the API metrics you’ve integrated).
Production patterns you can copy
Request shaping
- Only request symbols you actually use: symbols=NI,USDNI,USD keeps payloads small.
- Pin your code to these keys so downstream services know exactly which fields to expect.
Service boundaries
- Create a “pricing service” that calls Metals-API and normalizes to USD/oz, USD/g, USD/kg with one codepath and a stable response schema for internal consumers.
- Tag outputs with the source timestamp and your own received_at timestamp to trace latency.
Scaling calls
- Frontload caching at the pricing service; avoid every frontend calling the external API.
- If you fan out to multiple consumers, push an event (e.g., NickelPriceUpdated) keyed by the API timestamp rather than a wall-clock schedule.
Quick reference: the fields you’ll actually use
- timestamp: convert to your preferred datetime for logs and dashboards.
- date: display-friendly day marker for snapshots and EOD summaries.
- rates.USDNI: primary display price (USD per troy ounce).
- rates.NI: backup if you need to compute USD/oz as 1/NI, or for cross calculations.
Advanced: conversions, aggregates, and alerts
- Convert to non-USD quoting: if you price in EUR or JPY, combine USD/oz with your FX feed downstream. Keep nickel math consistent by always starting from USDNI.
- Compute EOD aggregates: if you snapshot at cadence, you can derive OHLC locally for intraday dashboards even if you’re only using latest in real time.
- Tolerance bands: when quotes update less frequently (e.g., every 60 minutes), implement a tolerance band and color-code whether your displayed price is “fresh” or “stale” versus target SLA.
Registration, plans, and next steps
Create an API key and start calling the latest endpoint for nickel. Metals-API does not offer a free trial; choose a plan that fits your update cadence and endpoints. For example, Copper Monthly is $19.99/mo; see plan details in your account area and learn about managed connectivity at Metals Connectivity Platform (MCP). Keep the main site handy at metals-api.com.
FAQ
Is the Nickel symbol NI or something else?
In the latest endpoint used here, nickel is NI. You can confirm every available code on the Symbols page.
What’s the difference between NI and USDNI?
With base=USD, NI is ounces per USD (oz/USD). USDNI is USD per ounce (USD/oz). Most pricing UIs use USDNI directly; if missing, compute USD/oz as 1/NI.
Are prices per troy ounce or per metric ton?
Metals-API quotes are per troy ounce by default. Convert to grams or kilograms as needed (1 ozt = 31.1034768 g).
How frequently does the latest price update?
Update intervals depend on your subscription. Cache responses accordingly and check the timestamp to understand staleness. See the Documentation for endpoint behavior.
Can I retrieve historical nickel data?
Yes. Use the Historical or Time-Series endpoints for past dates and ranges. Keep your symbol list focused (e.g., NI, USDNI) for consistent analytics. Details are in the Documentation.
Ready to plug nickel into your app? Get your API key at Register, scan the Documentation, and keep your symbol map from Symbols pinned in your repo. If you need managed connectivity and controls, explore MCP next.