GET /v1/convert?from=XAU&to=INR&amount=10&unit=gram gives the value of 10 grams of gold in rupees. Convert metal to currency or currency to metal using ounces, grams or kilograms. A key is optional. Free and keyless prices are delayed by 15 minutes.
Make a request
Set from and to to a metal (XAU, XAG) or a currency. The unit parameter controls the metal unit, with troy ounces as the default.
curl "https://api.goldprice.dev/v1/convert?from=XAU&to=INR&amount=10&unit=gram" \ -H "Authorization: Bearer $GOLDPRICE_API_KEY"const res = await fetch("https://api.goldprice.dev/v1/convert?from=XAU&to=INR&amount=10&unit=gram", { headers: { Authorization: `Bearer ${process.env.GOLDPRICE_API_KEY}` },})const data = await res.json()if (!res.ok) throw new Error(data.error)import os, requestsres = requests.get( "https://api.goldprice.dev/v1/convert?from=XAU&to=INR&amount=10&unit=gram", headers={"Authorization": f"Bearer {os.environ['GOLDPRICE_API_KEY']}"}, timeout=10,)res.raise_for_status()data = res.json()Request parameters
| Name | Location | Required | Description |
|---|---|---|---|
from | query | Yes | Source metal or currency |
to | query | Yes | Target metal or currency |
amount | query | No (1) | Amount for conversion |
unit | query | No (oz) | Metal unit: oz, gram or kg |
Read the response
This example response was recorded without a key on 19 Oct 2026. rate retains full precision, while result is rounded.
{ "from": "XAU", "to": "INR", "amount": "10.0", "rate": "12705.74376559729168283849219", "result": "127057.44", "unit": "gram", "timestamp": "2026-10-19T12:45:06.720397Z"}| Field | Description |
|---|---|
from, to | Conversion source and target |
amount | Submitted amount |
rate | Full-precision value of one unit |
result | Rounded conversion result |
unit | Metal unit used |
timestamp | Spot price observation time (UTC) |
API errors
| Status | error | Cause |
|---|---|---|
| 400 | unsupported_unit | Unit must be oz, gram or kg |
| 429 | rate_limited | Keyless IP exceeded 100 requests in the hour |
| 429 | rate_limit_exceeded | Minute limit exceeded for the plan, or per IP without a key |
| 429 | quota_exceeded | Plan's monthly request quota exceeded |
{ "error": "unsupported_unit", "message": "Unsupported unit"}Request and data limits
Free and keyless prices are delayed by 15 minutes. Without a key, you get 10 requests a minute per IP. A free key includes 5,000 requests a month. Paid plans provide live prices. See free plan limits for all plan limits.