1 month free: no ads plus full access.

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.
EndpointReturnsFrom
GET/v1/shanghaiLatest SGE gold and silver prices and premium to Western pricing, with ex-VAT fields for silverPro
GET/v1/shanghai/historySilver premium history, quoted and ex-VAT at the rate in force on each datePro
GET/v1/shanghai/gold/historyShanghai gold price and premium historyPro
GET/v1/sge/benchmarkSGE AM and PM benchmark fixings, one row per trading day in Shanghai timePro
GET/v1/sge/inventorySGE vault inventory (silver is current; gold is an archive ending in January 2016)Pro
GET/v1/sge/tradingSGE contract trading historyPro
GET/v1/shfe/settlementShanghai Futures Exchange settlement pricesPro
GET/v1/shfe/inventoryShanghai Futures Exchange warehouse inventoryPro

Response

What /v1/shanghai returns

Field names exactly as the API sends them, from the published OpenAPI specification.
FieldMeaning
priceThe SGE price in US dollars per troy ounce
priceCNYThe price in the exchange's unit: CNY per gram for gold, CNY per kilogram for silver
exchangeRateUSD/CNY used for the conversion
premiumPercentThe premium over Western spot, as quoted
priceExVat, priceCNYExVat, premiumPercentExVatThe same with China's VAT stripped at vatRate (silver; gold carries none, so they equal the raw values)
vatInclusive, vatRateWhether 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.