Get Rhodium (XRH) - Per Ounce Historical Prices using this API for daily time series
Building a daily rhodium price history—quoted per troy ounce, symbol XRH—is a practical need across trading desks, pricing engines, and research tools. In this guide, you’ll learn how to retrieve Rhodium (XRH) historical prices using the Metals-API time-series and historical endpoints, and how to augment daily bars with OHLC for better analytics and backtesting. We’ll cover implementation patterns, field-by-field response anatomy, caching strategies, timezone and units gotchas, and production-grade tips for resilient ingestion pipelines. If you’re here to get started quickly, you can head to the Metals-API Website and get a free API key, then come back to wire up your historical feed.
Use case: daily rhodium time series for pricing, backtesting, and reporting
Whether you’re building a volatility model, revaluing inventory, or backfilling charts, Rhodium (XRH) daily close data remains hard to source consistently. Metals-API exposes standardized, troy-ounce-denominated prices for XRH via simple JSON, letting you:
- Backfill a multi-year daily time series for XRH in minutes.
- Normalize quotes to USD per troy ounce for consistent valuation.
- Retrieve specific days for audit-trails or month-end close.
- Generate OHLC bars for quant signals and charting.
- Integrate into pricing tools, ERP systems, or dashboards.
The rest of this article shows exactly how to request Rhodium (XRH) per-ounce historical prices, parse responses, and operationalize data flows. If you need to validate symbol mapping, check the official Metals-API Supported Symbols.
Why Rhodium (XRH) data is different—and how Metals-API helps
Rhodium is a critical, scarce PGM (platinum-group metal) used primarily in catalytic converters and high-spec industrial applications. Its price is notoriously volatile and liquidity can be thinner than in other metals, which makes clean historical data essential for models and risk limits. With Metals-API, you get a consistent JSON format, timestamps, and unit annotations (“per troy ounce”) that simplify data engineering. This ties into broader themes developers are pushing forward:
- Digital transformation in metal markets: codifying OTC and reference pricing into programmatic feeds.
- Technological innovation: embedding live and historical XRH data directly into smart pricing and procurement systems.
- Data analytics at scale: running backtests and sensitivity analyses for Rhodium exposure across books and BOMs.
- Smart integrations: automating alerts, dashboards, and ERP sync with minimal overhead.
- Future-proofing: composable APIs that support both daily time series and OHLC, letting you evolve analytics as needs grow.
Endpoints you will use for Rhodium (XRH)
For the use case “Get Rhodium (XRH) per ounce historical prices for daily time series,” these three endpoints are typically sufficient:
- Historical Rates: point-in-time daily rate by date (YYYY-MM-DD)
- Time-Series: a range of daily rates between start_date and end_date
- Open/High/Low/Close (OHLC): daily bar components for XRH
For broader endpoint coverage (latest, fluctuation, intraday, LME history, carat, and more), consult the Metals-API Documentation. This article stays focused on XRH historical and time-series data.
Quick reference: endpoints vs. what to use when
| Endpoint | Primary purpose | When to choose it | Key parameters |
|---|---|---|---|
| Historical | Single-day snapshot of XRH | Ad-hoc lookups, reconciliations, unit tests | date (path), base, symbols |
| Time-Series | Daily XRH series over a date range | Backfills, rolling refreshes, charting | start_date, end_date, base, symbols |
| OHLC | Daily bar components for XRH | Trading models, technical analysis | date (path), base, symbols |
Units, currency base, and timestamps
Metals-API returns metal rates with these default semantics (watch these carefully in production):
- Base currency: USD by default (base = "USD" in responses). Always pass base=USD in queries unless you have a specific conversion pipeline.
- Units: “per troy ounce” for precious/PGM symbols like XRH. A troy ounce is approximately 31.1034768 grams. If you price in grams or kilograms, you’ll need to convert.
- Timestamps and dates: Dates are expressed as YYYY-MM-DD. The timestamp is a Unix epoch (seconds) representing when the rate was last updated. Treat times as UTC unless your internal system enforces another standard.
Authentication and basic request structure
Every request includes your API key using the access_key parameter. Organize your configuration so keys are not hard-coded in source (environment variables or secret managers are preferred). If you haven’t registered yet, visit the Metals-API Website to get your free API key in minutes.
Time-Series endpoint for daily Rhodium (XRH) history
The time-series endpoint is the most efficient way to backfill or refresh a daily XRH series across a date range. You’ll typically schedule a batch to run once a day to roll your dataset forward.
Purpose and functionality
Returns daily XRH rates for each date within the requested interval, with each rate expressed per troy ounce and relative to USD by default. Missing dates (weekends, holidays, or any date without a published fixing) may not appear. Always reconcile against requested dates in your ingestion pipeline.
Parameters
- access_key: your API key
- base: set to USD for normalized results
- symbols: XRH
- start_date: inclusive, format YYYY-MM-DD
- end_date: inclusive, format YYYY-MM-DD
Example curl request
curl -s "https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&base=USD&symbols=XRH&start_date=2024-01-01&end_date=2024-01-31"
Example JSON response (time-series)
{
"success": true,
"timeseries": true,
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"base": "USD",
"rates": {
"2024-01-02": { "XRH": 0.0000524 },
"2024-01-03": { "XRH": 0.0000521 },
"2024-01-04": { "XRH": 0.0000530 },
"2024-01-05": { "XRH": 0.0000536 }
/* ... additional business days in the range ... */
},
"unit": "per troy ounce"
}
Field-by-field: what you’ll actually use
- success: boolean guard for program flow; check before parsing body.
- timeseries: indicates this is a time-series response.
- start_date/end_date: echo your request, useful for logging and audit trails.
- base: currency reference; “USD” aligns with default metals conventions.
- rates: mapping of YYYY-MM-DD to objects with daily XRH quotes.
- unit: confirms price denomination (“per troy ounce”).
Interpreting time-series values
In Metals-API responses like the above, the XRH number is the units of XRH you get for 1 USD (rate is relative to USD). For most workflows, you want USD per troy ounce. To invert the quote for display or valuation, compute 1 / rate. Keep unit annotations clear in your system: either store “XRH per USD” directly from Metals-API or convert and store “USD per XRH-oz,” but don’t mix conventions.
Handling weekends and closures
- Expect gaps: time-series outputs generally include business days. Don’t assume seven entries per week.
- Backfill policy: if your analytics need continuous series, run a forward-fill after ingestion at the warehouse layer—but mark synthetic carries for transparency.
Production tips for time-series pulls
- Chunk large ranges: break multi-year backfills into monthly or quarterly requests to avoid oversized payloads.
- Idempotent ingestion: if a batch re-runs, merge by date with upsert semantics to avoid duplicates.
- Caching: persist recent ranges locally for repeated analytics to reduce calls and latency.
Historical endpoint for single-day Rhodium (XRH) lookups
When you only need one date—say, EOM or a specific audit date—use the historical endpoint by appending the date to the path.
Purpose and functionality
Returns XRH rate for a specific date. Ideal for spot QA, reconciling a single day, or filling in a minor gap without pulling a full range.
Parameters
- access_key
- base=USD
- symbols=XRH
- date: in the URL path, format YYYY-MM-DD
Example curl request
curl -s "https://metals-api.com/api/2024-02-15?access_key=YOUR_API_KEY&base=USD&symbols=XRH"
Example JSON response (historical)
{
"success": true,
"timestamp": 1708041600,
"base": "USD",
"date": "2024-02-15",
"rates": {
"XRH": 0.0000551
},
"unit": "per troy ounce"
}
Field-by-field: what you’ll actually use
- date: the effective date for the returned quote; use this as your primary key column in a warehouse table.
- timestamp: seconds since epoch; store this alongside date if you require traceability to the update time.
- rates.XRH: the quote relative to USD per troy ounce. Invert if you need USD per ounce.
Common pitfalls with single-day requests
- Non-business days: If you query a weekend/holiday, verify whether a rate is present for that date. Design logic to retry nearby business days or flag missing data.
- Unit mismatch: Don’t assume grams; the response specifies “per troy ounce.” Convert explicitly if needed.
OHLC endpoint for Rhodium (XRH) daily bars
For charting and trading logic, daily bars (open, high, low, close) convey more than closes alone. Use the OHLC endpoint for day-level price structure for XRH.
Purpose and functionality
Provides open, high, low, close for a given date. Use this to build candlestick charts, compute intraday ranges, or estimate realized volatility. Combine with the time-series endpoint to enrich your pipeline.
Parameters
- access_key
- base=USD
- symbols=XRH
- date: placed in the path
Example curl request
curl -s "https://metals-api.com/api/open-high-low-close/2024-03-01?access_key=YOUR_API_KEY&base=USD&symbols=XRH"
Example JSON response (OHLC)
{
"success": true,
"timestamp": 1709251200,
"base": "USD",
"date": "2024-03-01",
"rates": {
"XRH": {
"open": 0.0000560,
"high": 0.0000568,
"low": 0.0000554,
"close": 0.0000566
}
},
"unit": "per troy ounce"
}
Using OHLC effectively
- Signals: compute ranges (high-low), candle bodies (close-open), and gap analyses across dates.
- Risk: generate day-level realized range estimates for stress testing and margin policies.
- Visualization: candlestick charts, with clear unit labeling (“XRH per USD” or inverted as “USD/oz”).
End-to-end workflow: backfill, store, and refresh XRH daily data
- Symbol check: confirm Rhodium symbol is XRH in the Metals-API Supported Symbols.
- Backfill range: call time-series over quarterly chunks from your desired start date to today.
- Normalize: decide whether to store as “XRH per USD” (as returned) or transform to “USD per XRH-oz” (invert). Persist a unit column.
- Warehouse schema: store date (PK), rate, unit, base, and optionally timestamp. For OHLC, add open, high, low, close fields.
- Daily refresh: schedule a job that requests yesterday’s or today’s close depending on your accounting policy, then upserts.
- Quality controls: reconcile expected business days, gap-fill rules, and unit tests for non-decreasing date order and numeric bounds.
JavaScript example: fetch and ingest XRH time-series
The example below queries a month of XRH data, inverts to USD per ounce, and normalizes into a simple in-memory array. Extend it to your warehouse writer of choice (e.g., Postgres, BigQuery).
async function fetchXRHTimeSeries({ apiKey, startDate, endDate }) {
const url = new URL("https://metals-api.com/api/timeseries");
url.searchParams.set("access_key", apiKey);
url.searchParams.set("base", "USD");
url.searchParams.set("symbols", "XRH");
url.searchParams.set("start_date", startDate);
url.searchParams.set("end_date", endDate);
const res = await fetch(url.toString(), { method: "GET" });
if (!res.ok) {
throw new Error(`HTTP ${res.status} from Metals-API`);
}
const data = await res.json();
if (!data.success || !data.rates) {
throw new Error("Unexpected response structure or unsuccessful request");
}
// Transform into USD per ounce and sort by date
const rows = Object.entries(data.rates)
.map(([date, obj]) => {
const xrhPerUsd = obj.XRH; // as returned: XRH per USD (per troy ounce)
const usdPerOz = 1 / xrhPerUsd; // convert to USD per troy ounce
return {
date,
usd_per_oz: usdPerOz,
quote_raw: xrhPerUsd,
unit: data.unit,
base: data.base
};
})
.sort((a, b) => a.date.localeCompare(b.date));
return rows;
}
// Example invocation:
fetchXRHTimeSeries({
apiKey: process.env.METALS_API_KEY,
startDate: "2024-01-01",
endDate: "2024-01-31"
})
.then(rows => {
console.log(`Loaded ${rows.length} XRH rows`);
console.log(rows.slice(0, 3));
})
.catch(err => {
console.error("XRH fetch failed:", err);
});
Interpreting and validating responses
Beyond field parsing, implement guardrails:
- Success flag: Halt processing if success is false.
- Unit checks: data.unit should equal “per troy ounce” for XRH; alert if this ever deviates.
- Base consistency: ensure base is “USD”; mixed bases in your warehouse make analytics brittle.
- Monotonic dates: enforce ascending order during ingestion; reject duplicate dates unless you explicitly update/overwrite.
Caching and performance optimization
- Layered cache: implement a short-lived cache (minutes to hours) for recent historical pulls to avoid repeated calls during dev or dashboard refreshes.
- Compression: enable HTTP compression in your client if supported to reduce payload sizes on long ranges.
- Batching: aggregate daily refreshes—e.g., pull a rolling 7-day window to catch late revisions instead of only T-1.
- Idempotency: design ingestion to upsert by date; safe to re-fetch an interval and reconcile deterministically.
Data transformations: ounces vs. grams and currency conversion
Metals-API returns Rhodium (XRH) per troy ounce, relative to USD. If your downstream systems prefer metric units or local currencies:
- Grams: 1 troy ounce = 31.1034768 grams. If you store USD per gram, compute (USD per ounce) / 31.1034768.
- Kilograms: multiply grams by 1000.
- Other currencies: you can convert amounts using Metals-API’s conversion capabilities; see Metals-API Documentation for details. Keep currency codes explicit in your schema.
Keep one canonical store (e.g., USD per troy ounce), and derive all alternates from that source to avoid compounding rounding errors.
Dealing with market microstructure realities for Rhodium
XRH can exhibit larger day-over-day jumps than mainstream precious metals. Your models should account for:
- Volatility filters: set sanity bounds for daily percentage change; route outliers for review rather than auto-rejecting.
- Sparse days: not every calendar day will have a fixing. Coding defensively for missing entries prevents broken charts.
- Revision policy: if your controls require deterministic historicals, snapshot data with versioning. If you prefer the freshest truth set, schedule small backfills (last 3–5 days) nightly to capture any late updates.
Security and key management
- Secret storage: keep access_key in an environment variable or a secret manager (AWS Secrets Manager, HashiCorp Vault, etc.).
- Least privilege: scope deployment variables so API keys aren’t visible to client-side code in public apps.
- Network hygiene: prefer HTTPS-only calls; validate TLS certificates as configured by your platform.
- Error hygiene: never log full URLs with keys in shared logs; scrub or mask access_key in telemetry.
Monitoring and observability
- SLOs: define availability and freshness targets for your data ingestion.
- Instrumentation: log start_date, end_date, symbol, rows ingested, and any gaps found.
- Alerts: notify on empty results for business days, unexpected base or unit values, or parse errors.
Validation of symbols and metadata
Always verify the Rhodium symbol (XRH) and metadata using the official symbols reference. The list evolves, and ensuring correct symbol routing prevents silent data mismatches. Bookmark the Metals-API Supported Symbols page for ongoing checks.
Bringing it all together: an implementation checklist
- Get your API key: sign up on the Metals-API Website.
- Choose endpoints: time-series for backfills and rolling updates; historical for one-off days; OHLC for technical analytics.
- Normalize units: decide on “XRH per USD” vs. “USD per XRH-oz” and stick to one convention internally.
- Date discipline: handle weekends and holidays gracefully; implement forward-fill only if appropriate and always tag synthetic entries.
- Storage: model tables with date PK, rate, unit, base, timestamp; extend with OHLC fields as needed.
- Observability: log parameters, measure ingestion lag, alert on anomalies.
Additional reference materials
- Full endpoint details, parameters, and capabilities: Metals-API Documentation
- Symbols and their definitions: Metals-API Supported Symbols
- Main site to register and manage your key: Metals-API Website
- Background on Rhodium’s industrial role: Rhodium overview (Wikipedia)
- Market insights on PGMs: World Platinum Investment Council
Complete example: building a daily XRH pipeline with curl and post-processing
This example demonstrates a two-step approach using curl and a simple transformation workflow outline:
- Pull a month of XRH with time-series.
- Transform values to USD per oz and write to storage.
1) Pull data
curl -s "https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&base=USD&symbols=XRH&start_date=2024-04-01&end_date=2024-04-30" \
-o xrh_2024_04.json
2) Sample of realistic response structure
{
"success": true,
"timeseries": true,
"start_date": "2024-04-01",
"end_date": "2024-04-30",
"base": "USD",
"rates": {
"2024-04-01": { "XRH": 0.0000588 },
"2024-04-02": { "XRH": 0.0000585 },
"2024-04-03": { "XRH": 0.0000587 }
/* ... business days within 2024-04 ... */
},
"unit": "per troy ounce"
}
3) Post-processing guidance
- Integrity: assert data.success is true; assert base === "USD"; assert unit === "per troy ounce".
- Transform: invert XRH-per-USD to USD-per-ounce if that’s your canonical measure.
- Persist: upsert rows keyed by date.
- Audit: store the original response blob alongside parsed fields for traceability.
Troubleshooting guide
- Empty or partial date coverage: Validate that your start_date and end_date are in correct format and represent business days. If weekends are missing, that’s expected. For critical gaps, consider a secondary reconciliation source or alert the ops team.
- Unexpected units: Verify the unit field. If your computed USD/oz seems off by 31.1034768x, you probably forgot a grams/ounces conversion somewhere else in your pipeline.
- Inversion errors: Remember the rate is XRH per USD (per oz). If your “USD per oz” looks tiny, you likely forgot to invert.
- Authentication: If calls fail, confirm access_key is set correctly in your environment and not truncated. Avoid embedding keys in client-side code in public web apps.
- Parsing: Always guard for presence of data.rates and the symbol key. Defensive coding prevents null dereferences.
Advanced design patterns for robust XRH data engineering
- Dual-store strategy: keep raw JSON responses in object storage (by date and endpoint) alongside a normalized relational table. Useful for audits and reprocessing.
- DAG orchestration: use Airflow or similar to schedule time-series pulls, OHLC enrichment, QC checks, and warehouse loads in discrete tasks with retry logic.
- Schema versioning: if you ever change canonical units (e.g., from “XRH per USD” to “USD per oz”), version your table and write migration scripts with reproducible transforms.
- Anomaly detection: compute rolling z-scores on daily returns to flag outliers for manual review rather than silently dropping data.
Innovation themes: how XRH data powers next-gen apps
With reliable rhodium pricing, teams are embedding intelligence closer to decision points:
- Smart procurement: automated PO pricing for components with rhodium content, adjusting quotes to daily XRH closes.
- Real-time dashboarding: production managers tracking XRH exposure in BOMs with alerts when daily ranges breach thresholds.
- Risk-aware quoting: fintechs offering financing products for PGM-intensive inventories, pricing collateral with programmatic XRH marks.
- Predictive analytics: ML models incorporating OHLC ranges for short-horizon forecasting of XRH moves.
Compliance and audit considerations
- Traceability: store both computed values and original Metals-API payloads, with date and timestamp fields.
- Determinism vs. currency of data: define whether you freeze historical values or allow backfilled improvements; document this policy for auditors.
- Unit and currency declarations: report explicitly as “USD per troy ounce” or similar, and reference your conversion methodology.
Scaling up: performance and cost-awareness
- Incremental loads: after initial backfill, run small window updates (e.g., the last 5–7 business days) to capture late adjustments with minimal overhead.
- Compute locality: cache recent results in-memory for web front-ends to avoid repeated fetches on each page view.
- Batch exports: if downstream tools require CSV/Parquet, stage files once per day rather than hitting the API repeatedly per consumer.
Comparing endpoint outputs for XRH
| Field | Time-Series | Historical | OHLC |
|---|---|---|---|
| success | boolean | boolean | boolean |
| timestamp | not always present | present | present |
| date | implicit as keys in rates | string | string |
| rates | { "YYYY-MM-DD": { "XRH": number } } | { "XRH": number } | { "XRH": { open, high, low, close } } |
| unit | "per troy ounce" | "per troy ounce" | "per troy ounce" |
A note on data governance and documentation
As you formalize your XRH pipeline, document:
- Symbol mapping: “XRH” (Rhodium) and any aliases in your systems.
- Unit conventions: native storage versus derived measures (grams/kg, local currency), including the exact constants used.
- Business rules: holiday handling, forward-filling, and whether to accept late revisions.
- Operational runbook: where to check logs, how to replay failed intervals, and who to page on alerts.
Keep the official references handy: Metals-API Documentation and Metals-API Supported Symbols.
Call to action
Ready to fetch Rhodium (XRH) per-ounce historical prices and build your daily time series? Visit the Metals-API Website, get your free API key, and start integrating in minutes. For parameter details and additional endpoints, see the Metals-API Documentation.
FAQ
What symbol should I use for Rhodium?
Use “XRH.” Confirm at the Metals-API Supported Symbols page.
Are prices in USD and per troy ounce?
Yes. By default, base is USD and unit is “per troy ounce.” You can convert to other currencies or units downstream.
How do I get a continuous daily series if weekends are missing?
Pull time-series data, then apply a forward-fill (or leave gaps) according to your analytics needs. Always label synthetic points.
How do I convert from “XRH per USD” to “USD per ounce”?
Invert the rate: USD per ounce = 1 / (XRH per USD). Store your unit convention explicitly.
How should I handle late revisions?
Schedule a rolling refresh (e.g., last 3–7 business days) to capture any changes. Version historicals if you need an immutable audit trail.
Can I also get the latest XRH price?
Yes, but this article focuses on historical and time-series data. For the full set of available endpoints, review the Metals-API Documentation.
Is there an example of OHLC data for XRH?
Yes—see the OHLC section above. You get open, high, low, and close for a specific date with unit “per troy ounce.”
Where can I sign up and get an API key?
Head to the Metals-API Website to register and obtain your key.