Get Delhi Gold 24k (DELH-24k) - Per Gram prices using this API for real-time quotes
Need real-time Delhi Gold 24k (DELH-24k) per-gram prices you can plug into a pricing engine, trading model, or ERP? This guide shows exactly how to request DELH-24k quotes from the Metals-API REST API, convert them to INR per gram, and productionize the workflow for use cases like live product pricing, analytics dashboards, and research backfills. We’ll keep the focus squarely on DELH-24k, explain units (troy ounce vs gram), and walk through best practices for caching, timestamps, and weekend behavior so your integration is both accurate and cost-efficient.
What is DELH-24k and why per-gram pricing matters
DELH-24k represents 24-karat gold benchmark pricing relevant to the Delhi market context. Jewelers, bullion apps, broker tools, and B2B platforms frequently quote and settle in grams, not troy ounces, and often need prices converted into INR for invoices, cart totals, or hedging logic. By leveraging Metals-API, you can request the latest DELH-24k quote and convert that to per-gram INR to deliver transparent, real-time price discovery right where your users need it.
Use case: real-time product pricing in INR per gram
Suppose you sell 24k gold coins and bars in New Delhi. Your storefront needs to:
- Fetch DELH-24k live rate
- Convert the rate to INR per gram
- Apply your spread/margin and round to retail increments
- Cache safely and refresh at the cadence allowed by your plan
Below, we’ll implement that workflow with Metals-API and call out key gotchas.
Endpoints we’ll use for DELH-24k
To keep the integration focused and performant, we’ll use two endpoints directly related to real-time and historical per-gram pricing for DELH-24k:
- Latest Rates Endpoint: to get the current DELH-24k quote
- Historical Rates Endpoint: to fetch backdated DELH-24k quotes for charting, P&L validation, or model training
You can explore additional endpoints such as the time-series, OHLC, and carat-specific pricing features in the Metals-API Documentation, and confirm the exact symbol in the Metals-API Supported Symbols directory. If you don’t yet have credentials, get started in minutes with a free key on the Metals-API Website.
Before you code: units, base currency, and conversions
Two important defaults influence how you’ll compute an INR per-gram price from the API response:
- Unit: Metals-API returns metal rates by default “per troy ounce.” Gold markets use troy ounces (31.1034768 grams), not metric ounces.
- Base currency: By default, exchange rates are relative to USD unless you change the base parameter. For consistency, we’ll demonstrate deriving INR per gram even if the base is USD.
To calculate INR per gram from a USD-per-troy-ounce rate:
- Get the DELH-24k rate (per troy ounce, base USD).
- Convert per troy ounce to per gram by dividing by 31.1034768.
- Convert USD to INR using the conversion endpoint or by setting base to INR if supported for your plan and symbol.
We’ll implement both approaches so you can pick what fits your stack and plan limitations.
Check the symbol and sign up
Confirm DELH-24k is available in your plan on the symbols endpoint: browse supported symbols. If you need to quickly test queries, grab a free API key on the Metals-API Website. Production usage details, parameters, and response schemas are documented here: Metals-API Documentation.
Quick glance: symbol and unit conventions
| Symbol | Description | Default Unit | Conversion to Gram |
|---|---|---|---|
| DELH-24k | Delhi 24-karat gold benchmark | per troy ounce | divide by 31.1034768 |
Requesting the latest DELH-24k quote
We’ll request the DELH-24k quote with base USD, then show how to turn that into INR per gram.
cURL example: latest DELH-24k (base USD)
curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=DELH-24k"
Realistic JSON response (structure)
The structure aligns with Metals-API’s latest endpoint schema. You will see a timestamp, base currency, date, rates keyed by symbol, and the unit note.
{
"success": true,
"timestamp": 1789862996,
"base": "USD",
"date": "2026-09-20",
"rates": {
"DELH-24k": 0.000482
},
"unit": "per troy ounce"
}
Interpreting key fields for production
- success: Boolean indicating the query status.
- timestamp: Unix epoch (seconds). Use this to align caches and display “as of” times in your UI.
- base: The reference currency for the quote (USD by default).
- date: UTC date corresponding to the rate snapshot; markets may be closed on weekends/holidays.
- rates.DELH-24k: The amount of DELH-24k per base unit. With base=USD and unit per troy ounce, interpret this as the number of troy ounces of DELH-24k you get for one USD. Invert to get USD per troy ounce if you prefer traditional price formatting.
- unit: “per troy ounce” signals you must convert to grams if you price per gram.
Converting to USD per gram
If rates.DELH-24k is per USD (e.g., 0.000482 troy ounces per USD), first invert to get USD per troy ounce:
- usd_per_toz = 1 / 0.000482
Then convert troy ounce to gram:
- usd_per_gram = usd_per_toz / 31.1034768
Converting USD per gram to INR per gram
To price retail in INR per gram, convert using the Convert endpoint or set base=INR if supported:
- Using Convert endpoint: convert amount=usd_per_gram from=USD to=INR
- Using base=INR: request latest with base=INR and then compute per gram as above
Currency conversion using the Convert endpoint
The Convert endpoint converts any amount between currencies and metals. We’ll convert our derived USD-per-gram figure to INR-per-gram. For reference docs, see the Metals-API Documentation.
Example: convert 1 USD to INR
curl "https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=USD&to=INR&amount=1"
{
"success": true,
"query": {
"from": "USD",
"to": "INR",
"amount": 1
},
"info": {
"timestamp": 1789862996,
"rate": 83.25
},
"result": 83.25,
"unit": "N/A"
}
To get INR per gram, multiply usd_per_gram by the USD→INR rate (result or info.rate). If you want to minimize requests, cache the USD→INR rate for a reasonable TTL aligned with your plan’s update frequency.
Putting it together in code: DELH-24k INR per gram
This example fetches the latest DELH-24k, converts to USD per gram, then calls Convert to quote INR per gram. Replace YOUR_API_KEY with your real key.
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://metals-api.com/api"
def get_latest_delh24k():
url = f"{BASE_URL}/latest"
params = {
"access_key": API_KEY,
"symbols": "DELH-24k"
}
r = requests.get(url, params=params, timeout=10)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise RuntimeError(f"API error: {data}")
return data
def convert_usd_to_inr(amount_usd):
url = f"{BASE_URL}/convert"
params = {
"access_key": API_KEY,
"from": "USD",
"to": "INR",
"amount": amount_usd
}
r = requests.get(url, params=params, timeout=10)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise RuntimeError(f"Convert error: {data}")
return data["result"]
def delh24k_inr_per_gram():
latest = get_latest_delh24k()
rate = latest["rates"]["DELH-24k"] # troy ounces per USD (base USD)
# Convert to USD per troy ounce by inversion
usd_per_toz = 1.0 / rate
# Convert to USD per gram
usd_per_gram = usd_per_toz / 31.1034768
# Convert to INR per gram
inr_per_gram = convert_usd_to_inr(usd_per_gram)
return {
"inr_per_gram": inr_per_gram,
"timestamp": latest["timestamp"],
"date": latest["date"],
"unit": "per gram",
"base": "INR",
"source_unit": latest["unit"]
}
if __name__ == "__main__":
quote = delh24k_inr_per_gram()
print(quote)
What you’ll actually use from the responses:
- latest.rates.DELH-24k to derive USD per gram
- convert.result to turn USD per gram into INR per gram
- latest.timestamp and latest.date to label the quote
- latest.unit to confirm the source unit was per troy ounce
Historical DELH-24k: backfill and analytics
For charts, P&L reconciliation, or machine learning features (e.g., nowcasting retail spreads), you’ll likely need historical DELH-24k.
cURL example: historical DELH-24k for a specific date
curl "https://metals-api.com/api/2026-09-19?access_key=YOUR_API_KEY&symbols=DELH-24k"
Historical response structure
{
"success": true,
"timestamp": 1789776596,
"base": "USD",
"date": "2026-09-19",
"rates": {
"DELH-24k": 0.000485
},
"unit": "per troy ounce"
}
To build a time series, repeat per day or use the timeseries endpoint described in the Metals-API Documentation. The same per-gram and currency conversion math applies to each daily snapshot.
Understanding timestamps, market hours, and weekends
- Timestamps are UNIX seconds and dates are in UTC. Store both and display the user’s local time in the UI.
- On weekends and market holidays, you’ll typically receive the last available quote. Your app should communicate “as of” clearly.
- If your premium plan has a shorter refresh interval, consider polling at that cadence and caching to protect quotas.
Performance and cost efficiency
- Cache latest responses for the maximum freshness permitted by your plan. Add an HTTP cache layer with a TTL tied to your update interval (e.g., 10 minutes).
- Separate currency conversion caching from metal rates. INR FX often updates at different cycles; pick a reasonable TTL (e.g., 10–60 minutes) for USD→INR.
- Batch more than one symbol when you can. Even if you only use DELH-24k today, design the call path to handle multiple symbols to support future growth without extra requests.
Data validation and numerical handling
- Always check success is true before parsing rates.
- Guard against zero or null rates; if a rate is 0 or missing, skip inversion and fall back to the previous cached value.
- Use decimal types in accounting-sensitive contexts to minimize floating point rounding drift, especially when computing margins or tax.
- Round at the presentation layer; store full precision internally.
Security and key management
- Store API keys in server-side secrets, not in client apps.
- Rotate keys periodically and monitor usage.
- Use HTTPS only and set strict timeouts and retries with backoff.
- Rate-limit your own callers to prevent accidental request storms on your key.
Error handling and resilience
- Handle HTTP errors and JSON parse errors gracefully; serve cached data with an “as of” label while retrying in the background.
- Detect stale data: if timestamp is older than your SLA threshold, flag the UI and alert your ops channel.
- For conversion failures, keep a last-known USD→INR rate for continuity.
Practical pricing workflow in production
- On schedule (e.g., every 10 minutes), call latest for DELH-24k.
- Compute USD per gram and then INR per gram.
- Apply your margin/spread and round to retail increments (e.g., 1 rupee or 0.1 rupee).
- Write results to a fast key-value store (e.g., Redis) with timestamp and a short TTL.
- Your web/mobile front-end reads this cache, not the API directly.
- For audits, persist raw responses and computed values to your data warehouse.
Advanced techniques for DELH-24k analytics
- Intraday smoothing: when combining multiple intraday updates, compute a volume-insensitive VWAP-like smoother to reduce UI flicker.
- Spread monitoring: track the difference between DELH-24k-derived INR/gram and your retail displayed price. Alert if it diverges from target margin bands.
- Backtest hedging: use daily historical DELH-24k to simulate hedge performance versus your retail pricing rules.
Quality control and monitoring
- Set thresholds for “unexpected jumps” (e.g., X standard deviations from recent history) and require manual approval before displaying if exceeded.
- Cross-check DELH-24k-derived INR/gram against a secondary reference feed if available; alert on discrepancies.
- Log unit conversions explicitly so audits can reconstruct per-gram math.
Innovation themes: Delhi gold, digital transformation, and APIs
Gold pricing has shifted from manual updates to API-first architectures. For Delhi specifically, DELH-24k provides a focal benchmark that can be embedded into:
- Fintech super apps quoting live buy/sell buyback prices
- Jewelry e-commerce platforms calculating cart totals from dynamic per-gram quotes
- ERP and OMS systems generating invoices that reconcile precisely with market movements
- Quant tools surfacing micro-moves in per-gram INR prices throughout the trading day
With Metals-API providing robust real-time and historical data, teams can accelerate product iteration, bring transparency to price discovery, and unify analytics across retail and wholesale gold flows. See the full capabilities and options in the Metals-API Documentation.
End-to-end example with explanations
Let’s walk through a complete flow that your backend job would execute, then break down the important fields and math you’ll use downstream.
Step 1: Get latest DELH-24k
curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=DELH-24k"
{
"success": true,
"timestamp": 1789862996,
"base": "USD",
"date": "2026-09-20",
"rates": {
"DELH-24k": 0.000482
},
"unit": "per troy ounce"
}
- Interpretation: For each USD, you get 0.000482 troy ounces of DELH-24k.
- USD per troy ounce = 1 / 0.000482
- USD per gram = USD per troy ounce / 31.1034768
Step 2: Convert to INR per gram
curl "https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=USD&to=INR&amount=REPLACE_WITH_USD_PER_GRAM"
{
"success": true,
"query": {
"from": "USD",
"to": "INR",
"amount": 62.15
},
"info": {
"timestamp": 1789862996,
"rate": 83.25
},
"result": 5178.49,
"unit": "N/A"
}
- result is your INR per gram quote.
- Timestamp alignment: consider using the min of the two timestamps when tagging the final quote.
Step 3: Apply business rules
- Margin: inr_per_gram_final = result × (1 + margin_pct) + flat_fee
- Rounding: round to retail granularity (e.g., 0.1 INR)
- Cache and store: write to Redis plus append to a database table for historical record
Caching strategy and quotas
- Cache latest DELH-24k for N minutes based on your plan’s update frequency. If your plan refreshes every 10 minutes, set a TTL of 10 minutes minus a small jitter (e.g., 15–30 seconds) to avoid thundering herds.
- Cache USD→INR conversion for a similar or slightly longer TTL if your FX sensitivity is lower than metal movements.
- Implement pre-warming in off-peak times to ensure the cache is hot when traffic spikes.
Troubleshooting common issues
- Empty or missing DELH-24k rate: Verify symbol support in Supported Symbols and ensure your plan includes it.
- Unexpected unit assumptions: Confirm “unit” in the response and keep the gram conversion step explicit in logs.
- Weekend data not changing: That’s expected; display “as of” clearly and consider a banner when the last update exceeds X hours.
- Rounding discrepancies: Audit your inversion and gram conversion order; store unrounded values and round only at presentation.
- Timeouts: Use short timeouts with retry/backoff; serve cached data during transient failures.
Security best practices specific to price endpoints
- Call Metals-API from server-side services; never expose your key in client apps or browser code.
- Use IP allowlisting if available in your infrastructure to restrict egress to Metals-API endpoints.
- Log only truncated keys in observability platforms.
- Set alerts on unexpected request volume spikes to detect key leakage early.
Operational dashboards and alerts
- Monitor p95/p99 response times and error rates for both latest and convert calls.
- Track quote freshness (now - timestamp) and alert if it exceeds a configured SLA.
- Log computed INR per gram and compare to prior observation to detect outliers.
Scaling considerations
- Horizontal scale your pricing service behind a load balancer; centralize the cache layer (e.g., Redis cluster).
- Use idempotent background jobs with distributed locks to prevent duplicate fetches at refresh boundaries.
- Denormalize per-gram prices for fast reads; recompute rather than storing multiple derived forms to reduce drift.
Carat and purity notes
DELH-24k indicates 24-karat purity. If you price 22k or 18k products, scale from the 24k base by purity factors in your business logic or use carat-specific endpoints as documented in the Metals-API docs. Keep purity math explicit and audited.
Checklist: shipping a robust DELH-24k per-gram feature
- Symbol verified in Supported Symbols
- Latest endpoint wired with retries and caching
- Per-gram conversion math tested with unit tests
- USD→INR conversion cached and monitored
- Rounding and margin rules centralized
- Observability: logging raw response, computed values, and timestamps
- Security: secrets management and restricted network egress
Where to go next
- Explore time-series or OHLC for richer analytics: see the Metals-API Documentation.
- Confirm all symbols you plan to support: browse the Metals-API Supported Symbols.
- Get a free API key and prototype in minutes on the Metals-API Website.
Conclusion
To serve real-time Delhi 24k gold prices per gram in INR, request DELH-24k from the latest endpoint, convert troy ounces to grams, and apply USD→INR conversion. Add caching tuned to your plan’s update cadence, log timestamps to maintain transparency, and layer in your retail margin rules. With Metals-API, you’ll have a reliable, audit-friendly pipeline that powers e-commerce, trading tools, and ERP pricing with consistent DELH-24k benchmarks. Start building today: check the symbol list, read the docs, and get your free API key.
FAQ
Does the API return per-gram prices directly?
By default, metal quotes are per troy ounce relative to the base currency. Convert to grams by dividing by 31.1034768, and convert the currency if needed (e.g., USD to INR).
How often are DELH-24k prices updated?
Update frequency depends on your subscription plan. Always rely on the returned timestamp and cache accordingly.
What happens on weekends and holidays?
You’ll typically receive the last available quote. Display “as of” times and consider UI banners when quotes are older than your normal cadence.
Can I get historical DELH-24k for backtesting?
Yes. Use the historical endpoint for specific dates, or the time-series endpoint for ranges. Compute per-gram and INR conversions per day.
Is there a single request to get INR per gram directly?
You can set base=INR where supported and still convert to grams locally. Otherwise, use the Convert endpoint to turn USD-per-gram into INR-per-gram. Choose the approach that best fits your plan and latency budget.
Where do I verify DELH-24k is supported?
See the Metals-API Supported Symbols page for the latest list and plan availability.