IBJA Gold 585 PM (IB585PM) - Per 10 Grams Latest Price API — Integration Guide for Node.js

Metals-API 9 min read
IBJA Gold 585 PM (IB585PM) - Per 10 Grams Latest Price API — Integration Guide for Node.js

You need to price a 14K (585) gold product in real time using the IBJA afternoon benchmark “Gold 585 PM,” quoted per 10 grams, and wire it into a Node.js service. By the end of this guide, you’ll fetch the latest IBJA Gold 585 PM price (symbol: IB585PM), understand the inverted USD price (USDIB585PM), convert to per-gram values, and ship a small Node endpoint or job that updates safely and efficiently.

What “IB585PM” Represents and Why It’s Useful

IB585PM stands for the India Bullion and Jewellers Association (IBJA) Gold 585 PM benchmark—585 purity (58.5%), afternoon fix, quoted per 10 grams. This is a practical unit for pricing jewelry and manufacturing SKUs in India and anywhere your cost model uses grams rather than troy ounces.

Illustration: IBJA Gold 585 PM (IB585PM) - Per 10 Grams Latest Price API — Integration Guide for Node.js

Metals-API exposes IB585PM alongside an automatically inverted symbol USDIB585PM so you can read both “10 grams per USD” and “USD per 10 grams” in a single response. That makes it straightforward to compute per-gram prices and integrate with your quoting, checkout, ERP, or trader tools.

Endpoints We’ll Use

We’ll focus on two endpoints that are directly relevant to “latest IB585PM per 10 grams” for Node.js:

  • Latest rates: Get the live IB585PM quote and its USD inversion (USDIB585PM) for immediate pricing and alerts.
  • Time-series or historical: Backfill charts and run PnL/hedging logic using historical benchmarks (we’ll outline how to request, and point you to the documentation).

For full parameter options (date ranges, additional symbols, and more), refer to the Metals-API Documentation. To confirm symbol coverage, see Metals-API Supported Symbols.

Before You Start

  • Get an API key: Register. Metals-API does not offer a free trial. See plan options on the MCP page.
  • Confirm symbols: IB585PM is “per 10 grams” for 585 purity; USDIB585PM is the inverted USD price per 10 grams.
  • Environment: Node.js 18+ recommended (built-in fetch). If you’re on Node 16, bring a fetch polyfill or use Axios.

Get the Latest IBJA Gold 585 PM Price (Per 10 Grams)

curl request

This request asks for IB585PM and its inverted USD price in one hit. Keep base=USD; the API will return the “per USD” metal rate and the “USD per unit” inversion.

curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=IB585PM,USDIB585PM,USD"

Official JSON response example

Below is a real response sample for IB585PM. Use these exact values to test your parser and field selection logic.

{"success":true,"timestamp":1793232540,"date":"2026-10-29","base":"USD","rates":{"IB585PM":0.0011404586507594,"USD":1,"USDIB585PM":876.8402075201302}}

What these fields mean (and which ones you’ll use)

  • success: Boolean status for the API call.
  • timestamp: Unix epoch seconds. Treat it as UTC.
  • date: ISO date associated with the snapshot.
  • base: “USD” means all rates are quoted against 1 USD.
  • rates.IB585PM: Metal units per 1 USD. Because IB585PM is “per 10 grams,” this is “10-gram units per USD.”
  • rates.USDIB585PM: USD per 1 “per 10 grams” unit of IBJA 585 PM gold. This is the value most pricing systems will use directly for “USD per 10g.”
  • rates.USD: Sanity check that base=USD.

Node.js: Fetch and Compute USD per Gram

This Node.js example fetches the latest IB585PM price, reads USD per 10 grams (USDIB585PM), and derives USD per gram for use in pricing formulas.

/**
 * Node.js 18+ (built-in fetch)
 * 1) Set METALS_API_KEY in your environment
 * 2) node ibja-585pm.js
 */

const API_KEY = process.env.METALS_API_KEY;
if (!API_KEY) {
  console.error("Missing METALS_API_KEY environment variable.");
  process.exit(1);
}

