{"openapi":"3.1.0","info":{"title":"Zahab Today Gold Prices API","version":"1.1.0","description":"Free JSON API for live gold prices in Saudi Arabia, Egypt, the UAE, Kuwait, Qatar, Bahrain, Oman and Jordan. No API key required.","contact":{"name":"Zahab Today","url":"https://www.zahabtoday.com"}},"servers":[{"url":"https://www.zahabtoday.com"}],"paths":{"/api/v1/prices":{"get":{"operationId":"getPrices","summary":"Current gold prices by country and karat","description":"Returns spot price and per-country karat prices (raw, buy, sell). Rate limit: 60 requests/minute per IP.","responses":{"200":{"description":"Price payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricesResponse"}}},"headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp"}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"options":{"operationId":"pricesPreflight","summary":"CORS preflight","responses":{"204":{"description":"No content"}}}}},"components":{"schemas":{"KaratQuote":{"type":"object","properties":{"price":{"type":"number","description":"Reference raw price per gram"},"buy":{"type":"number","description":"Typical new jewelry buy price"},"sell":{"type":"number","description":"Typical shop buy-back price"}},"required":["price","buy","sell"]},"CountryBlock":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string"},"rate_per_usd":{"type":"number"},"fx_delayed":{"type":"boolean","description":"True when this country is priced from a stored exchange rate because the live rate could not be fetched. Gold itself may still be live."},"karats":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/KaratQuote"}},"ounce":{"type":"number"},"kilo":{"type":"number"},"change_pct":{"type":"number","description":"Change against the previous completed trading-session close. Only meaningful when the response's change_available is true."}},"required":["name","currency","rate_per_usd","karats","ounce","kilo","change_pct"]},"PricesResponse":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"is_live":{"type":"boolean"},"spot_usd_per_ounce":{"type":"number","description":"Raw gold price in USD per troy ounce (31.1035 g)."},"spot_usd_per_gram":{"type":"number","deprecated":true,"description":"Misnamed alias of spot_usd_per_ounce — the value is USD per troy ounce, never per gram. Kept for existing clients; use spot_usd_per_ounce."},"change_available":{"type":"boolean","description":"False when no trustworthy previous trading-session close was available; change_pct must then be ignored."},"previous_close_usd":{"type":"number","nullable":true,"description":"Close of the previous completed trading session (weekdays 17:00 New York: 21:00 UTC in US summer time, 22:00 UTC in winter) in USD per troy ounce, or null when unavailable."},"countries":{"type":"object","description":"Keyed by ISO 3166-1 alpha-2 country code.","properties":{"sa":{"$ref":"#/components/schemas/CountryBlock"},"eg":{"$ref":"#/components/schemas/CountryBlock"},"ae":{"$ref":"#/components/schemas/CountryBlock"},"kw":{"$ref":"#/components/schemas/CountryBlock"},"qa":{"$ref":"#/components/schemas/CountryBlock"},"bh":{"$ref":"#/components/schemas/CountryBlock"},"om":{"$ref":"#/components/schemas/CountryBlock"},"jo":{"$ref":"#/components/schemas/CountryBlock"}},"required":["sa","eg","ae","kw","qa","bh","om","jo"]},"meta":{"type":"object","properties":{"source":{"type":"string"},"docs":{"type":"string","format":"uri"},"note":{"type":"string"},"change_reference":{"type":"string"},"license":{"type":"string"}}}},"required":["timestamp","is_live","spot_usd_per_ounce","spot_usd_per_gram","countries","meta"]}}}}