Gold Price API (XAU): Live USD Rate from JSON
A gold price API is a REST endpoint that returns the spot rate for gold as JSON. On Metals-API the ISO 4217 metal code is XAU (one troy ounce of gold). Call GET /api/latest with base=USD and symbols=XAU: rates.XAU is ounces per 1 USD; rates.USDXAU is already USD per ounce.
Do not mix that with the homepage ticker. The widget’s LBMA Gold Pm symbol is USDLBXAUPM (16 Sep 2026 it printed 4296.1500). That is a London Bullion Market Association PM fix, not the ISO XAU field below. Docs: metals-api.com/documentation. The same access_key also drives convert, time-series, fluctuation, OHLC, intraday, lowest/highest, and gold-by-carat — plus an MCP server for agents. Copper Monthly starts at $19.99/mo (2,500 calls, 10-minute updates, 10 symbols per request).
Request: latest gold (XAU) in USD
curl "https://metals-api.com/api/latest?access_key=YOUR_KEY&base=USD&symbols=XAU,XAG,XPD"
Query params from the docs: access_key (required), base (optional, default USD), symbols (required, comma-separated). Optional unit: Pound, Ounce, Troy Ounce, Gram, KG, Ton. Update cadence is 60 minutes, 10 minutes, or 60 seconds depending on the plan. LBMA fields, when you request them, are the previous day’s close — not a live tick.
Response: XAU plus USDXAU
Envelope from the official Latest Rates docs (sample date 2018-09-10 — copy the curl with your key for today’s rate). Trailing commas from the doc page are removed so this is valid JSON:
{
"success": true,
"timestamp": 1519296206,
"base": "USD",
"date": "2018-09-10",
"rates": {
"USD": 1,
"XAG": 0.041405839732253,
"XAU": 0.0004831705,
"XPD": 0.00084781687155574,
"USDXAG": 24.151182694673185,
"USDXAU": 2069.6627794950227,
"USDXPD": 1179.5000000000057
}
}
timestamp is UNIX time of the quote. To display “gold in USD”, prefer rates.USDXAU (~2069.66 in this sample). The FAQ invert matches: 1 / 0.0004831705 ≈ 2069.66. Same rule the docs give with a rounded example: 1 / 0.00049817281835633 = 2007.33 USD per ounce.
Request: historical gold by calendar date
Most currency/metal history on this endpoint starts in 2019. LBMA gold history goes back to 1968 (silver 2010; palladium and platinum 1990) on the dedicated LBMA historical endpoint. Dated URL — this is the docs example:
curl "https://metals-api.com/api/2013-12-24?access_key=YOUR_KEY&base=EUR&symbols=XAU,XAG,XPD"
The path is /api/YYYY-MM-DD. The JSON adds "historical": true and a date field. EOD prints become available at 00:05 GMT for the previous day. Time-series end_date cannot be today — use a prior day, and use /api/latest for the last print.
Other endpoints on the same key
/api/latest is the live tick. Convert, charts, % change, and candles use the same host and access_key. Docs / symbol-page curls for gold:
curl "https://metals-api.com/api/convert?access_key=YOUR_KEY&from=USD&to=XAU&amount=100"
curl "https://metals-api.com/api/timeseries?access_key=YOUR_KEY&start_date=2023-05-01&end_date=2023-05-25&symbols=XAU"
curl "https://metals-api.com/api/fluctuation?access_key=YOUR_KEY&type=last_day&symbols=XAU"
curl "https://metals-api.com/api/open-high-low-close/YYYY-MM-DD?access_key=YOUR_KEY&base=XAU&symbols=USD"
curl "https://metals-api.com/api/intraday?access_key=YOUR_KEY&symbol=XAU&base=USD&date=2025-07-25&interval=1h"
curl "https://metals-api.com/api/lowest-highest/YYYY-MM-DD?access_key=YOUR_KEY&base=USD&symbols=XAU"
curl "https://metals-api.com/api/carat?access_key=YOUR_KEY"
GET /api/convert—from,to,amount; optionaldate. Official Convert envelope is a GBP→JPY fixture (query,info.rate,result). The symbol page uses USD→XAU andamount=100.GET /api/timeseries— daily rates between two dates. One symbol per request; range depends on the plan. Docs example:symbols=XAU,2023-05-01…2023-05-25. Shortcut:type=last_day.GET /api/fluctuation— change andchange_pct, ortype=last_day.GET /api/open-high-low-close/{YYYY-MM-DD}— one symbol. Docs example usesbase=XAU&symbols=USD(gold in USD). Open/close are UTC day bounds. If you query today, high/close can still move.GET /api/intraday— candles for one symbol on one date. Official curl:symbol=XAU,date=2025-07-25,interval=1h. Candle count is plan-capped.GET /api/lowest-highest/{YYYY-MM-DD}— one symbol per request.GET /api/carat— gold rates by carat (this endpoint is gold, not silver).
Dedicated LBMA historical (gold from 1968) and LME historical endpoints go further back than generic metal history. LBMA fields on latest are the previous day’s close, not a live tick.
MCP: same tools for agents
Metals-API ships a Model Context Protocol server for Claude Desktop, ChatGPT connectors, or any MCP client. Setup: metals-api.com/mcp. Endpoint:
https://metals-api.mcp.metals-api.com/mcp?api_key=YOUR_API_KEY
Each MCP tool call counts as one REST request against the same quota. Tools: metals.latest, metals.historical, metals.convert, metals.time_series, metals.fluctuation, metals.ohlc, metals.intraday, metals.symbols. The MCP demo asks Claude for the current gold price per ounce and calls metals.latest with symbols=XAU, base=USD. Claude Desktop config:
{
"mcpServers": {
"metals-api": {
"command": "npx",
"args": [
"mcp-remote",
"https://metals-api.mcp.metals-api.com/mcp?api_key=YOUR_API_KEY"
]
}
}
}
Go live with XAU
1. Register and pick a monthly plan (Copper Monthly is $19.99).
2. Confirm XAU vs LBMA symbols on the symbols page.
3. Call https://metals-api.com/api/latest?access_key=YOUR_KEY&base=USD&symbols=XAU
4. Render rates.USDXAU. Cache to the plan interval (10 minutes on Copper Monthly) so a dashboard refresh does not burn the 2,500 calls.
5. For charts, % change, carat, or candles, use timeseries / fluctuation / OHLC / carat / intraday. For agents, paste the MCP URL from /mcp.
Support: [email protected], Monday–Friday 7am–4pm EST.
FAQ: gold price API (XAU)
What is XAU?
XAU is the ISO 4217 code for one troy ounce of gold. Metals-API also exposes LBMA AM/PM gold as USDLBXAUAM / USDLBXAUPM and India city gold on a dedicated endpoint. Use the symbol you actually need.
How do I get the gold price in USD from the JSON?
Read rates.USDXAU when base=USD. If you only have rates.XAU, invert: usd_per_ounce = 1 / rates.XAU.
Is the docs sample today’s gold price?
No. The Latest Rates sample is dated 2018-09-10 with USDXAU ≈ 2069.66. Live LBMA PM on the homepage (16 Sep 2026) was a different symbol and a different number. Always hit /api/latest with your key.
Copper Monthly vs Gold Monthly?
Copper Monthly is $19.99/mo, 2,500 calls, 10-minute updates. Gold Monthly is $149.99/mo (higher quota and 60-second updates on the Gold tier). Both can request XAU — the difference is volume and freshness, not the metal code.
Is MCP extra?
No separate product. Same key, same quota. Point the client at https://metals-api.mcp.metals-api.com/mcp?api_key=YOUR_API_KEY. Each tool call is one API request.