Get LME Copper (LME-XCU) - Per Troy Ounce Historical Prices using this API for 2026 analysis
Developing a 2026 copper outlook starts with defensible historical data: LME Copper (LME-XCU) per troy ounce, day by day, in USD, delivered reliably for your models, dashboards, or automated pricing. This guide shows how to retrieve LME-XCU historical prices with Metals-API, interpret the JSON fields you’ll actually use, and integrate cleanly into analytics pipelines for trading signals, cost modeling, and procurement planning.
Why LME-XCU historical prices per troy ounce matter for 2026 analysis
Copper sits at the heart of digital transformation—electrification, EVs, data centers, and grid expansions all depend on it. As developers and quants, you need reproducible, well-structured time series to backtest factors, price exposure, forecast spreads, and set hedging rules. LME-XCU (LME copper) is a widely referenced benchmark; retrieving its historical series per troy ounce in USD lets you:
- Backfill analytics for 2026 projections and scenario testing.
- Build robust regressions with macro drivers (energy, FX, PMI).
- Drive smart alerts on breakouts, volatility, or seasonality.
- Harmonize units across metals portfolios (troy ounce vs metric ton).
- Automate ERP or procurement reconciliations with traceable sources.
Below, you’ll query LME-XCU historical prices using Metals-API’s LME-specific and time-series endpoints, parse the JSON, and apply practical engineering techniques—caching, weekend handling, unit safety, and downstream transformations.
What is LME-XCU (LME copper) and why use troy ounces?
Symbol conventions matter in your integrations. For LME copper, you’ll commonly see two related identifiers:
- LME-XCU: LME-referenced copper pricing from the London Metal Exchange feed.
- XCU: General copper symbol used across non-LME requests and certain endpoints.
Metals-API returns prices “per troy ounce” by default when base=USD, which is ideal for cross-metal comparisons (gold, silver, platinum all standardized this way). Even if your internal books prefer pounds or metric tons, normalizing to troy ounces upstream reduces friction when you work across metals and simplifies PnL explain when you add precious metal hedges or spreads. If your application requires grams or metric tons, convert once downstream and maintain a consistent base for auditability.
Endpoints you’ll use
To stay focused on our goal—LME copper historical data per troy ounce for 2026—we’ll use a tight set of Metals-API endpoints:
- Historical LME Endpoint: Fetch a single date’s LME-XCU price (US core building block for backfills and spot-to-close studies).
- Time-Series Endpoint: Pull a date range for LME-XCU to feed charting, factor models, and rolling windows.
- OHLC Endpoint: Retrieve open, high, low, and close figures to drive candle charts and trading strategies (e.g., range breaks).
Metals-API offers many other capabilities, including bid/ask and fluctuation. For those and broader features, see the Metals-API Documentation. For symbol discovery and verification—including LME-XCU—use the Metals-API Supported Symbols.
Authentication and setup
All requests require an API key via access_key. Keep keys secure (environment variables or secrets stores) and rotate periodically. Make your first call in minutes:
- Sign up and get your key: Metals-API Website.
- Store it as METALS_API_KEY in your CI/CD or secret manager.
- Use HTTPS for all requests; never log plaintext keys.
If you don’t have an API key yet, create one now to follow along: Get a free Metals-API key.
Endpoint 1: Historical LME (LME-XCU) for a single date
Purpose and functionality
The Historical LME endpoint returns LME-referenced prices for LME symbols (including LME-XCU) for a specific historical date. You’ll use this for:
- Point queries (e.g., month-end closes for 2026-01-31, 2026-02-29, etc.).
- Data repair—re-fetching known-missing days in bulk pipelines.
- Audit trails—verifying a previously stored price for a given date.
Parameters
- access_key: Your API key (required).
- symbol: Use LME-XCU for LME copper (required).
- date: YYYY-MM-DD for the desired historical day (required).
- base: Use USD to get the default per troy ounce rate (optional, defaults to USD).
- unit: Optional; unit “per troy ounce” is returned by default with base=USD. Include if your plan supports explicit unit control.
Example curl request
curl -s "https://metals-api.com/api/historical-lme?access_key=YOUR_ACCESS_KEY&symbol=LME-XCU&date=2026-01-15&base=USD"
Example JSON response (success)
{
"success": true,
"timestamp": 1768435200,
"base": "USD",
"date": "2026-01-15",
"rates": {
"LME-XCU": 0.03215
},
"unit": "per troy ounce"
}
Field-by-field explanation
- success: Boolean; confirm the call succeeded.
- timestamp: Unix epoch (seconds). Align it to UTC when storing or comparing cross-asset data.
- base: The currency you requested (USD). With base=USD, the rates express “how many troy ounces you get per USD.”
- date: The business date represented (watch for weekends/holidays; see “Calendar handling” below).
- rates: Object keyed by symbol; value is the rate. With base=USD and unit=per troy ounce, 0.03215 means 1 USD buys 0.03215 troy oz of LME-XCU.
- unit: The quantity unit for the rate. For USD base, Metals-API denotes “per troy ounce.”
Converting to USD per troy ounce
Metals-API returns “troy ounces per USD” for base=USD. Many teams prefer “USD per troy ounce.” Invert the rate:
- troy_oz_per_usd = 0.03215
- usd_per_troy_oz = 1 / 0.03215 ≈ 31.10
Store both if you compare with vendor sources that publish in “USD per troy ounce.”
Example JSON response (error)
{
"success": false,
"error": {
"code": "invalid_access_key",
"message": "You have not supplied a valid API Access Key."
}
}
Troubleshooting and pitfalls
- Invalid key: Verify the key value and URL-encoding. Never hardcode in code; load from env.
- Unsupported symbol: Confirm LME-XCU on the Supported Symbols page.
- Weekend/holiday: LME is closed; the API may return the last available business date. If you require strict date-only values, validate the date field before persisting.
- Unit inversion: Decide a canonical storage convention (we recommend storing both directions to avoid repeated inversion errors downstream).
Performance and scaling tips
- Batch refills: For many dates, prefer the Time-Series endpoint instead of looping single-date requests.
- Client-side caching: Cache responses keyed by (symbol, date, base), with a long TTL for historical data (immutable).
- Retry strategy: Implement exponential backoff for transient network faults; do not retry on 4xx auth errors.
Endpoint 2: Time-Series (LME-XCU) for date ranges
Purpose and functionality
The Time-Series endpoint delivers daily historical rates between start and end dates. This is ideal for building a continuous 2026 LME-XCU history, computing rolling features (returns, vol, drawdowns), and powering charts.
Parameters
- access_key: Your API key (required).
- start_date: YYYY-MM-DD (required).
- end_date: YYYY-MM-DD (required).
- base: USD to remain in per troy ounce space (optional, defaults to USD).
- symbols: LME-XCU (required to scope to LME copper).
Example curl request (2026 January range)
curl -s "https://metals-api.com/api/timeseries?access_key=YOUR_ACCESS_KEY&start_date=2026-01-01&end_date=2026-01-31&base=USD&symbols=LME-XCU"
Example JSON response (success)
{
"success": true,
"timeseries": true,
"start_date": "2026-01-01",
"end_date": "2026-01-31",
"base": "USD",
"rates": {
"2026-01-02": { "LME-XCU": 0.03195 },
"2026-01-03": { "LME-XCU": 0.03195 },
"2026-01-06": { "LME-XCU": 0.03210 },
"2026-01-07": { "LME-XCU": 0.03212 },
"2026-01-08": { "LME-XCU": 0.03205 },
"2026-01-09": { "LME-XCU": 0.03200 },
"2026-01-10": { "LME-XCU": 0.03200 },
"2026-01-13": { "LME-XCU": 0.03208 },
"2026-01-14": { "LME-XCU": 0.03214 },
"2026-01-15": { "LME-XCU": 0.03215 },
"2026-01-16": { "LME-XCU": 0.03211 },
"2026-01-17": { "LME-XCU": 0.03211 },
"2026-01-20": { "LME-XCU": 0.03220 },
"2026-01-21": { "LME-XCU": 0.03222 },
"2026-01-22": { "LME-XCU": 0.03225 },
"2026-01-23": { "LME-XCU": 0.03228 },
"2026-01-24": { "LME-XCU": 0.03228 },
"2026-01-27": { "LME-XCU": 0.03230 },
"2026-01-28": { "LME-XCU": 0.03226 },
"2026-01-29": { "LME-XCU": 0.03221 },
"2026-01-30": { "LME-XCU": 0.03218 },
"2026-01-31": { "LME-XCU": 0.03218 }
},
"unit": "per troy ounce"
}
Using the time series
- Daily close: The rates values correspond to LME-XCU per troy ounce in USD terms (troy_oz_per_usd). Invert to USD/oz if needed.
- Missing days: Weekends/holidays may repeat the last available rate (see repeated values above). Decide if you forward-fill, drop, or tag these for statistical testing.
- Rolling metrics: Compute returns on the inverted series if your models expect USD per oz continuity.
Example JSON response (empty range)
{
"success": true,
"timeseries": true,
"start_date": "2028-01-01",
"end_date": "2028-01-02",
"base": "USD",
"rates": {},
"unit": "per troy ounce"
}
Interpretation: If your plan or dataset doesn’t include that horizon or the market calendar yields no observations, rates may be empty. Validate non-emptiness before persisting.
Common pitfalls
- Calendar normalization: If you compute business-day returns, filter to unique business dates first to avoid flat-line weekend repeats skewing vol.
- Out-of-range dates: Verify historical coverage for LME symbols (Metals-API supports LME history back to 2008 via its LME endpoint).
- Symbol consistency: Use LME-XCU consistently in time-series calls for LME-referenced copper. Do not mix XCU and LME-XCU within the same array unless you intentionally study the relationship between LME vs. generic series.
Performance tips
- Chunk long ranges: Pull by year or quarter (e.g., 2026 Q1, Q2, Q3, Q4) to simplify retries and partial saves.
- Deterministic caching: Cache by (symbol, start_date, end_date, base) and checksum responses to detect unexpected drift.
- Compression: Enable HTTP compression on your client for faster transfers on long ranges.
Endpoint 3: OHLC (Open/High/Low/Close) for LME-XCU
Purpose and functionality
When you need intraday shape summarized into daily bars—candles, range breaks, and volatility markers—call the OHLC endpoint. It returns a compact object with open, high, low, and close prices for a given date, allowing you to validate moves beyond single close prints.
Parameters
- access_key: Your API key (required).
- date: YYYY-MM-DD for the daily bar (required).
- base: USD to align with per troy ounce (optional, defaults to USD).
- symbols: LME-XCU (required).
Example curl request
curl -s "https://metals-api.com/api/open-high-low-close/2026-03-18?access_key=YOUR_ACCESS_KEY&base=USD&symbols=LME-XCU"
Example JSON response
{
"success": true,
"timestamp": 1773792000,
"base": "USD",
"date": "2026-03-18",
"rates": {
"LME-XCU": {
"open": 0.03205,
"high": 0.03240,
"low": 0.03198,
"close": 0.03228
}
},
"unit": "per troy ounce"
}
How to use OHLC effectively
- Volatility: range = high - low in troy_oz_per_usd; invert if you model USD/oz.
- Signals: Intraday breakouts are better validated across OHLC than with a single close; store bars and derive range-based indicators.
- Charting: Feed this directly to client charts—no further normalization beyond inversion if displaying USD/oz.
Pitfalls and validation
- Range consistency: Assert low ≤ open/close ≤ high; reject or flag anomalies.
- Weekend bars: Expect repeats or missing bars around closures—display but avoid including in realized vol estimates.
A complete workflow: backfill 2026 LME-XCU history and enrich with OHLC
- Discover symbol: Confirm LME-XCU in the Supported Symbols directory.
- Pull time series: Use the Time-Series endpoint to fetch 2026-01-01 to 2026-12-31 for LME-XCU.
- Normalize: Invert to USD/oz if your analytics standardize on that convention.
- Fill gaps: For any dates missing bars, call Historical LME per date to patch or confirm last-known close logic.
- Enrich bars: For days in your strategy, fetch the OHLC bar and compute range metrics (ATR-like measures, breakouts, etc.).
- Cache and persist: Store immutable historical responses with content hashing; maintain a job to reconcile any corrections if your governance requires it.
curl and Python examples to get you started
curl: Time-Series for Q1 2026 (LME-XCU)
curl -s "https://metals-api.com/api/timeseries?access_key=YOUR_ACCESS_KEY&start_date=2026-01-01&end_date=2026-03-31&base=USD&symbols=LME-XCU"
Python: Fetch daily LME-XCU series and compute USD/oz
import os
import requests
API_KEY = os.getenv("METALS_API_KEY")
BASE_URL = "https://metals-api.com/api"
def get_timeseries(symbol: str, start_date: str, end_date: str, base: str = "USD"):
url = f"{BASE_URL}/timeseries"
params = {
"access_key": API_KEY,
"symbols": symbol,
"start_date": start_date,
"end_date": end_date,
"base": base
}
r = requests.get(url, params=params, timeout=20)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise RuntimeError(f"API error: {data.get('error')}")
return data
def invert_troy_oz_per_usd_to_usd_per_oz(rate):
return 1.0 / rate if rate and rate != 0 else None
# Example usage for 2026 analysis
data = get_timeseries("LME-XCU", "2026-01-01", "2026-12-31")
series = []
for day, obj in sorted(data["rates"].items()):
troy_oz_per_usd = obj.get("LME-XCU")
usd_per_oz = invert_troy_oz_per_usd_to_usd_per_oz(troy_oz_per_usd)
series.append({"date": day, "troy_oz_per_usd": troy_oz_per_usd, "usd_per_oz": usd_per_oz})
print(f"Loaded {len(series)} daily points for LME-XCU in 2026")
print("First row:", series[0] if series else None)
Interpreting the JSON fields you’ll actually use
- timestamp: Keep it as UTC integer; it’s useful for idempotency and cross-source reconciliation.
- date: Canonical daily key for your warehouse (partition key in data lakes).
- rates[symbol]: Numeric rate. With base=USD, rates are troy_oz_per_usd; invert to USD/oz for most BI displays.
- unit: Always log; future-proof unit migrations and downstream analytics checks.
- success: Validate before ingestion; quarantine failed payloads.
Units and conversions: troy ounces, grams, and metric tons
Metals-API’s per troy ounce convention is consistent across metals. Copper in physical markets is often quoted in metric tons; convert post-ingestion:
- 1 troy ounce = 31.1034768 grams.
- 1 metric ton = 1,000,000 grams ≈ 32,150.7466 troy ounces.
If you have USD/oz, USD per metric ton ≈ USD/oz × 32,150.7466. Be explicit in data model fields: price_usd_per_troy_oz, price_usd_per_metric_ton. Introduce checks so conversions never silently reapply.
Calendar handling: weekends and market closures
- Weekend repeats: When the LME is closed, daily values may repeat the last open day. Label these as is_trading_day in your fact table to avoid biased volatility or return series.
- Holidays: Expect gaps. For pure business-day returns, compute on consecutive trading days only.
- Midnight boundaries: Persist the date from the payload; do not reassign based on local time conversion.
Caching, retries, and cost control
- Immutable history: Historical data is stable; cache indefinitely by (symbol, date) or (symbol, start, end) keys.
- Edge caching: Put a CDN or reverse proxy in front of high-traffic dashboards to reduce origin calls.
- Retries: Use exponential backoff with jitter for network errors. Do not retry on deterministic 4xx errors.
- Pagination strategy: While these endpoints are date-bound, chunk long ranges to stay within reasonable payload sizes and memory limits.
Security best practices
- Key management: Store access_key in a secret manager or environment variable; never commit to source control.
- Least privilege: Scope machine users; if multiple apps use Metals-API, separate keys to isolate rotation and audit.
- Transport security: Enforce HTTPS; validate TLS certificates.
- Logging: Redact keys in logs; log request IDs, hashes of responses (for drift auditing), but not raw secrets.
Data validation and sanitization
- Schema checks: Ensure fields success, date, rates, and unit are present before ingest.
- Numerical validation: Reject NaN/Inf; assert rates are positive and within plausible copper ranges after inversion.
- Idempotency: Use (symbol, date) as a natural key; do upserts and retain source timestamp for reproducibility.
- Reconciliation: Periodically re-pull a random sample of historical dates and compare; alert on deviations.
Error handling and recovery strategies
- Plan limits: If you hit usage limits, implement a graceful degradation path—serve from cache, flag UI, and queue refresh jobs.
- Partial failures: For batch pulls, store per-day success; do not fail the entire job if a single day 404s. Retry just the missing days.
- Integrity alerts: If the date in payload differs from the requested date, log a warning and decide whether to keep the last-available approach.
Advanced analysis workflows for 2026 copper
Smart technology integration
- Event-driven pipelines: Trigger time-series pulls on market close events; publish normalized USD/oz to Kafka topics consumed by risk and pricing services.
- Feature stores: Materialize moving averages, volatility, and drawdowns from LME-XCU OHLC into a centralized feature store for reuse across models.
- Edge analytics: Cache last 60–90 days in-memory to power interactive BI without repeated API calls.
Data analytics and insights
- Macro overlay: Join LME-XCU with USD index and energy benchmarks to explain factor sensitivities for 2026.
- Regime detection: Use OHLC-derived intraday range statistics to find volatility regimes; adapt position sizing or procurement timing.
- Seasonality: Time-Series output supports month-of-year analysis; verify structural breaks before extrapolating 2026 peaks.
Technological innovation and future trends
- Adaptive hedging: Automate hedging rules keyed to OHLC-range signals, avoiding human latency in volatile windows.
- Digital procurement: Connect LME-XCU series to ERP for near-real-time copper surcharge updates with auditable sources.
- Predictive maintenance: For manufacturers, align copper price paths with maintenance windows to optimize inventory and avoid peak-cost restocking.
Practical implementation details developers often miss
- Base currency invariants: Keep base=USD for cross-metal comparability; invert at the visualization layer.
- Timezones: Treat all dates as UTC; never localize to application server time when deciding partition keys.
- Unit annotations: Persist unit fields; attach a unit_version to enable future migrations cleanly.
- Schema evolution: Wrap JSON parsing with tolerant decoders; explicitly fail when critical fields drop.
- SLOs: Define data latency SLOs per endpoint; historical can be stricter than intraday.
Comparing LME-XCU vs XCU usage patterns
| Symbol | Primary Source | When to Use | Notes |
|---|---|---|---|
| LME-XCU | London Metal Exchange | Backtesting, benchmarking, ERP pricing tied to LME | Use Historical LME and OHLC endpoints; standardize per troy ounce. |
| XCU | Generic copper symbol | Where a generic copper index is acceptable | Confirm symbol coverage on the Symbols page. |
Architectural considerations
- Warehouse modeling: Bronze (raw JSON), Silver (normalized rates with inversion), Gold (analytics-ready features per day).
- Idempotent DAGs: Use content hashes to avoid reprocessing identical payloads; support reruns without duplication.
- Observability: Track per-endpoint success rate, median latency, and drift detectors comparing cached history to fresh pulls.
Governance and audit
- Lineage: Record request URL (without access_key), response timestamp, and hash.
- Reproducibility: Pin transformation logic (inversion factors, unit multipliers) in code with version tags.
- Access controls: Restrict write access to historical layers; route corrections via reviewed jobs.
FAQ-ready examples for developers
How do I fetch a single historical LME-XCU price for a month-end in 2026?
curl -s "https://metals-api.com/api/historical-lme?access_key=YOUR_ACCESS_KEY&symbol=LME-XCU&date=2026-06-30&base=USD"
Then invert rates["LME-XCU"] to get USD/oz for reporting.
How do I pull a continuous 2026 series for modeling?
curl -s "https://metals-api.com/api/timeseries?access_key=YOUR_ACCESS_KEY&start_date=2026-01-01&end_date=2026-12-31&base=USD&symbols=LME-XCU"
How do I retrieve daily OHLC bars for a specific date?
curl -s "https://metals-api.com/api/open-high-low-close/2026-09-18?access_key=YOUR_ACCESS_KEY&base=USD&symbols=LME-XCU"
Resources and next steps
- Get your API key: Create a free Metals-API account.
- Explore endpoints and parameters: Metals-API Documentation.
- Verify symbols: Complete list of supported symbols.
- Supplemental market context: London Metal Exchange and IMF commodity resources.
Conclusion
For 2026 copper analysis, integrating LME-XCU historical data per troy ounce through Metals-API gives you a clean, reliable baseline for forecasting, risk, procurement, and product pricing. Use the Historical LME endpoint for precise date pulls, the Time-Series endpoint for continuous ranges, and the OHLC endpoint for richer daily bars. Normalize units upfront, cache immutable histories, and design pipelines around calendar realities. With these practices, your analytics layer can focus on signal—not wrangling data.
Ready to power your copper models with robust LME data? Start now: Get your Metals-API key and explore the documentation for advanced configuration.
FAQ
Does Metals-API return LME-XCU in USD per troy ounce?
With base=USD, the API returns troy ounces per USD. Invert to get USD per troy ounce, which many BI tools and reports expect.
How far back can I get LME copper history?
Metals-API provides LME historical coverage dating back to 2008 via the Historical LME endpoint. Confirm any symbol specifics on the Supported Symbols page.
What about weekends and holidays?
Expect repeated values or gaps when markets are closed. Tag trading days and compute returns on business days to avoid biased volatility.
Can I query multiple symbols at once?
Yes, supported endpoints accept multiple symbols. For this article we focused on LME-XCU; refer to the Metals-API Documentation for syntax and limitations.
How should I secure my access key?
Use environment variables or a secrets manager, never embed keys in source code or logs, and rotate regularly.