Documentations
Overview
Our Precious Metals API provides real-time pricing for Gold (XAU), Silver (XAG), Platinum (XPT) and Palladium (XPD) in multiple currencies.
Looking for the original endpoints used by customers of the pre-2025 freegoldprice.org and DGCSC.org?
Check the Legacy API Quick-Start to keep your older integrations running with their existing keys/passwords.
- API V1 – legacy JSON/XML endpoints (one metal per call)
- API V2 – modern endpoints (multi‑metal & multiple formats)
- Every successful request costs 1 credit.
Read Before You Integrate
Data origin
All price quotes are scraped or aggregated from publicly available sources. We do not audit, validate, or cross-check every tick for accuracy or timeliness.
No suitability for real-time trading
If you need just-in-time or exchange-certified prices for algorithmic strategies, portfolio valuation, treasury operations, or any other mission-critical use, this API is the wrong tool.
Risk acceptance
By calling the endpoints you acknowledge and accept that:
- The data may be delayed, incomplete, or inaccurate.
- We sell only the server hits that deliver the feed, not the underlying data itself.
- You bear full responsibility for any decisions made—or losses incurred—using this information.
No liability
freegoldprice.org disclaims all warranties, express or implied, regarding data quality or fitness for a particular purpose. We will not be liable for financial loss, lost profits, or any other damages arising from reliance on these prices.
Seek professional advice
This service is not investment advice. Always consult a licensed financial advisor before making investment decisions.
Authentication
All requests need an API‑key query parameter:
?key=YOUR_API_KEY
Important
- Keys are bound to user accounts + credit balance
- 1 credit is deducted per successful request
- Requests fail when balance reaches 0
- No headers – authentication is query‑string only
API V2 (Recommended)
Base URL
GET /api/v2?key=[API_KEY]&action=[ACTION]
Parameters
ParameterTypeReqDescription key | string | ✔ | Your API key action | string | ✔ | Desired action (see below)
Available Actions
Action | Metals | Fmt | Unit | Description ------- | ---------------------- | --- | ----- | ------------------------------- GSX | Gold + Silver | XML | ounce | Gold & Silver per troy ounce GSJ | Gold + Silver | JSON| ounce | Gold & Silver per troy ounce GSXM | Gold + Silver | XML | gram | Gold & Silver per gram GSJM | Gold + Silver | JSON| gram | Gold & Silver per gram PPX | Platinum + Palladium | XML | ounce | Platinum & Palladium per ounce PPJ | Platinum + Palladium | JSON| ounce | Platinum & Palladium per ounce PPXM | Platinum + Palladium | XML | gram | Platinum & Palladium per gram PPJM | Platinum + Palladium | JSON| gram | Platinum & Palladium per gram GSPPX | All four metals | XML | ounce | All metals per troy ounce GSPPJ | All four metals | JSON| ounce | All metals per troy ounce GSPPXM | All four metals | XML | gram | All metals per gram GSPPJM | All four metals | JSON| gram | All metals per gram
Response Examples
<?xml version="1.0" encoding="UTF-8"?> <GSX> <date>2025-01-02 14:30:00</date> <unit>ounce</unit> <Gold> <USD currencyname="United States Dollar"> <ask>2350.40</ask> <bid>2349.90</bid> </USD> <EUR currencyname="Euro"> <ask>2156.70</ask> <bid>2156.10</bid> </EUR> <!-- … --> </Gold> <Silver> <USD currencyname="United States Dollar"> <ask>29.45</ask> <bid>29.40</bid> </USD> <!-- … --> </Silver> </GSX>
JSON (GSJ – Gold & Silver per ounce)
{ "GSJ": { "date": "2025-01-02 14:30:00", "unit": "ounce", "Gold": { "USD": {"ask":"2350.40","bid":"2349.90"}, "EUR": {"ask":"2156.70","bid":"2156.10"} }, "Silver": { "USD": {"ask":"29.45","bid":"29.40"}, "EUR": {"ask":"27.04","bid":"27.00"} } } }
API V1 (Legacy)
Base URL
GET /api/v1?key=[API_KEY]&action=[ACTION]
Available Actions
Pattern | Fmt | Description [Metal]JB | JSON | metal prices – bid only [Metal]JBA | JSON | bid & ask [Metal]JBO | JSON | per ounce – bid only [Metal]JBAO | JSON | per ounce – bid & ask [Metal]BE | XML | metal prices – bid only [Metal]BAE | XML | bid & ask [Metal]BOE | XML | per ounce – bid only [Metal]BAOE | XML | per ounce – bid & ask JLondonFixes | JSON | London fix prices (all metals) LondonFixes | XML | London fix prices (all metals)
Example JSON (GoldJBA – per gram)
{ "GoldPrice": { "per": "gram", "date": "2025-01-02 14:30:00", "USD": {"bid":"75.52","ask":"75.54"}, "EUR": {"bid":"69.23","ask":"69.25"} } }
Supported Currencies (excerpt)
AED – United Arab Emirates Dirham
AFN – Afghan Afghani
ALL – Albanian Lek
…
ZMW – Zambian Kwacha
ZWL – Zimbabwean Dollar
Total supported: 132
Price Precision
Ounce prices – 2 decimals • Gram prices – 4 decimals
Technical Specs
- Content‑Type: XML → application/xml; charset=utf‑8 | JSON → application/json; charset=utf‑8
- UTF‑8 encoding
- No client‑side cache headers
- Security headers: X‑Content‑Type‑Options, X‑Frame‑Options
- Credit‑based rate limiting (1 credit per success)
- Data updated every minute (60 seconds)
Error Codes
Message | Description | HTTP Invalid key | API key not found / invalid | 400 Invalid action | Action parameter not recognised | 400 Insufficient hits | Zero credits remaining | 400 No data available | No current price data | 400 Missing parameters | Key or action param missing | 400
Code Snippets
PHP (API V2)
$url = "https://yourapi.com/api/v2?key={$key}&action=GSJ";
Python (requests)
requests.get("https://yourapi.com/api/v2", params=dict(key=KEY, action="GSPPJ"))
Node (fetch)
fetch(`https://yourapi.com/api/v2?key=${KEY}&action=GSPPJ`)
Migration V1 → V2
Gold+Silver
# V1 – two calls action=GoldJBA action=SilverJBA # V2 – one call action=GSJ