MCX Silver Futures (MCX-XAG) - Per kg Price API: REST endpoints and response examples for developers

Metals-API 8 min read
MCX Silver Futures (MCX-XAG) - Per kg Price API: REST endpoints and response examples for developers

You need a reliable way to quote, hedge, and analyze MCX Silver Futures (symbol: MCX-XAG) priced per kilogram, updated in near real time. By the end of this walkthrough you’ll fetch the latest MCX-XAG price from a REST endpoint, convert it from troy ounces to kilograms, cache it correctly for production use, and backfill daily history for charts and risk models.

What you get from the MCX-XAG feed and how to turn it into per‑kg pricing

Metals-API returns metal prices relative to a base currency (USD by default) and expressed in troy ounces. For MCX Silver Futures (MCX-XAG), the latest endpoint will give you two key fields when you request both the direct and inverted symbols:

Illustration: MCX Silver Futures (MCX-XAG) - Per kg Price API: REST endpoints and response examples for developers
  • rates.MCX-XAG: ounces of MCX-XAG you get for 1 USD (oz per USD)
  • rates.USDMCX-XAG: USD per 1 ounce of MCX-XAG (USD/oz)

To quote per kilogram, multiply the USD per ounce value (rates.USDMCX-XAG) by 32.1507466 (troy oz per kilogram). This yields USD/kg for MCX Silver Futures. If you need INR/kg, EUR/kg, or another currency, multiply that USD/kg by your FX rate for USD to the target currency (via your FX source or Metals-API’s conversion endpoint).

Use cases: pricing, automation, and analytics with MCX Silver

Developers in trading, manufacturing, and jewelry can wire this into:

  • Real-time pricing and mark-to-market: Display MCX-XAG per kg on dashboards, ERP, and e-commerce product pages.
  • Alerts and hedging: Watch intraday changes to drive order routing or risk limits.
  • Backtesting and research: Pull time series to evaluate strategies and forecast inventory costs.

Silver (XAG) is foundational in electronics, photovoltaics, medical tech, and advanced manufacturing. Accurate, consistent MCX-linked price data supports smarter supply planning and digital manufacturing workflows where a few rupees per kg can swing margins in high-volume runs.

The two endpoints you need for MCX-XAG per‑kg

We’ll focus on:

  • Latest: for the current MCX-XAG price in USD/oz and oz/USD.
  • Time-series: to backfill daily MCX-XAG closes for charts and analytics.

Explore additional endpoints (e.g., OHLC, Bid/Ask, Convert) in the Documentation. To confirm available symbols and variants, see the Symbols list.

Grab the latest MCX-XAG and convert to per kg (USD/kg)

Request the direct and inverse symbols so you have both oz/USD and USD/oz in a single response. The base is USD by default, and Metals-API returns units per troy ounce.

cURL request

curl -s "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=MCX-XAG,USD,USDMCX-XAG"

Official JSON response (example)

{"success":true,"timestamp":1793318940,"date":"2026-10-30","base":"USD","rates":{"MCX-XAG":0.00050224937055629,"USD":1,"USDMCX-XAG":1991.0428138364866}}

Fields that matter

  • success: Boolean request status.
  • timestamp: Seconds since Unix epoch (UTC). Use it to track data recency and for cache-control logic.
  • date: Calendar date of the rate.
  • base: Pricing currency for the returned rates. Here it is USD.
  • rates.MCX-XAG: Ounces per 1 USD (oz/USD). Useful if you prefer reciprocal math.
  • rates.USDMCX-XAG: USD per 1 ounce (USD/oz). This is typically what you’ll convert to USD/kg.

Compute USD/kg in Python

import requests
import math

API_KEY = "YOUR_API_KEY"
URL = "https://metals-api.com/api/latest"
params = {
    "access_key": API_KEY,
    "symbols": "MCX-XAG,USD,USDMCX-XAG"
}

