Platinum Apr 2027 (PLJ27) - Per Troy Ounce Historical Price API — using OHLC and volume fields in analysis
Symbol: Platinum Apr 2027 (PLJ27) →
You need to backfill and analyze the per–troy ounce history for the Platinum April 2027 contract (PLJ27) and use OHLC bars for signals and backtests. By the end of this guide, you’ll be able to fetch PLJ27 in USD terms, invert to USD/oz, request daily history, layer in OHLC bars for your indicators, and structure the data pipeline so your trading or pricing model stays robust across weekends and market closures.
What we’re building: a practical PLJ27 data pipeline
We’ll focus on three moves that cover most PLJ27 analysis use cases:
- Query the latest rate for PLJ27 as “per USD” and invert to “USD per troy ounce” when needed (or use the built-in USDPLJ27 symbol).
- Backfill a daily time series for PLJ27 to compute moving averages, carry signals, and price relatives.
- Enrich your analysis with OHLC bars for session-aware indicators (range, ATR, gap logic). If you track volume, we’ll show where it fits in the stack even if you bring it from your execution venue.
If you need to verify symbol coverage or contract codes, use the up-to-date catalog at Symbols. For request structure, parameters, and endpoint behavior, keep the Documentation handy in a separate tab.
Why PLJ27 data matters now: platinum and the green transition
Platinum (XPT) sits at the center of clean energy and sustainability transitions: hydrogen fuel cells, catalytic applications for emissions control, and components in smart/connected industrial systems. Futures like PLJ27 reflect market expectations for supply-demand balances through April 2027—the horizon that many automotive, fuel cell, and industrial programs actively model. If you build pricing logic for EV supply chains, ESG-focused strategies, or inventory hedging workflows, daily PLJ27 plus OHLC context is a practical backbone.
Units, base currency, and symbol inversion for PLJ27
Key details that save time:
- Unit: Metals-API returns metal rates “per troy ounce” when the base is USD. In practice, rates.PLJ27 is “troy ounces of PLJ27 per 1 USD”.
- Base currency: Default base is USD. That means the numeric value is typically a small decimal for precious metals—because it’s ounces per USD.
- Inversion: To obtain USD per troy ounce for PLJ27, either invert rates.PLJ27 (USD/oz = 1 / PLJ27) or request USDPLJ27 directly if supported. Both approaches are equivalent when sourced at the same timestamp.
- Timestamps: Treat API timestamps as UNIX seconds (UTC). Align your downstream analytics and caches to UTC to avoid session drift.
| Symbol | Description | Unit | Interpretation when base=USD |
|---|---|---|---|
| PLJ27 | Platinum April 2027 futures | troy ounces | rates.PLJ27 = ounces of PLJ27 per 1 USD; USD/oz = 1 / PLJ27 |
| USDPLJ27 | Inverse of PLJ27 | USD per troy ounce | Directly usable as USD per ounce (no inversion required) |
| XPT | Spot platinum (generic) | troy ounces | Useful as a benchmark vs. futures like PLJ27 |
Endpoint choices for PLJ27 workflows
We’ll focus on a short list that cleanly supports a PLJ27 backtest and daily analytics:
- Latest rates: for the most recent PLJ27 price snapshot; invert to USD/oz or use USDPLJ27 if available in the same response.
- Time-series: for daily historical rates between a start and end date; this is your backfill and rolling indicator foundation.
- OHLC: for open-high-low-close bars on a given date; use this for range, gap, and session-aware indicators.
Full parameter references and additional endpoints (e.g., bid/ask, convert, fluctuation) are covered in the Documentation. If you don’t see a symbol in your plan, confirm coverage on the Symbols page.
Copy-paste: fetch the latest PLJ27 and USDPLJ27
Use the latest endpoint to retrieve PLJ27 in troy ounces per USD and its inverse (USD/oz) in one response. This is the fastest way to both display a human-friendly price and store the raw base rate for parity checks.
curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=PLJ27,USDPLJ27,USD"
Example of a valid response (use these exact values in tests while wiring your parser):
{"success":true,"timestamp":1793318880,"date":"2026-10-30","base":"USD","rates":{"PLJ27":0.00066155067478169,"USD":1,"USDPLJ27":1511.5999999999963}}
What these fields mean in practice
- success: Boolean OK flag.
- timestamp: UNIX epoch seconds (UTC). You should store it to track staleness and cache windows.
- date: Trading date associated with this snapshot.
- base: USD, meaning values are quoted relative to 1 USD.
- rates.PLJ27: Ounces of PLJ27 per 1 USD. For display in USD/oz, compute 1 / PLJ27 or read USDPLJ27.
- rates.USD: Parity value (1); handy for asserting your math and unit checks.
- rates.USDPLJ27: USD per troy ounce. Suitable for end-user displays without inversion.
Python example: normalize to USD/oz and persist
This sample calls the same latest endpoint, reads PLJ27 and USDPLJ27, cross-checks the inversion, and shows where to store results for downstream time-series analysis.
import os
import time
import math
import requests
API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
URL = "https://metals-api.com/api/latest"
params = {
"access_key": API_KEY,
"symbols": "PLJ27,USDPLJ27,USD"
}
resp = requests.get(URL, params=params, timeout=10)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError(f"API error: {data}")
ts = data["timestamp"] # UTC seconds
base = data["base"] # Expect 'USD'
rates = data["rates"]
plj27_per_usd = rates["PLJ27"] # ounces per USD
usd_per_oz = rates["USDPLJ27"] # USD per ounce (inverse)
calc_inverse = 1.0 / plj27_per_usd # theoretical inverse
diff = abs(calc_inverse - usd_per_oz)
# Tolerance check: small numeric differences can occur due to rounding
if diff > 1e-6 * usd_per_oz:
raise ValueError(f"Inversion mismatch: api={usd_per_oz}, calc={calc_inverse}")
# Example: prepare a record to persist
record = {
"symbol": "PLJ27",
"timestamp_utc": ts,
"date": data.get("date"),
"base": base,
"plj27_oz_per_usd": plj27_per_usd,
"plj27_usd_per_oz": usd_per_oz,
"ingested_at": int(time.time())
}
print(record)
Recommendations for production:
- Persist both representations (oz/USD and USD/oz). The former is native to the API; the latter fits UI and backtesting artifacts.
- Store timestamp and date. Use timestamp for cache invalidation and latency analytics; use date to align with your daily bars.
- Implement retries with jitter and backoff, and add simple drift checks like the inversion parity used above.
Daily history for PLJ27: backfill and deltas with the time-series endpoint
For historical studies—moving averages, breakouts, or carry—you’ll want daily rates between a start and end date. The time-series endpoint returns daily snapshots keyed by date. With PLJ27, you can request the contract symbol across the desired window and standardize to USD per ounce after ingestion.
Basic approach:
- Call the time-series endpoint with start_date and end_date and symbols=PLJ27 (and optionally USDPLJ27 for direct USD/oz).
- Normalize each day to USD/oz either by inversion or by reading USDPLJ27.
- Handle missing dates (weekends/holidays) by forward-filling your model inputs as needed.
Always confirm current parameters and plan constraints in the Documentation, and verify supported symbols on Symbols before scheduling large backfills.
OHLC for PLJ27: how to use bars in analysis
The Open/High/Low/Close endpoint gives you a bar per symbol and date. You’ll use it to compute range-based indicators:
- Daily range = high − low
- True range = max(high − low, abs(high − prior_close), abs(low − prior_close))
- Gap logic = today.open − prior_close
- Session bias = close − open
Workflow tips:
- Query the OHLC endpoint for the date you need. Align symbols to PLJ27 for contract-specific bars (not spot XPT) when modeling futures.
- Join today’s OHLC with yesterday’s close to compute true range and gaps. These are sensitive to missing days; resolve weekends first.
- Retain the rate unit convention: if the bar fields are reported in ounces per USD, invert to USD/oz consistently before computing your indicators.
If your system requires volume, incorporate it from your execution venue or exchange reference feed. Metals-API focuses on price; volume is not included in the OHLC example shown in the documentation snippets above. Keep your volume series on the same daily calendar as your OHLC bars. For exchange holiday references, see the CME Holiday Calendar and match to your PLJ27 trading hours logic.
Putting OHLC and volume together (what to compute and where)
While you’ll source OHLC from Metals-API and volume from your trading venue:
- Normalize price first: convert all bar fields to USD per troy ounce (either directly via USDPLJ27 fields if available in your bar payload, or by inverting each OHLC component). Do not mix units within the same bar set.
- Compute:
- ATR(n): rolling mean of true range across n sessions.
- VWAP (session): requires intraday data plus volume; with daily granularity, use volume-weighted close if your volume comes as a session total and you have a representative price (e.g., settlement).
- Breakouts: n-day high/low on the high/low columns, not closes.
- Liquidity screens: rolling median of daily volume; exclude days below a threshold when simulating fills.
- Persist your derived fields by trade date and timestamp to ensure reproducibility in backtests.
Caching, calendars, and fail-safes you should implement
These details are easy to overlook and cost time later:
- Cache latest responses keyed by symbol and rounded timestamp bucket. If your plan updates every N minutes, align your cache TTL to slightly less than N minutes to avoid excessive requests while staying fresh.
- Weekends and market closures: daily time series will naturally skip non-trading days. For indicators requiring continuity, forward-fill close-only fields, but avoid forward-filling high/low/open.
- Clock alignment: treat timestamps as UTC. Convert to your exchange’s reference timezone only at the presentation layer or in reporting.
- Unit assertions: on ingest, validate that base=="USD" and unit is “per troy ounce.” Log and quarantine anomalies.
- Symbol roll: PLJ27 is a specific contract month. For continuous futures analytics, document how you roll (e.g., volume-based or days-to-expiry) and record roll dates distinctly from trade dates.
From platinum data to sustainable innovation analytics
If you model hydrogen fuel cells or emissions-control components, PLJ27 helps translate future input costs into project economics. Common transformations include:
- Bill-of-materials hedging: map platinum content (grams) to troy ounces (1 troy ounce = 31.1034768 grams), then multiply by USD/oz (USDPLJ27) to compute cost exposure per unit.
- Smart manufacturing pricing: connect PLJ27 USD/oz to automated price adjusters via ERP, with rate changes gated by ATR-derived thresholds to reduce noise.
- Digital twin stress tests: shock PLJ27 OHLC ranges to test buffer inventory policies in clean-energy supply chains.
Operational checklist before you ship
- Validation:
- Check inversion parity between PLJ27 and USDPLJ27 on ingest; alert on drift beyond a tiny epsilon.
- Enforce that all bars in a batch share the same base and unit.
- Calendars:
- Store date and timestamp separately. Use date for your daily joins and timestamp for freshness and caches.
- Document holiday handling. Maintain a table of expected missing dates by venue.
- Storage:
- Partition by symbol and date for fast range reads.
- Persist raw payloads alongside normalized columns for auditability.
- Performance:
- Batch time-series requests by symbol and date spans where supported.
- Use conditional fetches and modest backoff to respect plan cadence.
If you price in grams or other currencies
Metals-API’s default is per troy ounce with base=USD. To support grams, convert USD/oz to USD/gram by dividing by 31.1034768, and then convert currencies in your application or via the API’s currency conversion features (see the conversion and base options in the Documentation). Keep unit conversions explicit in code, and store the final unit per column.
Where to learn more and get access
- Planning your integration or validating symbol coverage? Start here: Metals-API Supported Symbols.
- Endpoint parameters, response schemas, and usage examples: Metals-API Documentation.
- Ready to request an API key and start building? Register.
- If you need managed connectivity or help with enterprise workflows, visit MCP.
FAQ
Does the API return USD per troy ounce or ounces per USD?
By default, base=USD and rates are “per troy ounce” in the sense that the number you see for PLJ27 is ounces per 1 USD. To display USD per ounce, either invert (1 / PLJ27) or read USDPLJ27 when available in the same call.
How should I handle weekends and holidays in time-series data?
Expect missing dates. For indicators like moving averages on close, forward-fill the most recent close through non-trading days if your strategy requires continuity. Do not forward-fill high/low/open. Keep your series in UTC and document the calendar you adhere to.
Where do I get volume for PLJ27 OHLC analysis?
Price comes from Metals-API; volume should be sourced from your execution venue or an exchange reference. Join it on trade date to the OHLC bar. Keep unit consistency (USD/oz) before computing volume-weighted metrics.
Can I backtest using both spot platinum (XPT) and PLJ27?
Yes, but keep them separate in storage and normalize both to USD/oz. When you compute spreads or basis (PLJ27 − XPT), ensure timestamps and calendars are aligned and handle missing days consistently.
Any quick sanity checks to automate?
Verify base=="USD", assert unit consistency, check inversion parity between PLJ27 and USDPLJ27, log large day-over-day deltas, and alert when timestamps are older than your plan’s expected update cadence.
Get your API key and start shipping your PLJ27 pipeline now. Create your account here: Register. For help with connectivity and production rollouts, see MCP, and keep the Documentation and Symbols pages open while you build.