Get IBJA Gold 999 PM (IBXAUPM) - Per 10 Grams prices using this API — Python examples and code snippets
You need the live IBJA Gold 999 PM benchmark (symbol: IBXAUPM) priced per 10 grams to power a storefront, a bullion desk, or an internal dashboard. By the end of this guide you’ll query Metals-API’s latest endpoint for IBXAUPM, read the JSON correctly, convert it into USD per 10g and per gram, and put the value to work in Python—complete with caching and alerting tips.
What IBJA Gold 999 PM (IBXAUPM) is and who needs it
IBJA Gold 999 PM is a widely referenced India fixing for 999 purity gold, quoted per 10 grams in the afternoon (PM) session. In Metals-API it is available as the symbol IBXAUPM. Teams building e-commerce for jewelry, pricing bullion products, treasury tools for hedging, and analytics for India-focused precious metals markets often need the IBJA per-10g benchmark to align quotes and margins.
This per-10g quote complements ounce-based markets and helps bridge price discovery between global XAU instruments and India’s gram-based retail ecosystem. If your application stores or displays product prices in grams—or has to reconcile with India-specific benchmarks—IBXAUPM is the exact symbol you’re after. For the full catalog of symbols and contract specifications, check the Metals-API Supported Symbols.
Fetch the live IBXAUPM quote with the latest endpoint
We’ll use the latest endpoint with base=USD and symbols=IBXAUPM. Metals-API quotes are exchange-style: when base=USD, rates for a metal symbol are typically “units of that metal per 1 USD.” To get “USD per unit,” you invert the rate. For convenience, some responses also include the inverted cross (e.g., USDIBXAUPM) which is “USD per 1 IBXAUPM.”
Complete curl request
Replace YOUR_API_KEY with your key. If you don’t have one, grab a free key here: Register.
curl -s "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=IBXAUPM"
Python example: get USD per 10g and per gram
import os
import time
import requests
API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
URL = "https://metals-api.com/api/latest"
params = {
"access_key": API_KEY,
"base": "USD",
"symbols": "IBXAUPM"
}
r = requests.get(URL, params=params, timeout=10)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise RuntimeError(f"Metals-API error: {data}")
timestamp = data.get("timestamp") # Unix epoch seconds
date_str = data.get("date") # Server date string
base = data.get("base")
rates = data.get("rates", {})
# Metals-API may return:
# - rates["IBXAUPM"] as IBXAUPM per 1 USD (metal-per-USD)
# - rates.get("USDIBXAUPM") as USD per 1 IBXAUPM (direct USD price)
# Prefer the direct USD quote if present; otherwise invert.
usd_per_10g = None
if "USDIBXAUPM" in rates:
usd_per_10g = float(rates["USDIBXAUPM"])
elif "IBXAUPM" in rates and rates["IBXAUPM"]:
usd_per_10g = 1.0 / float(rates["IBXAUPM"])
if usd_per_10g is None:
raise ValueError("IBXAUPM price missing from response.")
usd_per_gram = usd_per_10g / 10.0
print({
"timestamp": timestamp,
"date": date_str,
"base": base,
"usd_per_10g": usd_per_10g,
"usd_per_gram": usd_per_gram
})
Understand the JSON (fields you’ll actually use)
Here is a real response structure for base=USD and symbols=IBXAUPM. We will use exactly these fields for pricing:
{"success":true,"timestamp":1791590880,"date":"2026-10-10","base":"USD","rates":{"IBXAUPM":0.00064607491802182,"USD":1,"USDIBXAUPM":1547.8081134334127}}
How to read this:
- success: Boolean indicating the request succeeded.
- timestamp and date: Server-side time of the snapshot. The timestamp is a Unix epoch (seconds). Treat it as UTC when converting to human time.
- base: USD. All rates are quoted relative to USD.
- rates:
- IBXAUPM: 0.00064607491802182 units of IBXAUPM per 1 USD (metal-per-USD).
- USDIBXAUPM: 1547.8081134334127 USD per 1 IBXAUPM (USD-per-metal). Use this directly for pricing.
- USD: 1 (the base currency identity rate).
Which value should you use? If rates.USDIBXAUPM exists, it already gives USD per 10 grams. Use it as your displayed price (or for calculations). If it doesn’t appear, invert rates.IBXAUPM to get USD per 10 grams: USD/10g = 1 / rates.IBXAUPM.
From “per 10 grams” to “per gram” and “per ounce”
IBXAUPM is a per-10-gram benchmark. Common conversions you may want:
- USD per gram = USDIBXAUPM / 10.
- USD per kilogram = USDIBXAUPM × 100.
- If you also work with troy-ounce pricing, remember: 1 troy ounce = 31.1034768 grams. USD/oz ≈ (USD/gram) × 31.1034768. Reference: What is a troy ounce?
Do not assume every symbol in Metals-API is ounce-based. Always confirm each symbol’s unit and specification on the Metals-API Supported Symbols.
Two practical uses: repricing and threshold alerts
1) Repricing a jewelry or bullion catalog in real time
Goal: Keep your INR or USD catalog aligned with IBJA per-10g. You’ll use:
- rates.USDIBXAUPM (preferably) or 1 / rates.IBXAUPM as fallback.
- timestamp/date to confirm staleness and control cache invalidation.
Flow:
- Fetch latest with base=USD, symbols=IBXAUPM.
- Compute usd_per_gram = rates.USDIBXAUPM / 10.
- Multiply by product weight in grams; then add making charges, GST/VAT, and margin.
- Round based on your storefront’s tick size and precision.
If you price in another currency, use the API’s conversion tooling or your own FX feed to convert the final USD total into your display currency before publishing. For endpoints beyond /latest—such as historical or time series for charts—see the Metals-API Documentation.
2) Alert when IBJA per 10g crosses a threshold
Goal: Notify a desk or a webhook when USD per 10g crosses a target. You’ll use:
- rates.USDIBXAUPM or 1 / rates.IBXAUPM to compute the live USD per 10g.
- timestamp to ensure the quote isn’t stale before firing the alert.
Implementation notes:
- Run a scheduled job at your plan’s refresh cadence (see below).
- Debounce alerts: only trigger if the new quote’s timestamp is greater than your last processed timestamp and the threshold condition is still true.
- Log both the raw JSON and the derived USD per-10g value for auditability.
Caching and refresh frequency
Latest endpoint updates vary by plan (e.g., updated every 60 minutes or 10 minutes). Align your polling interval to your plan and use conditional execution:
- Cache the parsed rate object keyed by date or timestamp.
- Before publishing a new price, compare the new timestamp with your last; if unchanged, skip reprocessing.
- On weekends or local market holidays, IBJA fixes may not update. Fall back to your last good quote, but surface its age to users (e.g., “Last updated: 2026-10-10 16:00 UTC”).
- Set conservative timeouts and retries; back off on HTTP 429/5xx and consult your plan’s request limits in the Documentation.
If you distribute this price downstream (e.g., microservices, mobile apps), cache it centrally and fan out via your event bus to avoid redundant API calls. For guidance on coverage and market sources, see Metals-API MCP.
Field-by-field checklist for production
- Symbol: Always request symbols=IBXAUPM for IBJA Gold 999 PM.
- Base: Use base=USD when you want USD-denominated results. If you choose a different base, adapt your inversion logic accordingly.
- Price extraction:
- Prefer rates.USDIBXAUPM (USD per 10g) if present.
- Else compute 1 / rates.IBXAUPM.
- Units:
- IBXAUPM is per 10 grams by design—divide by 10 for per gram.
- Do not assume “per troy ounce” for IBXAUPM; unit varies by symbol.
- Time handling:
- timestamp is Unix epoch seconds; handle in UTC for consistency.
- Use timestamp to detect stale data and drive caching.
- Precision:
- Keep sufficient floating precision for internal math; round only at display.
- Document your rounding policy for finance and audit teams.
- Resilience:
- Gracefully degrade to the last cached price when the API is unreachable.
- Alert operators if data age exceeds your SLA (e.g., > 2× plan cadence).
Why IBJA per-10g matters for digital gold workflows
Digitized pricing lets you automate India-specific product pages, RFQs, and ERP revaluations without manual conversions from ounce-based markets. With IBXAUPM you anchor models, hedging logic, and checkout flows directly to a benchmark already used in local workflows. It also aids analytics—pair IBXAUPM with your sales and inventory data to understand margin sensitivity per gram, or combine with your FX feed for INR quoting in real time.
Developers can integrate this data into trading tools, portfolio monitors, or fintech apps that need to reference a gram-based benchmark rather than XAU per troy ounce. For advanced endpoints beyond the scope of this article (historical charts, time series, OHLC, and more), refer to the Metals-API Documentation.
Python snippet: robust extraction with fallback and conversions
This snippet adds rounding and a minimal cache guard you can adapt to your stack:
import requests
from datetime import datetime, timezone
URL = "https://metals-api.com/api/latest"
API_KEY = "YOUR_API_KEY"
def get_ibja_usd_prices():
r = requests.get(URL, params={
"access_key": API_KEY,
"base": "USD",
"symbols": "IBXAUPM"
}, timeout=10)
r.raise_for_status()
data = r.json()
if not data.get("success"):
raise RuntimeError(data)
ts = int(data["timestamp"])
as_of = datetime.fromtimestamp(ts, tz=timezone.utc)
rates = data.get("rates", {})
if "USDIBXAUPM" in rates:
usd_per_10g = float(rates["USDIBXAUPM"])
else:
ibj_per_usd = float(rates["IBXAUPM"]) # IBXAUPM per 1 USD
usd_per_10g = 1.0 / ibj_per_usd
usd_per_gram = usd_per_10g / 10.0
return {
"as_of_utc": as_of.isoformat(),
"usd_per_10g": round(usd_per_10g, 2),
"usd_per_gram": round(usd_per_gram, 4)
}
print(get_ibja_usd_prices())
Operational tips that save time
- Symbol verification: Before deploying to prod, verify IBXAUPM’s unit and description on the Symbols list. Avoid hardcoding ounce logic for a gram-based symbol.
- Staleness guard: Reject a newly fetched quote if data["timestamp"] is older than your cached timestamp.
- Weekend/holiday behavior: Expect unchanged timestamps; surface “as of” time in your UI and logs.
- Downstream precision: If you compute making charges per gram, calculate from usd_per_gram, not from a back-converted ounce value, to minimize rounding drift.
- Auditability: Store the raw JSON payload alongside your derived price and SKU-level pricing decisions.
Where to go next
For endpoint parameters, response schemas, and options like historical snapshots, time series, OHLC, bid/ask, and more, see the Metals-API Documentation. If your coverage or sourcing needs are specific, explore MCP for market coverage details.
FAQ
-
Is IBXAUPM always quoted per 10 grams?
Yes—IBXAUPM represents IBJA Gold 999 PM per 10 grams. Confirm the unit and symbol details on the Symbols page. -
How do I get USD per 10g vs metal per USD?
If the response includes rates.USDIBXAUPM, use it directly as USD per 10g. Otherwise compute 1 / rates.IBXAUPM. -
What timezone is timestamp?
The timestamp is a Unix epoch in seconds. Treat it as UTC when converting for display or logging. -
How often should I poll?
Match your polling interval to your plan’s update frequency (e.g., every 60 or 10 minutes). Cache results and skip updates when the timestamp hasn’t changed. -
Can I chart IBJA prices over time?
Yes. Use the historical and time-series endpoints (date-bounded queries) to backfill and render charts. See the Documentation for examples.
Ready to integrate IBJA Gold 999 PM (IBXAUPM) in your pricing and analytics? Get your API key in minutes and ship your first call today: Register.