Surat Gold 22k API: SURA-22k in INR per Gram
Symbol: Surat Gold 22k (SURA-22k) → · Gold price API
You need to quote and hedge in INR per gram for 22-karat jewelry gold specific to Surat, not the global XAU troy-ounce tick. By the end of this article you’ll call the Metals-API Metals Price India endpoint for SURA-22k, parse the JSON field you actually need (rates.SURA-22k), and add safeguards around units, base currency, timestamps, caching, and non-trading days.
What you will build: real-time Surat 22k quotes in INR per gram
The Surat 22k feed is tailored for Indian jewelry pricing workflows where product SKUs, invoicing, and POS logic are gram-based in INR. Metals-API exposes this through a dedicated endpoint for India that returns city-level jewelry karat rates, not XAU. You will:
- Request SURA-22k via GET /api/gold-price-india.
- Render INR/gram directly without conversions.
- Cache responses responsibly and handle stale timestamps on weekends/holidays.
- Detect and handle API errors (success=false) cleanly.
Endpoint and symbol you must use
Use the Metals Price India path:
GET /api/gold-price-india
- symbols: SURA-22k (Surat, 22-karat jewelry gold)
- access_key: your Metals-API key
Notes that save time:
- This endpoint works only in INR. The base parameter is rejected and should not be sent.
- Do not send city codes to /api/latest. City-level jewelry ticks like SURA-22k are exposed on /api/gold-price-india.
- There are other city symbols (e.g., VIJA-22k, SALE-22k, VISA-24k shown in documentation examples), but these are not Surat. Use SURA-22k for Surat 22k.
Find the canonical list of available symbols here: Symbols.
Quick start: one-minute integration
- Sign up for an API key: Register. Copper Monthly starts at $19.99/mo. No Free Trial.
- Copy your access_key from your dashboard.
- Call the Metals Price India endpoint with symbols=SURA-22k.
- Read rates.SURA-22k (unit: INR per gram) and display it wherever you quote or calculate pricing.
Full docs: Documentation. If you need to review market coverage and methodology, see MCP.
Make the request
Here is the exact request shown in the official sample:
Request: Surat 22k
curl "https://metals-api.com/api/gold-price-india?access_key=YOUR_API_KEY&symbols=SURA-22k"
If you prefer to copy/paste a curl you can use right now with your key, here is a complete call:
curl -G https://metals-api.com/api/gold-price-india \
--data-urlencode "access_key=YOUR_API_KEY" \
--data-urlencode "symbols=SURA-22k"
Important:
- Do not include base=INR. The Metals Price India endpoint is fixed to INR and rejects base.
- Send only the symbols you need. If you quote only Surat 22k, pass just SURA-22k.
Python example: fetch and read rates.SURA-22k
This snippet calls the same endpoint, asserts success, extracts rates.SURA-22k (INR per gram), and normalizes the timestamp.
import requests
from datetime import datetime, timezone
API_URL = "https://metals-api.com/api/gold-price-india"
API_KEY = "YOUR_API_KEY"
SYMBOL = "SURA-22k"
params = {
"access_key": API_KEY,
"symbols": SYMBOL
}
resp = requests.get(API_URL, params=params, timeout=10)
data = resp.json()
# Basic error handling
if not data.get("success", True):
# Metals-API uses "success": false and includes an "error" object.
err = data.get("error", {})
code = err.get("code")
msg = err.get("info") or err.get("message") or "Unknown error"
raise RuntimeError(f"Metals-API error ({code}): {msg}")
# Parse fields we actually use
timestamp = data.get("timestamp") # expected epoch seconds
base = data.get("base") # should be "INR" for this endpoint
rates = data.get("rates", {})
surat_inr_per_gram = rates.get(SYMBOL)
if surat_inr_per_gram is None:
raise ValueError(f"Missing {SYMBOL} in rates")
# Convert timestamp to aware UTC datetime (if present)
as_utc = None
if isinstance(timestamp, (int, float)):
as_utc = datetime.fromtimestamp(timestamp, tz=timezone.utc)
print({
"symbol": SYMBOL,
"price_inr_per_gram": surat_inr_per_gram,
"base_currency": base,
"timestamp_utc": as_utc.isoformat() if as_utc else None
})
Understand the response
Here is the official JSON example response for the live Metals-API gold-price-india feed:
Response: live Metals-API gold-price-india (2026-10-05)
{
"success": true,
"timestamp": 1791223245,
"base": "INR",
"date": "2026-10-05",
"rates": {"SURA-22k": 13680},
"unit": "per gram"
}
What you will actually use from the JSON:
- success: Boolean. If false, do not trust any rates. Check the error object for details.
- timestamp: Epoch seconds. Convert to a timezone-aware datetime (UTC) before storing or comparing.
- base: Currency code. For this endpoint expect INR. This reminds you that the numeric values are INR per gram, not USD and not per troy ounce.
- rates.SURA-22k: The number you quote: INR per gram for Surat 22k jewelry gold.
If you see other city symbols (e.g., VIJA-22k, SALE-22k, VISA-24k) in generic documentation samples, remember those are not Surat. For Surat 22k, read rates.SURA-22k only.
Parameters you can and cannot send
| Parameter | Use | Notes |
|---|---|---|
| access_key | Required | Your Metals-API key. Keep it secret. |
| symbols | Required | Use SURA-22k for Surat 22k INR/gram. You may pass multiple symbols separated by commas if needed. |
| base | Do not send | Rejected by this endpoint. Prices are fixed to INR. |
Practical implementation details (read this before you ship)
Units: INR per gram vs troy ounces
- The Surat 22k quote is INR per gram. No conversion from ounces is needed.
- Do not mix with ISO gold ticks like XAU or with per-ounce pricing. Keep SURA-22k values in grams and INR throughout calculations.
- If your UI shows “per 10g,” multiply rates.SURA-22k by 10. Keep rounding rules consistent (e.g., banker’s rounding vs commercial round-up).
Base currency: fixed INR
- The Metals Price India endpoint ignores and rejects base. You always receive INR.
- If your downstream needs a different currency, apply your own FX conversion separately in your system. Keep raw quotes stored as INR/gram for auditability.
Timestamps and timezone
- timestamp is an epoch value. Treat it as UTC and convert to a timezone-aware datetime for storage and UI.
- When comparing two quotes, compare their timestamps first. If the timestamp hasn’t advanced, your quote hasn’t updated.
Caching and request efficiency
- If your UI refreshes faster than the upstream price cadence, cache the last successful response for a short TTL (for example, the cadence you observe in timestamp updates). This reduces calls and avoids rate errors.
- Use conditional refresh in your service layer (e.g., refresh every N seconds in the backend, and serve cached values to clients in between).
- If you monitor multiple cities, pass only the symbols you need to minimize payload and parsing time.
Weekends and market closures
- On weekends and holidays, timestamps may remain unchanged for longer intervals. Your system should treat unchanged timestamps as a valid “no update” state, not an error.
- Alerting logic should detect staleness by timestamp age rather than by missing values.
Error handling: success=false and missing fields
- Always check success. If false, look for an error object with a code and message, log it, and back off or prompt for action.
- If rates or rates.SURA-22k is missing or null, keep your last known good value but mark it stale in your UI.
- Do not assume base=INR if base is absent. Only display prices if you have confirmed base and the target symbol value.
Precision and rounding
- Store numeric values as decimal in your database to avoid float errors when calculating wastage, making charges, or GST.
- If you display “per gram” and “per 10g,” define a single rounding policy (e.g., 2 decimals for INR, or match your billing rules).
Validation checklist before go-live
- Test the endpoint without base and confirm base is INR in the response.
- Verify rates contains SURA-22k only when you ask for SURA-22k.
- Add logging for success, timestamp, and rates.SURA-22k.
- Implement a minimal retry with jitter on transient HTTP errors; do not retry on success=false with a hard API validation error.
- Cache with a small TTL and prevent client “thundering herd” refreshes.
- Instrument your UI to show timestamp and a staleness indicator.
End-to-end example flow
- Backend cron or scheduler calls GET /api/gold-price-india with symbols=SURA-22k every N seconds.
- On success=true, parse base and rates.SURA-22k and store:
- symbol=SURA-22k
- price_inr_per_gram as decimal
- timestamp_utc
- Expose a lightweight endpoint to your UI with the latest value and timestamp.
- UI displays price per gram and per 10g, with last-updated time. If the timestamp is older than your freshness SLA, show a “stale” badge.
Common pitfalls (and how to avoid them)
- Sending base=INR anyway: The Metals Price India endpoint rejects base; drop it.
- Querying city symbols via /api/latest: City jewelry symbols are not available there. Use /api/gold-price-india.
- Mixing SURA-22k with XAU: These are fundamentally different units and markets. Keep them separate in code and data models.
- Hardcoding rounding that hides small price moves: Show sufficient decimal places to match your billing precision.
Going live with Surat 22k in four steps
- Register — Copper Monthly $19.99/mo. No Free Trial.
- Copy access_key.
- GET /api/gold-price-india with symbols=SURA-22k.
- Render rates.SURA-22k (unit per gram, base INR).
FAQ
Q: Can I change the base currency away from INR?
A: No. The Metals Price India endpoint is fixed to INR and rejects the base parameter. If you need another display currency, convert externally after you receive INR/gram.
Q: Is SURA-22k the same as XAU?
A: No. SURA-22k is a city-level jewelry gold quote in INR per gram. XAU is an international troy-ounce tick for fine gold and is not used on this endpoint.
Q: Where do I find the exact symbol for my city?
A: Use the official list here: Symbols. Remember, VIJA-22k / SALE-22k / VISA-24k are not Surat. For Surat 22k, use SURA-22k.
Q: What should I do if I get success=false?
A: Inspect the error object in the JSON for code and message, log it, and do not use the rates from that response. Keep your last known good value and retry according to your backoff policy.
Q: How often do prices update on weekends or holidays?
A: Update frequency can slow; timestamps may remain unchanged for longer intervals. Treat unchanged timestamps as a valid “no update” and surface a staleness indicator in your UI.
Ready to ship Surat 22k in INR per gram? Get your key and build against the Metals Price India endpoint now: Register. Check the Documentation for endpoint details and symbol coverage, and review MCP for methodology.