Copper Price API
A REST API for live and historical copper prices, quoted in US dollars per pound on COMEX. Spot updates continuously, and the history endpoint returns 9,776 daily bars going back to July 1988. JSON over HTTPS, authenticated with a bearer token, no SDK required.
Get the live copper price
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \ "https://api.metalcharts.org/v1/prices"
Every tracked metal comes back in one response, so a dashboard showing several does not need several requests. The copper entry looks like this:
{
"success": true,
"data": {
"HG": {
"symbol": "HG",
"price": 4380.04,
"change24h": 2.87,
"changePercent24h": 0.0655,
"high24h": 4380.25,
"low24h": 4377.84,
"exchange": "SPOT",
"timestamp": "2026-09-19T18:58:27.856Z"
}
}
}Spot prices are on the free tier. You need an account and a key, but not a card.
Code examples
Each example fetches the live copper price and prints it. There is no SDK to install: the API is plain HTTPS returning JSON, so whatever HTTP client you already use will do.
Copper price in Python
import requests
res = requests.get(
"https://api.metalcharts.org/v1/prices",
headers={"Authorization": "Bearer mc_live_YOUR_KEY"},
timeout=10,
)
res.raise_for_status()
price = res.json()["data"]["HG"]["price"]
print(f"Copper: ${price}")Uses requests. raise_for_status turns a 401 or 429 into an exception rather than letting a bad payload through.
Copper price in JavaScript
const res = await fetch(
"https://api.metalcharts.org/v1/prices",
{ headers: { Authorization: "Bearer mc_live_YOUR_KEY" } },
);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { data } = await res.json();
console.log(`Copper: ${data.HG.price}`);Native fetch, so it runs in Node 18 and above and in the browser. Never ship a key to the browser; proxy through your own server.
Copper price in PHP
<?php
$ch = curl_init("https://api.metalcharts.org/v1/prices");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer mc_live_YOUR_KEY"],
CURLOPT_TIMEOUT => 10,
]);
$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code !== 200) {
throw new RuntimeException("MetalCharts API returned $code");
}
$data = json_decode($body, true);
echo "Copper: " . $data["data"]["HG"]["price"];Plain cURL with no dependencies. Checking the status code matters because a failed call still returns a parseable body.
Copper price in Go
req, _ := http.NewRequest(
http.MethodGet, "https://api.metalcharts.org/v1/prices", nil,
)
req.Header.Set("Authorization", "Bearer mc_live_YOUR_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
var out struct {
Data map[string]struct {
Price float64 `json:"price"`
} `json:"data"`
}
if err := json.NewDecoder(resp.Body).Decode(&out); err != nil {
return err
}
fmt.Println("Copper:", out.Data["HG"].Price)Decoding into a narrow struct rather than a map keeps the compiler honest about the field you actually use.
Replace mc_live_YOUR_KEY with a key from the API console. The free tier needs an account but not a card.
Historical copper prices
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \ "https://api.metalcharts.org/v1/history/HG?range=1Y&interval=1d"
9,776 daily bars are available, the oldest dated 1988-07-28. Set the window with range or explicit start and end dates, and the candle size with interval: 15m, 30m, 45m, 1h, 2h, 4h, 8h, 1d, 1w or 1M. Each point carries open, high, low, close and volume, so it drives a candlestick chart directly.
History depth is what separates the plans. Basic reaches back 1 year, Pro five, and Ultimate returns the full series.
The symbol is HG. Passing the metal's name instead returns a 400, which is the single most common mistake on first use.
Endpoints carrying copper
| Endpoint | Returns | Plan |
|---|---|---|
| /v1/prices | Live spot price, bid, ask, 24h change, high and low | Free |
| /v1/history/{symbol} | Daily, weekly and monthly candles, plus 15m to 8h intraday | Basic |
| /v1/ath/{symbol} | All-time high and the date it was set | Basic |
| /v1/instruments | Which symbol each endpoint expects | Free |
Copper is the industrial bellwether, so it tends to be consumed alongside macro data rather than alongside gold. The history runs deeper than most base-metal feeds, and Shanghai inventory is available for anyone tracking Chinese demand.
Beyond price, copper also appears in:
| Endpoint | Returns | Plan |
|---|---|---|
| /v1/comex/inventory?symbol=HG | COMEX copper warehouse stocks | Pro |
| /v1/shfe/inventory?symbol=cu | Shanghai Futures Exchange copper stocks | Pro |
| /v1/shfe/settlement?symbol=cu | SHFE copper settlement prices | Pro |
| /v1/futures?symbol=HG | COMEX futures settlement | Basic |
Plans
Rate limiting is by weight per minute, not a monthly request quota. Most endpoints cost 1 weight and history costs 2. Free is capped at 1,000 weight a month; no paid plan has a monthly ceiling.
Compare plansCopper API questions
How far back does copper history go?
9,776 daily bars from July 1988, which is COMEX. Shanghai copper is carried separately and starts in 2002.
What unit is the copper price in?
COMEX copper is quoted in US dollars per pound, unlike the precious metals which are per troy ounce. Shanghai and LME copper are per tonne. Check the unit field rather than assuming.
What symbol do I use for copper?
HG, the COMEX ticker. Internally it is stored as XCU, but the API accepts HG and /v1/instruments?search=copper will confirm it.
Other metals
- Gold Price API — 14,425 daily bars
- Silver Price API — 14,488 daily bars
- Platinum Price API — 5,798 daily bars
- Palladium Price API — 5,799 daily bars
- All metals, one API