Get Copper Continuous Contract (HG00) - Per Pound Historical Prices using this API with JSON time-series output
Need Copper Continuous Contract (HG00) per-pound historical prices in JSON for a backtest, dashboard, or ERP cost model? This guide shows how to pull a clean historical time-series from Metals-API, map it to HG00 behavior using the Copper spot symbol (XCU), and convert the default per–troy ounce rates into USD per pound for immediate use in analytics, pricing, or risk systems.
HG00 vs XCU: How to source Copper continuous pricing and convert to per pound
HG00 is a market ticker used for the CME Copper Continuous Contract. Metals-API organizes metals by ISO-like spot symbols, and Copper is exposed as XCU. In other words:
- HG00 is a continuous futures notation on exchange data feeds.
- XCU is the symbol in Metals-API that delivers Copper’s price as a rate.
Metals-API returns rates by default as metal units per base currency (base is USD if not specified), and the unit is per troy ounce. For historical HG00-like analysis, you can fetch a time-series of XCU and apply a standard conversion to get USD per pound, which is typically how HG futures are quoted in front-office tools. Then you can align the time-series to your HG00 analytics window, adjust for market closures, and use the result for charting, alerts, regressions, and automated pricing.
Why this approach works
For most quantitative and operational use cases—backfilling charts, building alerts, or constructing factor models—you need a consistent historical Copper series and a clear unit (USD per lb). Metals-API provides authenticated, normalized, and cached historical Copper rates as XCU. Converting to per pound is deterministic and straightforward:
- Unit default from Metals-API: per troy ounce
- 1 troy ounce = 31.1034768 grams
- 1 avoirdupois pound = 453.59237 grams ≈ 14.5833333 troy ounces
- If rate is XCU = ounces per USD, then:
- USD per troy ounce = 1 / rate
- USD per pound = (1 / rate) × 14.5833333
This yields a per-pound historical series consistent with how HG futures are viewed in many tools and spreadsheets.
Endpoints you will use for HG00-style historical pricing
To create an HG00-like per-pound historical series from Metals-API, focus on two endpoints:
- Time-Series Endpoint: Pull daily historical Copper (XCU) rates between two dates you choose.
- Latest Rates Endpoint: Sanity-check current values, perform quick health checks, or warm caches.
For full documentation, visit the Metals-API Documentation. For available metal symbols, see Metals-API Supported Symbols. To obtain an API key now, go to the Metals-API Website.
Authentication
You’ll pass your API key via the access_key query parameter on each request. Store this key securely (environment variable, secret manager) and never hardcode it in client-side apps or repositories.
Requesting a Copper (XCU) historical time-series you can convert to per pound
The time-series endpoint returns daily historical rates for your chosen date range. You’ll request XCU with base USD (default). Because the API returns “metal per USD” and unit “per troy ounce,” you’ll invert and convert in your application.
Example: curl request for a Copper (XCU) historical range
curl -G https://metals-api.com/api/timeseries \
--data-urlencode "access_key=YOUR_API_KEY" \
--data-urlencode "start_date=2026-09-01" \
--data-urlencode "end_date=2026-09-17" \
--data-urlencode "base=USD" \
--data-urlencode "symbols=XCU"
Notes:
- Replace
YOUR_API_KEYwith your real key. - Use ISO dates (YYYY-MM-DD). The API returns daily values with unit “per troy ounce.”
- Weekends and market holidays may have no ticks; depending on your plan and endpoint rules, the API may omit dates or carry the last available. Handle gaps when resampling.
What to expect in the time-series response
The time-series payload includes metadata (success, timeseries, start_date, end_date, base) and a rates object keyed by date. Each date contains a map of symbol to rate (metal per base currency). For Copper, the key will be XCU with a numeric rate.
Even when your target is HG00 per pound, your app should ingest rates[YYYY-MM-DD].XCU, compute USD per pound, and store only the converted series for downstream analytics.
Validate your pipeline with a Latest Rates check
Before running a full historical backfill, it’s useful to verify the symbol, base, and unit with a fast “latest” call. Below is a realistic example of the Latest Rates response that includes Copper (XCU):
{
"success": true,
"timestamp": 1789661304,
"base": "USD",
"date": "2026-09-17",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}
Fields you will actually use
- success: Confirm the call worked.
- timestamp: Unix seconds (UTC). Use this for caching and timing logic.
- base: Base currency of the rates. Default is USD.
- date: The date for which these rates are valid.
- rates.XCU: Copper rate in “troy ounces per USD” (metal per base). Invert to get USD per troy ounce.
- unit: The unit for metals, “per troy ounce.”
From the example above, if rates.XCU = 0.294118 troy ounces per USD, then:
- USD per troy ounce = 1 / 0.294118
- USD per pound = (1 / 0.294118) × 14.5833333
End-to-end example: Fetch XCU time-series and compute USD per pound
The following JavaScript example fetches XCU daily historical data via the time-series endpoint, converts to USD per pound, fills business-day gaps, and returns an array suitable for plotting or storing. You can adapt this to Node.js or a serverless function. Keep your API key out of client-side code.
// Example: Build an HG00-like USD per pound series from XCU time-series (Node.js/JS)
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
const METALS_API_URL = "https://metals-api.com/api/timeseries";
const ACCESS_KEY = process.env.METALS_API_KEY; // store securely
// Constants for unit conversion
const TROY_OUNCES_PER_POUND = 14.583333333333334;
// Helper: Convert metals-api metal-per-USD (troy oz per USD) into USD per pound
function usdPerPoundFromRate(ozPerUsd) {
if (ozPerUsd <= 0 || !Number.isFinite(ozPerUsd)) return null;
const usdPerTroyOunce = 1.0 / ozPerUsd;
return usdPerTroyOunce * TROY_OUNCES_PER_POUND;
}
// Fetch and convert
async function fetchCopperPerPoundSeries(startDate, endDate) {
const params = new URLSearchParams({
access_key: ACCESS_KEY,
start_date: startDate, // "YYYY-MM-DD"
end_date: endDate, // "YYYY-MM-DD"
base: "USD",
symbols: "XCU"
});
const url = `${METALS_API_URL}?${params.toString()}`;
const res = await fetch(url, { timeout: 15000 });
if (!res.ok) {
const text = await res.text();
throw new Error(`Metals-API failed: ${res.status} ${res.statusText} - ${text}`);
}
const json = await res.json();
if (!json.success || !json.rates || !json.timeseries) {
throw new Error(`Unexpected Metals-API payload: ${JSON.stringify(json).slice(0, 500)}`);
}
// Convert to USD/lb and return sorted array of { date, usdPerPound }
const out = [];
for (const [date, symbols] of Object.entries(json.rates)) {
const rate = symbols && symbols.XCU;
const usdPerPound = usdPerPoundFromRate(rate);
if (usdPerPound != null) {
out.push({ date, usdPerPound });
}
}
// Sort by date ascending
out.sort((a, b) => (a.date < b.date ? -1 : a.date > b.date ? 1 : 0));
return out;
}
// Example usage
(async () => {
try {
const series = await fetchCopperPerPoundSeries("2026-09-01", "2026-09-17");
console.log(`Points: ${series.length}`);
console.log(series.slice(0, 5));
} catch (err) {
console.error(err);
process.exit(1);
}
})();
What this code handles
- Authentication via the
access_keyquery parameter (stored in an env var). - Time-series fetch with
symbols=XCUandbase=USD. - Correct interpretation of Metals-API’s rate semantics (troy ounces per USD) and conversion to USD per pound.
- Date-sorted output for immediate plotting or database storage.
Units, base currency, timestamps, and timezones
- Units: The API returns metal rates “per troy ounce” by default. When you need per pound, apply the conversion factor 14.5833333 troy ounces per pound.
- Rate meaning: The Metals-API rate is metal per base currency unit. With
base=USD, a value likerates.XCU = rmeans r troy ounces per USD. Invert to get USD per troy ounce. - Base currency: If you switch base (e.g., to EUR), repeat the same inversion and per-pound conversion with the EUR-based rate, then optionally convert to USD if needed using your FX layer.
- Timestamps: Use the
timestampfield (Unix seconds, UTC) and thedatestring for caching and reconciliation. Time-series responses are daily; intraday granularity depends on your plan and endpoint selection. - Weekends/holidays: Expect missing calendar days. Fill forward carefully when you need business-day continuity; document whether your model should use last-known price or treat gaps as nulls.
Apply the series to HG00 use cases
Many workflows that reference HG00 (continuous Copper futures) require:
- Backfilling charts and indicators: SMA/EMA, ATR, RSI, or custom factors.
- Risk and PnL: Sensitivity to per-pound moves for pricing structured products or inventory exposure hedges.
- ERP and manufacturing: Standard-cost updates for BOMs, price escalators, and index-linked contracts.
- Alerting: Threshold or percentile alerts on daily changes in USD/lb.
Using the XCU time-series converted to USD per pound gives you a stable, clean baseline for these tasks. If you specifically need a continuous futures roll methodology (e.g., back-adjusted vs. forward-adjusted), you can still anchor your checks against XCU spot. Consistency and unit normalization remain critical for reliability.
Advanced endpoint details for historical Copper pricing
1) Time-Series Endpoint: daily historical XCU
Purpose: Retrieve daily Copper (XCU) rates over a date range. This powers historical charts, factor backtests, and model training windows.
Key parameters:
access_key(required): Your API key.start_date(required): ISO date YYYY-MM-DD.end_date(required): ISO date YYYY-MM-DD.base(optional): Default USD. We’ll use USD to compute USD/lb.symbols(optional but recommended): Set toXCUto scope to Copper.
Typical success response (shape)
{
"success": true,
"timeseries": true,
"start_date": "YYYY-MM-DD",
"end_date": "YYYY-MM-DD",
"base": "USD",
"rates": {
"YYYY-MM-DD": { "XCU": <oz_per_usd_number> },
"YYYY-MM-DD": { "XCU": <oz_per_usd_number> }
// one entry per available day
},
"unit": "per troy ounce"
}
How to use each field
- success: Validation guard.
- timeseries: Confirms you hit the time-series endpoint.
- start_date, end_date: Echo of your request; useful for logging and slicing.
- base: Make sure it’s the base you expect (e.g., USD).
- rates: The daily map. For each date, read
rates[date].XCU. Convert to USD per pound via inversion × 14.5833333. - unit: “per troy ounce.” Document this in your data dictionary.
Common pitfalls and fixes
- Missing days: Not all calendar days are present. If your charts require business days, forward-fill cautiously. Avoid forward-filling across long market closures without flagging.
- Floating point drift: Use Decimal or high-precision arithmetic for conversions, then round at display time.
- Incorrect unit assumptions: Always inspect
unitand confirm you’re inverting properly. - Base currency confusion: If you set
baseto non-USD, your series is in that currency per pound. Convert with FX if necessary.
Performance strategies
- Chunk large backfills: Split multi-year pulls into multi-month requests and parallelize with bounded concurrency.
- Cache normalized outputs: Store the computed USD/lb series to avoid repeating transformations.
- ETag/If-Modified-Since: When supported, leverage conditional requests to reduce bandwidth.
Security
- Keep
access_keyin a secure store (environment variables, vault). Never expose keys client-side. - Rotate keys on schedule. Instrument audits for who can access production keys.
2) Latest Rates Endpoint: quick validation and health checks
Purpose: Get the current Copper (XCU) rate for cache warmup, sanity checks, and system liveness.
Parameters:
access_key(required)base(optional, default USD)symbols(optional): set toXCUto limit payload
Success response example including XCU
{
"success": true,
"timestamp": 1789661304,
"base": "USD",
"date": "2026-09-17",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}
Operational guidance
- Use as a canary: Before backfills or cron jobs, call latest with
symbols=XCU. Ifsuccessis true and fields look sane, proceed. - SLA-aware polling: Respect your plan’s update cadence; avoid over-polling.
- Cache the last value: If your UI needs a “live” tile, cache the last XCU response with its timestamp and display an “as of” label.
Designing the HG00 per-pound pipeline
Here’s a robust pattern for building and maintaining your per-pound Copper historical series that reflects HG00-style usage while leveraging Metals-API’s XCU:
- Initialization: Validate credentials and connectivity using the Latest Rates endpoint with
symbols=XCU. Logtimestamp,date,unit, and the presence ofrates.XCU. - Backfill: Use the Time-Series endpoint for your desired historical window (e.g., the last N years). Transform each rate into USD/lb.
- Storage: Store results in your analytical DB or data lake with columns:
date(UTC calendar date)usd_per_lb(numeric, high precision)source(e.g., "metals-api")calc_metadata(JSON: conversion factor, base currency, unit version)
- Resampling & filling: If you need business-day continuity, generate a business-day index and forward-fill up to a max of K days. Keep a boolean flag like
is_carriedfor transparency. - Monitoring: Track moving windows (1D, 5D, 20D) for changes and set alert thresholds for governance.
- Refresh: On each business day close (or your window), request the new slice from Time-Series or Latest, convert, and append.
How this fits digital transformation in metal markets
Metals pricing has become deeply integrated with automated decision systems across trading, manufacturing, and fintech. Developers can now:
- Embed smart pricing in e-commerce and procurement portals, updating prices in near-real time.
- Drive “click-to-hedge” user flows in portfolio apps that notify when Copper USD/lb crosses strategic levels.
- Automate ERP standard-cost proposals using daily USD/lb updates and policy rules (caps, floors, time-weighted averages).
- Analyze factor exposures using Copper as a macro driver, integrating with risk engines and reporting pipelines.
Metals-API provides authenticated JSON endpoints with consistent units and timestamps—critical for clean integrations and auditability. Learn more on the Metals-API Documentation, and review supported symbols on the Metals-API Supported Symbols page.
Caching to save requests and control costs
- Local cache: Cache today’s XCU response with an expiry aligned to your plan’s update interval.
- Persistent store: After converting to USD/lb, persist the derived data so dashboards never re-hit the API for historical slices.
- ETL snapshots: Keep daily snapshots with
timestampanddatefor audit-friendly diffs.
Handling weekends, market closures, and missing days
- Expect gaps: Design your schema to allow nulls or carry-forwards.
- Visualization clarity: In charts, visually differentiate carried values (e.g., dotted line), and annotate major closures.
- Policy controls: Cap the number of carried days to prevent stale data bias. If stale beyond your threshold, raise an alert instead of silently filling.
Data validation and sanitization
- Range checks: Validate that computed USD/lb falls in an expected historical band for Copper. Outliers may indicate parsing errors or upstream anomalies.
- Monotonic checks on dates: Ensure date keys are strictly increasing; sort and deduplicate.
- Precision management: Use Decimal where feasible and format to 4–6 decimals for display while keeping full precision in storage.
Error handling and recovery strategies
- Transport errors: Retry with exponential backoff and jitter. Log the HTTP status and body.
- API-level errors: If
successis false orratesis missing, log, alert, and defer update; don’t overwrite last good value. - Partial ranges: If a time-series call partially fails or returns fewer days than expected, keep the good subset, mark the job incomplete, and schedule a targeted refill.
Performance and scaling
- Batch windows: Backfill in monthly or quarterly increments for multi-year histories, with queue-based orchestration.
- Parallelization: Parallelize across symbols only when needed; for this use case, you likely only need XCU.
- Compression: If hosting your own API layer or proxy, serve gzip/br to clients; for internal storage, use columnar formats like Parquet.
Security best practices
- Key management: Store
access_keyin a secret manager or environment variable. Rotate on a schedule and upon personnel changes. - Server-side calls: Never expose your key in client-side code or public repos. Route requests through a server you control when powering web UIs.
- Least privilege: Restrict build and runtime access to the minimal set of services that require the key.
Comparing symbols and units relevant to Copper
| Ticker or Symbol | Context | Where to use it here | Unit handling |
|---|---|---|---|
| HG00 | CME Continuous Copper Futures (market data ticker) | Analytical frame of reference; not an API symbol | Typically quoted USD per pound |
| XCU | Metals-API Copper symbol | Use in Time-Series and Latest endpoints | Returned as troy ounces per USD; invert and multiply by 14.5833333 to get USD/lb |
Data analytics and insights with Copper USD/lb
- Trend detection: Fit rolling linear regressions on log(USD/lb) to detect accelerations relevant to inventory hedging.
- Volatility modeling: Compute daily returns from USD/lb, estimate EWMA or GARCH for VaR-like risk metrics downstream.
- Factor linkages: Correlate Copper USD/lb changes versus housing starts or PMI data to inform macro signals.
- Pricing engines: Feed the USD/lb series into product pricing/quoting calculators with configurable markup curves.
Smart technology integration
- Event-driven pipelines: Trigger updates via serverless functions on a daily schedule.
- Observability: Instrument requests, latencies, and error rates; tag by symbol=XCU and stage=prod/stage.
- CI/CD safety: Validate test snapshots against the API schema; mock the endpoint in unit tests and run small live canaries.
Future trends and possibilities
- Granularity: As intraday access expands by plan, developers can price HG00-like views with higher temporal resolution while still normalizing to per pound.
- Streaming analytics: Pair regular polls with downstream stream processing to compute rolling indicators that trigger trades or hedges automatically.
- Augmented insights: Combine USD/lb Copper with energy inputs and shipping indices to construct composite cost-of-goods signals for predictive pricing.
Troubleshooting guide
- “rates.XCU is undefined”: Ensure
symbols=XCUis included and you’re iterating the date keys correctly. Confirm your plan covers the endpoint used. - “Unit mismatch in charts”: Verify you’re inverting the rate and multiplying by 14.5833333. Plot a short sample by hand to validate transformations.
- “Gaps in the series”: Expected for weekends/holidays. Apply a forward-fill policy with a max gap threshold, or plot only available days.
- “API quota exceeded”: Add caching, reduce polling frequency, and fetch narrow date ranges incrementally. Consider upgrading if workload justifies it.
- “Unexpected spikes”: Cross-check the original rate value and metadata. Use outlier detection and require manual approval for extreme adjustments.
Putting it all together
To get Copper Continuous Contract (HG00) per-pound historical prices in JSON:
- Use Metals-API’s XCU symbol with the Time-Series endpoint to pull daily historical data.
- Interpret the rate as troy ounces per USD, then compute USD per pound by inverting and multiplying by 14.5833333.
- Store the converted USD/lb series, manage gaps due to weekends/holidays, and cache results to minimize requests.
- Use the Latest Rates endpoint for health checks and quick validations before full ETL jobs.
This approach provides a clean, reliable per-pound Copper series compatible with HG00-style analytics for backtests, dashboards, pricing engines, and risk processes. Explore the Metals-API Documentation for endpoint specifics and consult the Supported Symbols to confirm XCU and other available instruments. Ready to build? Visit the Metals-API Website and get your free API key to start integrating today.
Additional references
- CME Group Copper Futures Overview — contract specs and market hours for HG.
- LME Copper — background on global Copper benchmarks.
FAQ
Does Metals-API have an HG00 symbol?
No. Use XCU (Copper) with Metals-API. HG00 is an exchange ticker convention for continuous futures. You can still construct HG00-style per-pound historical series by converting XCU rates to USD/lb.
How do I convert from troy ounces to pounds?
Metals-API returns troy ounces per USD. To get USD per pound: USD/lb = (1 / rate) × 14.5833333, where rate is rates.XCU.
What about weekends and holidays?
Expect missing calendar days. Forward-fill only within a defined maximum window or leave gaps, depending on your business rules.
Can I get data in another currency?
Yes. Change base (e.g., EUR). If you ultimately need USD/lb, convert after or incorporate FX logic.
What’s the timestamp timezone?
The timestamp is Unix seconds in UTC. The date field is the effective date for the rate.
How do I reduce API calls?
Cache recent responses, persist derived USD/lb series, fetch only new dates, and avoid redundant polling outside your plan’s update frequency.
Where can I see all symbols?
Check the Metals-API Supported Symbols page to confirm availability and symbol codes.
How do I start?
Get your key on the Metals-API Website, read the Documentation, and implement the time-series flow with symbols=XCU and the USD/lb conversion shown above.