How to Get Real-Time Uranium (URANIUM) - Per Pound Prices with Metals-API using Python requests
Real-time Uranium (URANIUM) per-pound pricing is critical if you’re building trading tools, structuring supply contracts, quoting nuclear fuel components, or running research dashboards. In this guide, you’ll pull live Uranium prices with Metals-API, convert the API’s default units into a per-pound price suitable for U3O8 market workflows, and integrate the data with Python requests for automated updates. We will focus on a minimal set of endpoints (Latest and Time-series, plus Convert when needed) so you can get production-grade results fast, without over-engineering.
What you will build
We will programmatically retrieve the latest Uranium (URANIUM) price, normalize it to USD per pound, and backfill a historical series to support charting and analytics. You will:
- Call the Latest endpoint to fetch near-real-time rates for URANIUM.
- Transform from the API’s base unit to price-per-pound (lb) for display and analytics.
- Use the Time-series endpoint to backfill historical Uranium rates for a specified window.
- Implement resilient client logic: caching, retries, and downtime handling for weekend/market closures.
Before you start: keys, symbols, and unit semantics
- Get your API key: Sign up on the Metals-API Website to obtain a free API key and explore plans that fit your refresh needs.
- Confirm the symbol: Check that URANIUM is available and note its default unit on the Metals-API Supported Symbols list.
- Understand base currency and units:
- Default base is USD, unless you set a different base.
- Metals are commonly returned per troy ounce. For per-pound analytics, convert using 1 lb (avoirdupois) = 14.583333 troy ounces. If the symbol has a different native unit (e.g., per metric ton), adapt your conversion accordingly based on the symbol metadata.
- Timestamps are UNIX epoch seconds, and dates are UTC. Cache coherently and time-align across your system.
Two endpoints you actually need for URANIUM per-pound workflows
We will focus on:
- Latest rates: for real-time pricing, alerts, and UI display.
- Time-series: to backfill a historical range for charts, PnL, and risk metrics.
For additional endpoints (e.g., OHLC, fluctuation, convert), consult the Metals-API Documentation.
Use case: live Uranium price card in a portfolio dashboard
Assume you maintain a commodities dashboard used by fuel buyers and quant researchers. A price card shows “Uranium (URANIUM), USD/lb” updated intraday. Each refresh should:
- Fetch URANIUM via Latest.
- Convert the API unit (commonly per troy ounce) into per-pound.
- Cache the price and serve from cache until the next refresh window to reduce API calls and jitter.
Step 1 — Verify the URANIUM symbol and unit
Open Metals-API Supported Symbols, find URANIUM, and note:
- Quoted unit (e.g., per troy ounce). If per troy ounce, multiply by 14.583333 to get per-pound.
- Availability and plan requirements for real-time access.
Step 2 — Latest rates request (curl)
The Latest endpoint returns up-to-date prices (frequency depends on your plan). Replace YOUR_API_KEY with your key.
curl -s "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=URANIUM"
What to expect:
- success: boolean indicating request success.
- timestamp: UNIX epoch in seconds (UTC).
- base: the currency prices are quoted against (default USD).
- date: UTC date of the rates.
- rates: map of symbol to numerical rate.
- unit: descriptive string, typically “per troy ounce” for precious/industrial metals.
Step 3 — Convert to per-pound
If the unit is “per troy ounce,” per-pound = price_per_troy_ounce * 14.583333. If the symbol is already per-pound (check the Symbols list), you can skip conversion. Encapsulate this logic to avoid duplication across services.
Python example using requests
This snippet fetches URANIUM from the Latest endpoint, converts to USD/lb if needed, and prints normalized output. Plug it into a FastAPI/Flask job, a cron task, or an Airflow DAG.
import os
import time
import requests
API_BASE = "https://metals-api.com/api"
API_KEY = os.environ.get("METALS_API_KEY", "YOUR_API_KEY")
SYMBOL = "URANIUM"
BASE = "USD"
# 1 lb (avoirdupois) = 14.583333 troy ounces
TROY_OUNCES_PER_POUND = 14.583333
def fetch_latest_uranium_per_pound():
url = f"{API_BASE}/latest"
params = {
"access_key": API_KEY,
"base": BASE,
"symbols": SYMBOL
}
r = requests.get(url, params=params, timeout=10)
r.raise_for_status()
data = r.json()
if not data.get("success", False):
raise RuntimeError(f"Metals-API error: {data}")
unit = data.get("unit")
rates = data.get("rates", {})
uranium_rate = rates.get(SYMBOL)
if uranium_rate is None:
raise RuntimeError(f"Missing rate for {SYMBOL}: {data}")
# Normalize to USD per pound based on the reported unit
if unit and "troy ounce" in unit.lower():
usd_per_lb = uranium_rate * TROY_OUNCES_PER_POUND
normalized_unit = "USD per pound"
else:
# If URANIUM is quoted natively per pound or different unit,
# inspect `unit` and convert accordingly.
# For example, if unit == "per pound": usd_per_lb = uranium_rate
# If unit == "per metric ton": divide by 2204.62262185 to get per lb.
# Always verify via the Symbols list.
if unit and "per pound" in unit.lower():
usd_per_lb = uranium_rate
normalized_unit = "USD per pound"
elif unit and "metric ton" in unit.lower():
usd_per_lb = uranium_rate / 2204.62262185
normalized_unit = "USD per pound"
else:
# Fallback: assume troy ounce if not clearly specified.
usd_per_lb = uranium_rate * TROY_OUNCES_PER_POUND
normalized_unit = "USD per pound (assumed troy ounce base)"
return {
"timestamp": data.get("timestamp"),
"date": data.get("date"),
"base": data.get("base", BASE),
"symbol": SYMBOL,
"usd_per_pound": usd_per_lb,
"source_unit": unit,
"normalized_unit": normalized_unit
}
if __name__ == "__main__":
out = fetch_latest_uranium_per_pound()
print(out)
Key points in this code:
- Unit-aware conversion is mandatory. Do not assume per-pound unless confirmed via the Symbols list.
- Handle missing data by raising exceptions early (e.g., rates[URANIUM] is None).
- Timeouts and raise_for_status prevent silent failures.
- Encapsulate this logic into a small function so you can reuse it in services and batch jobs.
A realistic success response and how to read it
When URANIUM is available and your plan permits latest access, your JSON will look like the samples shown in the Metals-API documentation for other symbols: success boolean, UNIX timestamp, base currency, date, rates, and unit. The values for URANIUM will be provided at query time and may update based on your plan’s refresh interval. For detailed field semantics, see Metals-API Documentation.
Typical field interpretation:
- success: True indicates a valid response you can trust for production workflows.
- timestamp: Convert to your local timezone if you display time; store UTC internally.
- base: If you requested base=USD, prices are USD denominated.
- rates.URANIUM: Numeric price in the response unit (e.g., per troy ounce).
- unit: Use to choose the correct conversion to per-pound.
Example: interpreting rates and converting units
Suppose the response indicates unit “per troy ounce” and you get a URANIUM rate as a floating-point number. To obtain USD/lb:
- usd_per_lb = rate * 14.583333
- Round or format to your UI needs, but preserve raw precision internally for analytics.
Historical backfill with the Time-series endpoint
For charting or research (e.g., correlation, volatility, moving averages), use Time-series to fetch daily URANIUM prices between a start and end date.
When to use Time-series vs. Historical-by-date
- Time-series: best for contiguous date ranges (charts, rolling windows).
- Single Historical day: best for deterministic backfills or reconciling a precise trade date.
Time-series request (curl)
Replace YOUR_API_KEY and adjust dates to your window in UTC (YYYY-MM-DD). Keep the date range to what you need to control payload size and latency.
curl -s "https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&base=USD&symbols=URANIUM&start_date=2026-09-01&end_date=2026-09-21"
Expected response fields mirror the sample shapes shown in documentation for other metals:
- success: True
- timeseries: True
- start_date, end_date: the range you requested
- base: USD (if specified)
- rates: mapping of date strings to inner maps with URANIUM rate(s)
- unit: the unit for rates (e.g., per troy ounce)
Processing guidance:
- Iterate each YYYY-MM-DD key, extract rates.URANIUM, and apply the same per-pound conversion as with Latest.
- Fill missing dates (weekends/holidays) if your chart expects continuous x-axes; decide on forward-fill vs. gaps based on your analytics policy.
- Store both the raw value and normalized per-pound value. This enables later reprocessing if unit conventions evolve.
Per-pound conversion details and pitfalls
- Troy vs. avoirdupois:
- 1 avoirdupois pound = 16 avoirdupois ounces = 14.583333 troy ounces.
- Per-pound = per-troy-ounce * 14.583333.
- Metric conversions:
- If a symbol is per metric ton, per-pound = per-metric-ton / 2204.62262185.
- Always check the symbol’s documented unit on the Symbols list before building conversions.
Caching, refresh cycles, and cost control
- Refresh interval: Metals-API updates vary by plan. Cache until the next guaranteed refresh to minimize redundant hits and a “jittery” UI.
- Server-side cache: Keep a memory cache (e.g., Redis) with a TTL equal to the plan’s update frequency plus a small buffer. Serve cached uranium quotes to clients, and refresh in the background.
- ETL vs. on-demand: For research dashboards, schedule timed jobs to persist the latest URANIUM price for the day, improving latency and cost.
- Compression: Enable HTTP compression in your client if available to reduce bandwidth on larger time-series calls.
Error handling and resilience
- Graceful degradation:
- If Latest fails, display the most recent cached price and label it “delayed.”
- Retry with exponential backoff for transient network issues.
- Validation:
- Verify rates[URANIUM] is present and numeric.
- Verify unit and conversion logic before using the number downstream.
- Time windows:
- Markets may be closed on weekends/holidays. Your time-series may show no new data for some dates. Do not treat this as an error.
Authentication, quotas, and security
- Authentication: Supply access_key as a query parameter. Keep keys in environment variables or a secrets manager; never commit to version control.
- Quota management: Centralize requests behind a small service that caches results and enforces refresh schedules. Aggregate internal traffic to avoid exceeding plan limits.
- Transport: Use HTTPS (default) end-to-end. If you run through a proxy, ensure TLS is properly terminated and internal requests are not downgraded.
Data modeling and downstream analytics
- Schema recommendation:
- date (UTC), timestamp (epoch), symbol (URANIUM), base (USD), unit_source (e.g., per troy ounce), rate_raw, rate_usd_per_lb, source (metals-api), received_at.
- Idempotency: If you rerun a job for the same date, upsert rather than insert to avoid duplicates.
- Precision: Store rates as decimal with sufficient precision to avoid rounding error in downstream analytics.
Advanced: building alerts and hedging tools
- Price break alerts: Compare the latest normalized USD/lb price to thresholds. Send Slack/Email on breakouts.
- Rolling metrics: From the Time-series, compute rolling mean/volatility and detect regime shifts.
- Blended indices: If you price products based on a blend of URANIUM and processing surcharges, join normalized series in your warehouse, then compute synthetic indices.
Example: end-to-end curl to screen price
This single-line approach fetches and prints the response with curl. Parse the JSON and convert to per-pound in your tool of choice.
curl -s "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=URANIUM"
After receiving the JSON, you will:
- Parse success/timestamp/date/base/unit fields.
- Extract rates.URANIUM.
- Convert to per-pound based on the unit.
Unit testing, monitoring, and observability
- Tests:
- Mock Metals-API responses for success and failure paths.
- Test unit conversions thoroughly: troy ounce to pound, metric ton to pound.
- Monitoring:
- Emit metrics for call success rate, latency, and cache hit ratio.
- Track drift between subsequent updates; unusual jumps can trigger manual review.
- Logging:
- Log the timestamp, unit, and normalized value for each pull for audit and replay.
When to use Convert
If you need to convert an amount between USD and URANIUM units, or between currencies, the Convert endpoint is useful. For per-pound quoting you often only need Latest/Time-series plus unit math. For more on Convert parameters and examples, see the Metals-API Documentation.
Performance optimization checklist
- Use a server-side cache keyed by (endpoint, symbol, base, unit) with TTL aligned to your plan refresh interval.
- Batch symbols where possible (e.g., request multiple symbols in one call if you display several metals).
- Avoid redundant time-series backfills; persist results and only request deltas for new days.
- Implement circuit breakers: on repeated failures, serve stale-but-recent cache with a visible “delayed” label.
Security best practices
- Store access_key in environment variables or a secure secrets manager (e.g., AWS Secrets Manager, Vault).
- Restrict egress to Metals-API hosts; inspect DNS/HTTPS configuration in your environment.
- Protect logs: if you log URLs, redact or omit the access_key query param.
Practical guidance a beginner might miss
- Timezone discipline: Metals-API timestamps are UTC. Normalize everything to UTC internally to prevent subtle bugs in daily rolls.
- Weekend behavior: Expect flat or missing updates on weekends/holidays. Decide on forward-fill vs. gaps for your charts.
- Precision/rounding: Round only at display time; keep raw decimals for analytics.
- Stable identifiers: Use the exact symbol “URANIUM” consistently to avoid cache misses and mismatched data.
Digital transformation side note: rare earths and advanced materials
While this tutorial focuses on Uranium, the same integration patterns apply to advanced materials like Neodymium (ND) that fuel EV motors and wind turbines. Modern APIs abstract away fragmented market data, enabling developers to automate sourcing and pricing workflows. This transformation happens at the edge: small services that pull, normalize, cache, and expose metal prices to UIs, ERP systems, and ML pipelines.
Link library
- Metals-API Website — create an account and get your free API key.
- Metals-API Documentation — full parameter and endpoint reference.
- Metals-API Supported Symbols — confirm URANIUM and units before coding.
- EIA Uranium Marketing — contextual background on uranium markets.
Add a URANIUM price card to your UI
Once you normalize to USD/lb, a simple UI component can show:
- URANIUM — $X.XX / lb
- Last updated: 2026-09-21 14:10 UTC (timestamp from API)
- Intraday change vs. yesterday’s close (compute from Time-series)
Troubleshooting guide
- I see no URANIUM rate in rates:
- Verify symbol spelling on the Symbols list.
- Ensure your plan includes the symbol and desired frequency.
- My price seems off by 14–15x:
- You likely forgot to convert from troy ounce to pound, or double-converted. Re-check unit and apply the correct factor once.
- Gaps in time-series:
- Non-trading days and market holidays can cause gaps. Choose forward-fill or leave gaps; be explicit in your charting logic.
- High request volume:
- Cache results based on plan refresh cadence. Batch symbols where possible.
- HTTP or timeout errors:
- Implement retries with exponential backoff and fall back to cached data if live fetch fails.
Conclusion
With Metals-API, you can put real-time Uranium (URANIUM) pricing into production quickly. Use Latest for up-to-date quotes, Time-series for historical context, and apply careful unit conversion to present USD per pound. Add caching, error handling, and clear timestamp labeling to keep your UX fast and reliable. Start by confirming URANIUM’s unit on the Supported Symbols page, then implement the minimal endpoint set shown here. Ready to build? Visit the Metals-API Website to get your free API key and ship a dependable Uranium price service today.
FAQ
- What symbol should I use for Uranium?
- Use URANIUM. Verify availability, unit, and any plan requirements on the Symbols list.
- Are prices in USD by default?
- Yes, base=USD by default. You can specify a different base if needed.
- How often do “Latest” prices update?
- Refresh frequency depends on your subscription plan. Cache accordingly.
- How do I convert to USD per pound?
- If unit is per troy ounce, multiply by 14.583333. If per metric ton, divide by 2204.62262185. If already per pound, no conversion is needed.
- How do I handle weekends and holidays?
- Expect fewer or no updates. Decide on forward-fill or gaps based on your analytics policy.
- Where can I find endpoint details and more examples?
- See the Metals-API Documentation for parameters, response formats, and advanced endpoints.