DocsDocs

Shanghai gold price API

Gold on the Shanghai market, in yuan per gram

26 Nov 2026 · 2 min read

Two calls return gold as Shanghai trades it: the exchange price of physical gold and the futures months, both in yuan per gram with no dollar conversion. Every plan includes them: Free is 15 minutes late, Basic, Plus, and Pro are live.

What the API returns

The Shanghai exchange price is the price of physical gold traded in Shanghai. Shanghai gold futures trade by delivery month on the Shanghai Futures Exchange. Both are in yuan per gram.

CallWhat it returns
/v1/prices?symbol=XAU-CNY-SGEThe Shanghai exchange price in yuan per gram
/v1/futures/XAU?exchange=SHFEShanghai gold futures, the most traded month

Get the Shanghai exchange price

This request returns the Shanghai exchange price, with the time it was computed and whether it is stale.

Shell
curl "https://api.goldprice.dev/v1/prices?symbol=XAU-CNY-SGE" \  -H "Authorization: Bearer $GOLDPRICE_API_KEY"
JavaScript
const res = await fetch("https://api.goldprice.dev/v1/prices?symbol=XAU-CNY-SGE", {  headers: { Authorization: `Bearer ${process.env.GOLDPRICE_API_KEY}` },})const data = await res.json()if (!res.ok) throw new Error(data.error)
Python
import os, requestsres = requests.get(    "https://api.goldprice.dev/v1/prices?symbol=XAU-CNY-SGE",    headers={"Authorization": f"Bearer {os.environ['GOLDPRICE_API_KEY']}"},    timeout=10,)res.raise_for_status()data = res.json()

Get Shanghai gold futures

Add exchange=SHFE to the gold futures call. The answer has the same fields as the New York futures, with currency CNY and unit gram.

Shell
curl "https://api.goldprice.dev/v1/futures/XAU?exchange=SHFE" \  -H "Authorization: Bearer $GOLDPRICE_API_KEY"
FieldMeaning
symbolMetal code: XAU, XAG, HG, XPT or XPD
exchangeThe exchange: COMEX, NYMEX, or SHFE for Shanghai gold
contract_monthThe delivery month of the contract, as YYYY-MM
most_tradedTrue when this is the month with the most trading
priceThe middle of the best bid and best ask
bid, askBest bid and best ask; null when the market shows none
day_high, day_lowHighest and lowest price of the trading day; null when there is none yet
currencyCurrency of the price: USD, or CNY on SHFE
unittroy_ounce for gold, silver, platinum and palladium, pound for copper, gram on SHFE
timestampWhen we received the price (UTC)
delayedTrue when our live feed is down: the price comes from a backup that runs late, or cannot be confirmed while the market trades
state, message, next_openOnly while the market is closed: closed, with message and next_open (UTC)

What people build with it

  • A gold shop screen in China that shows the local market price
  • A tracker of the gap between Shanghai and the world price
  • A savings app that values gold in yuan per gram
  • An agent that answers what gold trades at in Shanghai right now

Plans

Shanghai gold follows the spot rule on every plan. The full list is on pricing.

PlanFreeBasicPlusPro
Futures prices15 minutes lateLiveLiveLive
Requests a month5,000100,000300,0001,000,000

Next

Every futures parameter and error is in the futures reference. The Shanghai gold price page shows the latest price.

Questions

Is the Shanghai gold price converted from dollars?

No. Both prices come from the Shanghai market in yuan per gram. The dollar gold price in yuan is a different number, on the [gold price in CNY page](/gold/cny).

When does Shanghai gold trade?

On Beijing weekdays, in a day session and a night session that runs past midnight. Outside them the answer is the last price, with state set to closed and next_open.

Why is Shanghai gold higher than the dollar price in yuan?

Gold in China often trades above the world price converted to yuan, because of local demand and import rules. The gap moves day by day.

Is Shanghai gold on the free plan?

Yes. Free includes it 15 minutes late, with 5,000 requests a month. Basic, Plus, and Pro get live prices. See [pricing](/pricing).

Keep reading

Start with a free API key

Free includes 5,000 requests a month with Shanghai gold 15 minutes late. No card needed.

Get a free key