resp = requests.get(URL, params=params, timeout=15)
resp.raise_for_status()
data = resp.json()

if not data.get("success"):
    raise RuntimeError(f"Metals-API error: {data}")

usd_per_oz = data["rates"]["USDMCX-XAG"]  # USD per troy ounce
TROY_OUNCES_PER_KG = 32.1507466
usd_per_kg = usd_per_oz * TROY_OUNCES_PER_KG

print({
    "timestamp_utc": data["timestamp"],
    "date": data["date"],
    "base": data["base"],
    "usd_per_oz": usd_per_oz,
    "usd_per_kg": usd_per_kg
})

Notes:

  • Units: Metals are quoted per troy ounce. 1 kilogram = 32.1507466 troy ounces, not 35.274 (avoirdupois).
  • Base currency: With base=USD, USDMCX-XAG is already USD/oz. If you invert MCX-XAG yourself, use 1 / rates["MCX-XAG"].
  • Timestamp: Treat the timestamp as UTC. Align any downstream time-bucketing (e.g., candles) accordingly.

Backfill daily MCX-XAG series for research and charts

For historical analysis you can request a daily range using the time-series endpoint, then derive per-kg values for each day by multiplying USD/oz by 32.1507466. This makes it straightforward to render daily close charts or compute realized volatility in USD/kg.

Usage tip:

  • Call the time-series endpoint with symbols=MCX-XAG,USDMCX-XAG to receive each day’s USD/oz directly. If some plans return only the direct side, you can invert MCX-XAG for each day: USD/oz = 1 / (oz/USD).
  • When backfilling long windows, respect the API’s date limits and consider chunking monthly or quarterly ranges depending on your plan. See the Documentation for date constraints and endpoint parameters.

Precision, caching, and production readiness

Precision and units:

  • Always carry out conversions in double precision (float64). Multiplying by 32.1507466 can magnify rounding error if you truncate early.
  • Clearly label outputs with units (USD/oz vs USD/kg) in logs, events, and database columns.

Caching:

  • Latest endpoint updates depend on your plan tier. Cache results until a new timestamp arrives.
  • Refresh on a rolling schedule slightly after the documented update interval to avoid redundant requests.
  • Serve stale data with a warning banner if the feed is briefly unreachable; most pricing UIs tolerate minutes of staleness better than downtime.

Weekends and market closures:

  • Silver futures and spot-linked benchmarks can be thin or unchanged on weekends and holidays. Historical series may show flat days or carry-forward values.
  • For time-series analytics, fill missing dates explicitly and distinguish between “no trading” vs “no data.”

Timestamps and time zones:

  • Metals-API timestamps are UTC epoch seconds. Convert once at ingest and store as UTC to simplify cross-region analytics.
  • If you compute daily candles, pick a stable close cut-off (e.g., 23:59:59 UTC) to avoid discrepancies with local exchange time.

Converting USD/kg to local currencies

After computing USD/kg, you may want INR/kg or another local currency for procurement or customer quotes. Multiply USD/kg by your USD→INR rate. You can use your internal FX source or the API’s conversion functionality. Keep the following in mind:

  • Consistent timestamps: Align your FX rate timestamp with the metal rate timestamp for accurate P&L.
  • Rounding: Apply business rules (e.g., round to nearest 0.1 INR/kg) in your pricing layer, not at data ingest.
  • Caching FX: Cache FX rates separately from metals to avoid unnecessary recomputation and calls.

Integrating MCX Silver into manufacturing and trading workflows

Manufacturing and ERP:

  • Bill of Materials (BOM): Convert per-kg to per-unit metal content (grams per product) to compute live input costs.
  • Supplier contracts: Use a daily average of USD/kg across a defined window to price batches consistently.

Trading and risk:

  • Mark-to-market: Update inventory and futures exposure with USD/kg to match internal accounting units.
  • Alerts: Trigger when USD/kg crosses thresholds relevant to margin or hedging bands.

