How to Get the Lead Ingot China Spot (LEAD-CH) - Per Ton Price via API and convert units to kilograms and metric tons

Metals-API 8 min read
How to Get the Lead Ingot China Spot (LEAD-CH) - Per Ton Price via API and convert units to kilograms and metric tons

You need the current China spot price of Lead ingots (symbol: LEAD-CH) per metric ton, and you also want clean, programmatic conversions to price-per-kilogram and per-metric-ton for quoting, costing, or hedging. By the end of this guide, you’ll pull LEAD-CH from the API, interpret the units correctly, compute USD/ton and USD/kg, and integrate a repeatable conversion workflow.

What you’ll build: pull LEAD-CH and compute USD/ton and USD/kg

We’ll use two Metals-API endpoints to ship this fast:

Illustration: How to Get the Lead Ingot China Spot (LEAD-CH) - Per Ton Price via API and convert units to kilograms and metric tons
  • Latest rates to fetch the real-time LEAD-CH quote and its inverted USD per ton rate.
  • Convert to translate a ton-amount of lead into USD or vice versa, and to handle kilogram inputs by converting kg → tons.

We’ll keep the example focused on the exact symbol in scope: LEAD-CH (Lead Ingot China Spot). If you need to confirm symbols or discover regional variants, see the Metals-API Supported Symbols. For endpoint details and optional parameters, refer to the Metals-API Documentation.

Understanding units: tons, kilograms, and inversion

For industrial metals like lead, prices are commonly referenced per metric ton (1,000 kilograms). Metals-API returns rates with a base currency (here, USD) and includes both the “metal-per-USD” and the inverted “USD-per-metal” symbol, which makes unit math straightforward:

  • rates.LEAD-CH = tons per 1 USD (metal per USD)
  • rates.USDLEAD-CH = USD per 1 ton (USD per metal)

To quote per-kilogram prices, divide USD per ton by 1,000:

  • USD per kg = rates.USDLEAD-CH / 1000

To price an order for N kilograms, convert kilograms to tons (kg / 1000), then multiply by USD per ton:

  • Order value (USD) = (kg / 1000) × rates.USDLEAD-CH

Fetch the current LEAD-CH price

Call the latest endpoint for LEAD-CH and its inverted pair. Requesting both in one call avoids extra round trips and makes unit conversions trivial on your side.

curl example

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

Official response sample

This is a real response fixture for LEAD-CH you can use to validate your parsing and calculations:

{"success":true,"timestamp":1793232480,"date":"2026-10-29","base":"USD","rates":{"LEAD-CH":0.00040733577757409,"USD":1,"USDLEAD-CH":2454.977085380404}}

What the fields mean for pricing

  • success: boolean request status.
  • timestamp: Unix epoch seconds representing the quote time (use for caching and staleness checks).
  • date: YYYY-MM-DD for the quote date.
  • base: the base currency (USD).
  • rates.LEAD-CH: tons per 1 USD (metal-per-USD). Useful for conversions but less intuitive for display.
  • rates.USDLEAD-CH: USD per ton. This is the display-ready per-ton price for China spot lead ingots.

From this sample:

  • USD per ton = 2454.977085380404
  • USD per kilogram = 2454.977085380404 / 1000 ≈ 2.454977085380404

End-to-end code: compute USD/ton and USD/kg for LEAD-CH

The Python snippet below calls /latest, extracts USD per ton, and emits prices per ton and per kilogram. It also shows a basic cache window using the timestamp to avoid over-polling.

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": "LEAD-CH,USDLEAD-CH"
}

def fetch_latest_lead_ch():
    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}")
    return data

def compute_prices(data):
    # USD per ton is the inverted pair
    usd_per_ton = data["rates"]["USDLEAD-CH"]
    usd_per_kg = usd_per_ton / 1000.0
    return usd_per_ton, usd_per_kg

def is_fresh_enough(data, max_age_seconds=60):
    # Timestamps are UNIX epoch seconds
    ts = data.get("timestamp")
    if ts is None:
        return False
    return (time.time() - ts) <= max_age_seconds

if __name__ == "__main__":
    data = fetch_latest_lead_ch()
    if not is_fresh_enough(data, max_age_seconds=120):
        # Decide whether to accept the value, retry, or fall back; policy is app-specific
        pass

    usd_per_ton, usd_per_kg = compute_prices(data)
    print(f"Date: {data['date']}")
    print(f"LEAD-CH USD/ton: {usd_per_ton:,.6f}")
    print(f"LEAD-CH USD/kg:  {usd_per_kg:,.6f}")

Using the sample JSON above

If you paste the official sample JSON from earlier into compute_prices, you’ll read:

  • USD/ton = 2454.977085380404
  • USD/kg ≈ 2.454977085380404

That’s enough to render a price widget, recalc a BOM, or feed your mid-office P&L in manufacturing or recycling workflows.

Convert endpoint: quote orders in tons or kilograms

The convert endpoint returns the converted amount between USD and a metal unit. For LEAD-CH, 1 unit equals 1 metric ton.

  • To compute the USD value of 0.5 tons (i.e., 500 kg): from=LEAD-CH, to=USD, amount=0.5
  • To compute the USD value of 3,250 kg: convert kg → tons (3.25 tons), then use amount=3.25