const ENDPOINT = "https://metals-api.com/api/latest";
const SYMBOLS = ["IB585PM", "USDIB585PM", "USD"];

async function main() {
  const url = new URL(ENDPOINT);
  url.searchParams.set("access_key", API_KEY);
  url.searchParams.set("base", "USD");
  url.searchParams.set("symbols", SYMBOLS.join(","));

  const res = await fetch(url.toString(), { timeout: 10000 });
  if (!res.ok) {
    throw new Error(`HTTP ${res.status} ${res.statusText}`);
  }
  const data = await res.json();

  if (!data.success) {
    throw new Error(`API error: ${JSON.stringify(data)}`);
  }

  const ts = data.timestamp;              // Unix seconds (UTC)
  const asOf = data.date;                 // ISO date string
  const usdPer10g = data.rates.USDIB585PM; // USD per 10 grams (IBJA 585 PM)
  const tenGramUnitsPerUsd = data.rates.IB585PM; // "10g units per USD"

  // Derived values
  const usdPerGram = usdPer10g / 10;      // simple division since the base unit is 10 grams
  const gramsPerUsd = 1 / usdPerGram;     // invert for convenience

  // Optional: derive per troy ounce if needed (31.1034768 grams per troy ounce)
  const TROY_OUNCE_IN_GRAMS = 31.1034768;
  const usdPerTroyOunce = usdPerGram * TROY_OUNCE_IN_GRAMS;

  console.log(JSON.stringify({
    symbol: "IB585PM",
    asOf,
    timestamp: ts,
    usdPer10g: usdPer10g,
    usdPerGram: usdPerGram,
    gramsPerUsd: gramsPerUsd,
    // Include raw fields for auditing
    base: data.base,
    rawRates: data.rates,
    // Optional computed field:
    usdPerTroyOunce: +usdPerTroyOunce.toFixed(2)
  }, null, 2));
}

main().catch(err => {
  console.error(err);
  process.exit(1);
});

What to plug into your app:

  • Use rates.USDIB585PM directly for “USD per 10 grams.”
  • Divide by 10 for “USD per gram.”
  • Multiply by 31.1034768 for “USD per troy ounce” if you need to interop with ounce-based logic. Be explicit about unit conversions in your code comments.

Symbols and Unit Semantics

To keep your code and dashboards unambiguous, treat each symbol’s base unit literally. IBJA “per 10 grams” is not the same as “per troy ounce.” The Metals-API response doesn’t always include a unit string for special benchmarks, so use symbol semantics from the Symbols page as the source of truth.

Symbol Meaning How to Read the Rate (base=USD) Straightforward Use
IB585PM IBJA Gold 585 PM, per 10 grams “10-gram units per 1 USD” Invert or pair with USDIB585PM; useful when computing grams per USD
USDIB585PM USD per IBJA Gold 585 PM (per 10 grams) “USD per 10 grams” Directly plug into pricing rules: USD per 10g and USD per gram

Confirm symbol definitions on Metals-API Supported Symbols before deploying to production.

Historical and Time-Series for Backfilling

If you need to backfill charts, compute rolling averages, or run model validation on historical IB585PM data, use the historical or time-series endpoints. The responses mirror the latest structure but keyed by date. Because this post focuses on “latest per 10 grams,” we aren’t pasting additional response payloads here. Refer to the Documentation for parameters like date selection and ranges.

Implementation notes:

  • Request the same symbols: IB585PM and USDIB585PM. Store both for auditability and debugging.
  • Normalize to “USD per gram” on ingest so downstream services can use a consistent unit.
  • Cache results and only refresh on your required cadence (see caching tips below).

Practical Integration Guidance

Units: 10 grams vs grams vs troy ounces

  • IB585PM is per 10 grams. To get per gram, divide USDIB585PM by 10.
  • 1 troy ounce = 31.1034768 grams. If your analytics need ounce parity across symbols, convert explicitly.
  • Document this in code and dashboards. Unit drift is a common source of pricing errors.