Research and forecasting:

  • Backtest demand elasticity based on USD/kg changes for silver-intensive components.
  • Correlate MCX-XAG USD/kg with solar PV production data or electronics output to inform hedging cadence.

Quick unit and field reference for MCX-XAG

Field Meaning How you’ll use it
rates.MCX-XAG Ounces per USD (oz/USD) Invert to get USD/oz if needed: 1 / rates.MCX-XAG
rates.USDMCX-XAG USD per ounce (USD/oz) Multiply by 32.1507466 to get USD/kg
timestamp Unix epoch seconds (UTC) Cache invalidation and time alignment
unit (implicit) Troy ounces Use correct oz→kg factor (32.1507466)

Practical checks that save time

  • Symbol validation: Confirm “MCX-XAG” is present on the Symbols page before deploying. Symbols can include exchange prefixes and synthetic pairs like USDMCX-XAG.
  • Null-safety: Handle missing inverted symbols by computing them from the direct quote if necessary.
  • Idempotent ingest: Key records by (symbol, date or timestamp, base) to avoid duplicates across retries.
  • Decimal storage: Use DECIMAL/NUMERIC with sufficient scale for relational DBs; float for analytical stores with metadata on unit.
  • No free trial: Plan access varies; Copper Monthly is $19.99/mo. Provision an API key and environment variables early in your CI/CD pipeline.

How this fits into smart manufacturing and supply-chain systems

Silver’s role in electronics, sensing, and photovoltaics makes real-time cost visibility essential as you route work orders, schedule suppliers, and evaluate alternative process runs. Integrating MCX-XAG USD/kg into MES/ERP enables:

  • Dynamic cost models: Recompute job quotes as metal prices move, reducing under-quoting risk.
  • Inventory controls: Set reorder points using moving-average USD/kg to smooth volatility.
  • Scenario planning: Tie bill-of-materials sensitivity to hedging decisions for predictable landed costs.

Security and operational considerations

  • API keys: Store in secret managers (e.g., vaults, environment variables restricted to runtime).
  • Observability: Log the API timestamp, symbol, base, and your computed USD/kg for auditability.
  • Fallback logic: If the latest endpoint is temporarily unavailable, serve the most recent cached value with timestamp labeling.
  • Data lineage: Propagate units in event payloads so downstream analytics never confuse USD/oz and USD/kg.

Where to go next

  • Read precise parameters and response fields in the Documentation.
  • Confirm all tradable symbols and inverted pairs on the Symbols page.
  • If you need managed connectivity and controls in enterprise settings, review MCP for orchestration patterns.

FAQ

How do I convert MCX-XAG to per kilogram?
Use the inverted field rates.USDMCX-XAG (USD/oz) and multiply by 32.1507466 to get USD/kg. If only oz/USD is available (rates.MCX-XAG), compute USD/oz as 1 / rates.MCX-XAG first, then multiply by 32.1507466.

What time zone are timestamps in?
The timestamp is Unix epoch seconds in UTC. Align your cache and daily bars to UTC to avoid daylight-saving mismatches.

Why do I sometimes see flat prices on weekends?
Many markets are closed or thin over weekends/holidays. Time series may show unchanged values or carry-forward. Distinguish “no change” from “no data” in your ingestion logic.

Can I request historical MCX-XAG directly?
Yes, use the time-series (or historical) endpoints with symbols=MCX-XAG (and optionally USDMCX-XAG). Observe plan-specific date ranges and result sizes documented in the API.

Do you offer a free trial?
No. There is no free trial. A reference point: Copper Monthly is $19.99/mo. Create an account to get your API key.

Ready to integrate MCX Silver Futures (MCX-XAG) into your tools? Get your API key and start building with the latest and historical endpoints. Register and consult the Documentation and Symbols for parameters and supported instruments. For managed connectivity patterns, see MCP.