Shanghai Gold Price API SGE and SHFE prices and premiums as JSON
The Shanghai Gold Exchange price for gold and silver and its premium over Western spot, in US dollars per troy ounce and in the exchange's own units. Silver is quoted with China's VAT, so every silver price also comes with the VAT stripped.
- Live SGE gold and silver with the premium to Western spot, in USD and CNY
- VAT-inclusive and ex-VAT silver prices and premiums side by side
- SGE AM and PM benchmark fixings, gold since April 2016 and silver since October 2019
- SHFE settlement prices and warehouse inventory, and SGE vault stocks
- Included from Pro ($99 a month)
GET /v1/shanghai
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \
"https://api.metalcharts.org/v1/shanghai"The latest SGE gold and silver prices with their premiums. price is USD per troy ounce, priceCNY is in the exchange's unit (CNY per gram for gold, per kilogram for silver), and exchangeRate is USD/CNY.
2016
SGE gold benchmarks from
USD + CNY
Every price in both
Ex-VAT
Silver with VAT stripped
Pro
Plan that includes it
Endpoints
Shanghai Gold Price API endpoints
Every endpoint below needs Pro ($99 a month) or higher. Requests use the same key and bearer header as the rest of the API.
| Endpoint | Returns | From |
|---|---|---|
| GET/v1/shanghai | Latest SGE gold and silver prices and premium to Western pricing, with ex-VAT fields for silver | Pro |
| GET/v1/shanghai/history | Silver premium history, quoted and ex-VAT at the rate in force on each date | Pro |
| GET/v1/shanghai/gold/history | Shanghai gold price and premium history | Pro |
| GET/v1/sge/benchmark | SGE AM and PM benchmark fixings, one row per trading day in Shanghai time | Pro |
| GET/v1/sge/inventory | SGE vault inventory (silver is current; gold is an archive ending in January 2016) | Pro |
| GET/v1/sge/trading | SGE contract trading history | Pro |
| GET/v1/shfe/settlement | Shanghai Futures Exchange settlement prices | Pro |
| GET/v1/shfe/inventory | Shanghai Futures Exchange warehouse inventory | Pro |
Response
What /v1/shanghai returns
Field names exactly as the API sends them, from the published OpenAPI specification.
| Field | Meaning |
|---|---|
| price | The SGE price in US dollars per troy ounce |
| priceCNY | The price in the exchange's unit: CNY per gram for gold, CNY per kilogram for silver |
| exchangeRate | USD/CNY used for the conversion |
| premiumPercent | The premium over Western spot, as quoted |
| priceExVat, priceCNYExVat, premiumPercentExVat | The same with China's VAT stripped at vatRate (silver; gold carries none, so they equal the raw values) |
| vatInclusive, vatRate | Whether the quoted price includes VAT, and the rate |
Code
Call it from Python or JavaScript
No SDK to install: an HTTPS GET with your key in the Authorization header.
Python
import requests
resp = requests.get(
"https://api.metalcharts.org/v1/shanghai",
headers={"Authorization": "Bearer mc_live_YOUR_KEY"},
timeout=10,
)
resp.raise_for_status()
print(resp.json()["data"])JavaScript
const resp = await fetch("https://api.metalcharts.org/v1/shanghai", {
headers: { Authorization: "Bearer mc_live_YOUR_KEY" },
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const { data } = await resp.json();
console.log(data);FAQ
Shanghai Gold Price API questions
Why does the API give two Shanghai silver premiums?
SGE and SHFE silver prices include China's 13% VAT, while Western spot carries none, so the quoted premium overstates the gap. Each silver price comes as quoted and with VAT stripped (priceExVat, premiumPercentExVat), with vatInclusive and vatRate saying which is which. History strips VAT at the rate in force on each date: 13% since April 2019, 16% from May 2018 and 17% before.
What units are the prices in?
price is US dollars per troy ounce, converted at the exchangeRate in the response. priceCNY keeps the exchange's own unit: CNY per gram for gold and CNY per kilogram for silver.
How far back do the SGE benchmark fixings go?
The gold benchmark goes back to April 2016 and the silver benchmark to October 2019, one row per trading day dated in Shanghai time, with the AM and PM fixing. New fixings are fetched on weekdays at 03:00 and 07:00 UTC, shortly after each auction.
Is SGE gold vault inventory current?
No, and the endpoint says so: the exchange feed has only produced ten gold vault-stock observations, the latest from January 2016, so metal=gold returns an archive. Silver vault stock updates normally.
On metalcharts.org
See the same data as charts
More data
Other exchange data, same API
Start with Pro
Shanghai Gold Price data is included from Pro ($99 a month). Every plan, Free included, can call the live price endpoints.