curl: convert 0.5 tons of LEAD-CH to USD

curl "https://metals-api.com/api/convert?access_key=YOUR_API_KEY&from=LEAD-CH&to=USD&amount=0.5"

Tip: If you already fetched USDLEAD-CH from /latest, you can also compute this locally: USD = amount_tons × USDLEAD-CH. Use /convert when you need a server-side conversion consistent with Metals-API rounding and rate timing.

Practical details that save time

Base currency and inversion

With base=USD, quote fields mean:

  • rates.LEAD-CH: tons per USD (metal-per-USD)
  • rates.USDLEAD-CH: USD per ton (USD-per-metal). Use this for per-ton and per-kg display and settlement calculations.

Units recap

  • 1 ton (t) = 1,000 kg.
  • USD/kg = (USD/ton) ÷ 1000.
  • To price N kilograms: USD = (N / 1000) × (USD/ton).

Timestamps, dates, and staleness

  • timestamp is Unix epoch seconds you can compare to time.time() for freshness checks.
  • date is YYYY-MM-DD for the quote day; combine with timestamp for display.
  • On weekends or during market/holiday closures, the API may serve the last available fix; check timestamp changes to detect updates.

Caching and request efficiency

  • Cache the /latest response for a short window that fits your application’s tolerance (e.g., 30–120 seconds) to avoid unnecessary calls.
  • Request both LEAD-CH and USDLEAD-CH together to skip doing your own inversion math and to minimize round trips.
  • Perform unit conversions (USD/kg, kg → tons) locally; no extra API calls required.

Error handling and fallbacks

  • Check success in the JSON response; if false, do not use the rates.
  • Guard for missing symbols if you changed the symbols list; verify against the Supported Symbols.
  • Define your policy for stale data (e.g., display a badge, freeze quoting, or widen spreads) if timestamp is older than your SLA.

Workflow patterns for Lead (LEAD-CH)

Real-time quoting in e-commerce or RFQs

  • Call /latest for LEAD-CH and USDLEAD-CH at cart/quote time.
  • Compute USD/kg locally and multiply by requested weight.
  • Cache across concurrent users during a short window to keep quotes consistent.

Manufacturing cost rolls and BOM updates

  • Pull USD/ton on a timed schedule (e.g., every 5–15 minutes during trade hours).
  • Persist snapshots with timestamp and date for auditability.
  • Use /convert for server-side valuations if you want consistent rounding across systems.

Research and analytics

  • Normalize all your historical costs to USD/ton and USD/kg using the inverted symbol when available.
  • If you later add history or time-based analytics, consult the Documentation for time-series endpoints and parameters.

Why LEAD-CH data matters for digital operations

Lead (XLE) is a core industrial input across batteries, radiation shielding, and alloys. Embedding the China spot ingot price (LEAD-CH) directly into your stack is a pragmatic step in digital transformation: pricing aligns with real-time market conditions, costing updates continuously across ERP and procurement, and analytics teams can detect dislocations between regions.

With APIs, the heavy lift isn’t connectivity, it’s correctness: consistent units (tons vs. kilograms), correct inversion for USD-per-ton display, and sensible caching. Once those are in place, you can integrate alerts, automate hedging thresholds, or route large quotes for manual review when markets are thin.

Validation and QA checklist

  • Confirm the symbol exists: LEAD-CH is present on the Symbols page.
  • Call /latest for LEAD-CH and USDLEAD-CH in one request.
  • Use rates.USDLEAD-CH as the USD/ton display and calculation base.
  • Compute USD/kg by dividing USD/ton by 1000.
  • Round outputs consistently across UI, invoices, and downstream systems.
  • Track timestamp for freshness, and implement a stale-data policy.

Security, keys, and environments

  • Do not hardcode the API key in client code; inject via server-side env vars.
  • Rate-limit or queue requests in your backend; serve pricing to clients from your cache.
  • Log the timestamp and symbol set with each persisted snapshot for audit.

Where to go next

External resources and references

FAQ

How do I get USD per ton directly?
Request the inverted symbol USDLEAD-CH from /latest. Its value is USD per 1 metric ton.

How do I quote USD per kilogram?
Divide USDLEAD-CH by 1,000. Example: USD/kg = rates.USDLEAD-CH / 1000.

Can I price an order of 750 kg?
Yes. Convert to tons (0.75 t) and either multiply locally by USDLEAD-CH or call /convert with from=LEAD-CH, to=USD, amount=0.75.

What if my result doesn’t change for hours?
Check the timestamp field. If it’s not updating, you may be outside active trading hours or hitting cache. Implement a staleness policy and consider displaying “last updated” in your UI.

How do I confirm I’m using the right symbol?
Look up LEAD-CH on the Symbols page. If the symbol changes or you need a different region, update your request accordingly.

Ready to integrate LEAD-CH pricing into your quoting or ERP flow? Get your API key now and start with the /latest request shown above: Register. For endpoint behavior, parameters, and more examples, see the Documentation and visit metals-api.com.