Convert between metals, currencies, and units
Changed onConvert an amount between metals, currencies, and units.
- metal → currency: spot price in that currency via FX cross through USD
- currency → metal: inverse of the above
- metal → metal: ratio of USD spot prices
- currency → currency: FX cross through USD (live rate first, then the last stored rate only up to three days old)
Two-leg source skew: currency → currency conversions resolve EACH leg independently through the fresh-first/last-stored chain, so the two legs can have different ages (e.g. a fresh EUR rate crossed with an older stored THB rate). The response timestamp reflects the to leg only — the from leg's timestamp is discarded — so it can understate (or overstate) the age of the other half of the cross. Both legs share the USD anchor, so cross drift is bounded by the staleness of the older leg — never compounded.
The unit param applies to the metal side only (oz / gram / kg). Historical conversion via date is not supported; use /v1/bars + /v1/prices/history for historical spot data.
Request
- Base URLhttps://api.goldprice.dev
- URLhttps://api.goldprice.dev/v1/convert
- Auth
- none
- or HTTP bearer
- or API key in header X-API-Key
Query parameters
Source symbol: XAU, XAG, USD, EUR, …
Target symbol: USD, EUR, XAU, …
Amount to convert (default 1).
Unit for the metal side: oz | gram | kg (default oz).
Response
Successful Response
Changes
- breaking
the response property
became optional for the status - breaking
the response property
became optional for the status - breaking
the response property
became optional for the status - breaking
the response property
became optional for the status - breaking
response property
messagelist-of-types was widened by adding typesnullto media typeapplication/jsonof response400 - breaking
response property
messagelist-of-types was widened by adding typesnullto media typeapplication/jsonof response401 - breaking
response property
messagelist-of-types was widened by adding typesnullto media typeapplication/jsonof response429 - breaking
response property
messagelist-of-types was widened by adding typesnullto media typeapplication/jsonof response503 - warning
removed the optional property
from the response with the status - info
the endpoint scheme security
ApiKeyAuthwas added to the API - info
the endpoint scheme security
BearerAuthwas added to the API - info
added the non-success response with the status
- info
removed the non-success response with the status
- info
removed the non-success response with the status
- info
added the required property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- breaking