Base currency, inversion, and accuracy

  • With base=USD, rates.IB585PM is “10g units per USD” while rates.USDIB585PM is “USD per 10g.” Prefer USDIB585PM for direct unit pricing.
  • Keep both in storage; auditors and quants often want to reconcile original and derived fields.
  • Avoid double-inversion bugs: use the provided USDIB585PM rather than inverting IB585PM yourself when possible.

Timestamps, dates, and timezone

  • timestamp is a Unix epoch in seconds (UTC). date is an ISO YYYY-MM-DD string.
  • Log both timestamp and date. If you roll up on local midnight, be explicit about UTC conversion.

Caching and request economy

  • Cache latest responses for a short TTL suitable for your use case (e.g., 30–120 seconds for dashboards; longer for websites displaying indicative prices).
  • Batch symbols in one request: ask for IB585PM and USDIB585PM together.
  • If your pricing isn’t continuous on weekends/holidays, skip refreshes or relax TTL to reduce calls.
  • Use ETag/conditional requests if you proxy responses internally. If not available in your stack, store timestamp and only refresh when you need a newer tick.

Handling weekends and market closures

  • Benchmarks may not change on non-trading days. Your app should not assume an update exists for every calendar day.
  • For PnL or alerts, compare timestamps; do not assume daily cadence implies a new price.

Display and rounding

  • Define per-gram rounding rules (e.g., 2–4 decimals) separate from per 10g rules.
  • For client displays, show the unit (USD/10g or USD/g). For admin/export, include both raw and derived values.

Error handling and resilience

  • Check success and HTTP status. On failure, back off and keep your last known good price (with an “as of” label).
  • Alert on large gaps between timestamps to detect ingestion or provider issues.

From Price Data to Decisions: Analytics with Gold (XAU) Context

While IB585PM is per 10 grams for 585 purity, many analytics models benchmark against 24K troy-ounce prices. If you must align with ounce-based series, normalize your USD per gram field to per troy ounce, keeping a clear lineage of unit conversions. This lets you combine operational pricing (grams) with strategy or hedging analytics (ounces) without confusing the two. The larger takeaway: treat gold as a digital data asset—price discovery, transformation, and model inputs are all software operations now, and consistent units are the foundation.

If you’re building alerting, you can compute percentage changes from your stored USDIB585PM series and trigger events in your Node service. For example, alert if USD per gram moves by more than N basis points intraday and throttle notifications on weekends.

Security, Keys, and Deployment Notes

  • Store YOUR_API_KEY in environment variables or a secrets manager. Never commit it to Git.
  • For serverless (e.g., AWS Lambda, Cloud Run), reuse connections and cache the last response in memory when possible.
  • Log the response timestamp and symbol set alongside your computed USD per gram value for traceability.

Where to Go Next

  • Add retry logic and exponential backoff to your fetcher.
  • Persist a rolling “USD per gram” series for charts or cost-of-goods calculations.
  • Integrate with your ERP or checkout system so product prices sync on your defined schedule.

For all parameter options and additional endpoints (historical, time series, OHLC, bid/ask), read the Metals-API Documentation. When confirming coverage across metals and benchmarks, consult the Supported Symbols reference. For plan details, including commercial usage, visit MCP.

FAQ

How do I get the “USD per 10 grams” price directly?
Request USDIB585PM in the symbols list. In the latest response, use rates.USDIB585PM as “USD per 10 grams.”

What’s the difference between IB585PM and USDIB585PM?
With base=USD, rates.IB585PM is “10-gram units per USD,” while rates.USDIB585PM is “USD per 10 grams.” Use the latter for direct pricing. Store both for reconciliation.

How do I compute USD per gram?
Divide rates.USDIB585PM by 10. For example, if USDIB585PM is 700, then per-gram is 70.

Can I backfill a historical series for IB585PM?
Yes. Use the historical/time-series endpoints with the same symbols (IB585PM and USDIB585PM). See the Documentation for exact parameters.

What about non-trading days?
Benchmarks may not update on weekends/holidays. Cache your last known good value, surface the timestamp, and avoid assuming daily updates.

Ready to integrate IBJA 585 PM prices into your Node.js stack? Get your API key here: Register. Review params and symbol coverage in the Documentation and Symbols, and check plan options on MCP.