Historical Illuvium (ILV) - N/A Prices: hourly OHLC dataset for API consumers
You need hourly OHLC bars for Illuvium (ILV) so your team can backtest signals, feed a dashboard, or price ILV-linked products. By the end of this walkthrough, you’ll be able to pull ILV quotes from Metals-API, interpret the base/inverted rates, and assemble an hourly OHLC dataset suitable for charting and analytics.
What we’re building: an ILV hourly OHLC pipeline
The target is a clean, consistent hourly OHLC series for ILV in USD. You’ll combine:
- Latest quotes to validate symbol mapping and units.
- Intraday data to capture within-day ticks that you’ll aggregate into hourly candles.
- OHLC endpoint to cross-check aggregates for end-of-day accuracy and continuity.
We’ll focus on three endpoints relevant to this task: Latest, Intraday, and OHLC. For everything else (time series, fluctuation, conversion, etc.), use the official Metals-API Documentation.
Symbols, base currency, and inversion: ILV and USDILV
Metals-API quotes are base-relative. When base=USD, a rate value expresses “units of the instrument per 1 USD.” For metals it’s typically “troy ounces per USD.” For ILV, treat it as “ILV tokens per USD.” Metals-API also provides an inverted synthetic symbol pattern: USD<SYMBOL>, which expresses “USD per 1 unit of the instrument.”
| Symbol | Meaning when base=USD | Interpretation |
|---|---|---|
| ILV | ILV per 1 USD | If ILV=0.25, then each USD buys 0.25 ILV. |
| USDILV | USD per 1 ILV | If USDILV=4.00, then 1 ILV costs $4.00. |
Confirm symbol availability in the live catalog here: Metals-API Supported Symbols.
Quick check: get a current ILV quote and its USD inversion
Start with the Latest endpoint to ensure your key is set up, your networking is clear, and you can parse the inverted USDILV price. Replace YOUR_API_KEY with your key.
curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=ILV,USDILV"
You should receive a response shaped like this official sample:
{"success":true,"timestamp":1791936480,"date":"2026-10-14","base":"USD","rates":{"ILV":0.27412280701754,"USD":1,"USDILV":3.6480000000000516}}
How to read it in the context of ILV hourly OHLC:
- success: Successful request flag.
- timestamp: Unix epoch seconds you can map to a UTC time in your app.
- date: Trading date associated with the snapshot. Treat this as UTC-aligned for storage/aggregation.
- base: USD, which means rates are quoted relative to USD.
- rates.ILV: ILV per USD. In the sample, 0.2741228 ILV per 1 USD.
- rates.USDILV: USD per ILV. In the sample, about $3.648 per ILV. This is typically the price you chart or store as close/last.
From quotes to candles: assembling hourly OHLC for ILV
With the symbol and units confirmed, build hourly OHLC bars. The strategy:
- Pull intraday ILV quotes frequently during each hour. Cache locally to reduce duplicate requests.
- Aggregate the cached trades/quotes into OHLC per hour in your timezone of record (usually UTC for consistency).
- Optionally validate end-of-day candles against the OHLC endpoint for that date.
Endpoint roles in the pipeline
- Latest: Sanity check and liveness probe before jobs run (verifies account and symbol mapping).
- Intraday: Core data source for building hourly candles (you aggregate to O/H/L/C client-side).
- OHLC: A daily checkpoint for cross-verification and backfill integrity after market days close.
Reference the intraday and OHLC endpoint details in the Documentation. Keep the scope narrow to ILV and stick to the USD base so rates remain unambiguous.
Minimal client: fetch ILV price and compute the candle close
Below is a Python snippet that calls the same Latest endpoint you just tested, extracts USDILV (USD per ILV), and sketches the steps to roll this into hourly candles. It’s intentionally small and composable—drop it into your data collector service or a cron-driven job.
import os
import time
import json
import urllib.request
from datetime import datetime, timezone
API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
def fetch_latest_ilv():
url = f"https://metals-api.com/api/latest?access_key={API_KEY}&symbols=ILV,USDILV"
with urllib.request.urlopen(url) as resp:
data = json.loads(resp.read().decode("utf-8"))
if not data.get("success"):
raise RuntimeError(f"Metals-API error: {data}")
# Parse fields we use for candles
ts = data["timestamp"] # epoch seconds
dt = datetime.fromtimestamp(ts, tz=timezone.utc)
usd_per_ilv = data["rates"]["USDILV"] # Close/last candidate
ilv_per_usd = data["rates"]["ILV"] # Optional: inverse quote
return {
"timestamp": ts,
"datetime_utc": dt.isoformat(),
"usd_per_ilv": usd_per_ilv,
"ilv_per_usd": ilv_per_usd
}
def append_to_hour_bucket(sample, bucket_store):
# Align to the hour
dt = datetime.fromisoformat(sample["datetime_utc"])
hour_key = dt.replace(minute=0, second=0, microsecond=0).isoformat()
px = sample["usd_per_ilv"]
bucket = bucket_store.get(hour_key)
if bucket is None:
# Initialize O/H/L/C with the first tick in the hour
bucket = {
"open": px,
"high": px,
"low": px,
"close": px,
"first_ts": sample["timestamp"],
"last_ts": sample["timestamp"]
}
else:
bucket["high"] = max(bucket["high"], px)
bucket["low"] = min(bucket["low"], px)
bucket["close"] = px
bucket["last_ts"] = sample["timestamp"]
bucket_store[hour_key] = bucket
if __name__ == "__main__":
# In production, use a persistent store (SQLite, Postgres, S3 object) instead of an in-memory dict.
hour_buckets = {}
# Example: run a small collector loop
for _ in range(3):
s = fetch_latest_ilv()
append_to_hour_bucket(s, hour_buckets)
time.sleep(2)
# Print current partial hourly candle(s)
for hour, ohlc in sorted(hour_buckets.items()):
print(hour, ohlc)
Notes:
- Store candles keyed by UTC timestamps. Conversions to a local zone should happen in the presentation layer.
- Consider snapshotting partial candles every 1–5 minutes and finalizing the hour once the next hour begins.
- If you need complete intraday granularity for backfills, use the Intraday endpoint and aggregate, rather than sampling Latest on a timer.
Designing the hourly ILV OHLC aggregator
To produce stable hourly candles that analytics and traders trust, implement the following behavior:
- Session clock: Use UTC. Each hourly bucket spans [HH:00:00, HH:59:59].
- Open/Close semantics: Open is the first price observed inside the hour, close is the last price observed.
- High/Low: Track extrema across all intrahour ticks.
- Backfill gaps: If a network hiccup causes missing ticks, backfill with the Intraday endpoint. Only mark a candle “final” after cross-checking continuity with subsequent hour or daily OHLC if your workflow requires extra safety.
- Reproducibility: Given the same raw tick stream, you should produce identical OHLC results. Persist raw inputs (timestamp, USDILV) in append-only storage for audits.
Endpoint usage patterns
Latest endpoint (validation and liveness)
Use Latest to validate credentials and make a quick health check before more expensive collection tasks. Include both ILV and USDILV for easy interpretation and runtime assertions around inverse consistency (approximately 1 / ILV ≈ USDILV within tolerance).
Intraday endpoint (input for hourly bars)
Use Intraday to fetch within-day ILV data points. Aggregate to per-hour O/H/L/C in your collector. For accepted query parameters and date/time constraints, see the Documentation. Store raw intraday quotes to enable deterministic re-aggregation and post-hoc corrections.
OHLC endpoint (cross-check and daily alignment)
Use the OHLC endpoint to request open/high/low/close for a given date. This is particularly useful to confirm the last candle of the day aligns with your aggregate, and to detect any rolling adjustments or holiday/weekend behaviors for instruments that have sessions. ILV trades continuously, but a daily checkpoint remains helpful for controls and reconciliation.
Operational details that prevent data drift
- Base currency: Keep base=USD in all requests so your ILV quotes remain consistent. The Latest sample shows both ILV and USDILV to avoid confusion.
- Inversion math: Prefer using the USDILV field directly rather than doing 1 / ILV, which can accumulate rounding differences. If you do invert, use decimal arithmetic with sufficient precision.
- Timestamps and timezones: The API returns a Unix timestamp and a date. Align your storage to UTC. When displaying in user timezones, convert at the presentation layer.
- Update cadence: Depending on your plan, Latest can update every 60 minutes, 10 minutes, or faster. For hourly candles, combining Intraday with a modest polling interval is more robust than relying solely on Latest.
- Caching: Cache identical responses by timestamp to avoid double-counting ticks when your scheduler overlaps or retries.
- Idempotent writes: When persisting hourly candles, use upserts keyed by the hour. Recomputing a candle should not create duplicates.
- Weekends/market closures: ILV is a 24/7 digital asset. Still, be prepared for quieter periods. Do not assume a minimum number of ticks per hour.
- Monitoring: Alert if data staleness exceeds your SLA (e.g., no new intraday ticks for N minutes).
Verification and external sanity checks
Occasionally compare USDILV levels with independent sources to validate connectivity and symbol mapping. Useful references include:
- TradingView: ILVUSD for quick visual confirmation of price direction.
- Metals-API MCP for programmatic control and integrations in your stack.
Scaling notes for production ingestion
- Storage model: Append raw intraday ticks (timestamp, USDILV, source) to immutable storage (e.g., S3). Build hourly OHLC into a separate warehouse table, partitioned by date for efficient queries.
- Rebuild pipeline: Be able to regenerate candles from raw data if rules change (e.g., hour boundary policy) without breaking downstream consumers.
- Schema evolution: Keep a versioned schema. If you add fields (e.g., volume when available), do so backward-compatibly.
- Security: Do not embed the API key in client applications. Keep it server-side or in a managed secrets store.
Step-by-step: end-to-end workflow
- Get your API key: Create an account via Register.
- Validate symbols: Confirm ILV and USDILV on the Symbols list.
- Health check: Use Latest with ILV and USDILV to verify access and parse logic.
- Collect intraday: Schedule Intraday fetches at your desired frequency and store raw ticks.
- Aggregate: Build hourly OHLC from raw ticks with deterministic rules.
- Validate: Cross-check end-of-day with the OHLC endpoint and external references as needed.
- Serve: Expose the hourly dataset to charts, trading logic, or pricing services.
Why ILV data matters for metal-market technologists
Even if you come from metals, crypto-linked assets like ILV push teams toward event-driven ingestion, 24/7 monitoring, and granular aggregation—patterns that carry back into physical commodities, LME-linked instruments, and multi-asset dashboards. Treat this ILV hourly OHLC build as a proving ground for:
- Digital transformation: Unify metals and digital assets data models under a single ingestion and aggregation framework.
- Technological advancement: Adopt robust resampling, caching, and reconciliation workflows that also apply to gold, silver, or base metals when you need intraday precision.
- Data analytics: Standardize candles for cross-asset factor tests and spread analytics in your research environment.
- Smart integration: Wire your pricing, ERP, and commerce systems to consume the same normalized hourly series for deterministic decisions.
- Future trends: As intraday endpoints expand, your aggregation layer remains stable—swapping sources without breaking downstream consumers.
Practical tips that save time
- Always request both ILV and USDILV during development to validate inversions and avoid confusion in dashboards.
- Persist both the integer timestamp and the ISO datetime; auditing is easier when you can reconstruct exact bucket boundaries.
- If a bucket has no ticks, propagate the previous close or mark the candle as empty per your analytics policy. Document the rule so quant teams can reproduce results.
- Use exponential backoff on network errors and write idempotent jobs so retries don’t duplicate data.
- When comparing across sources, compare midpoints, not bid/ask, unless your strategy explicitly models spreads.
Plan notes and next steps
Plans vary by features and update cadence. There is no free trial. As a reference point, Copper Monthly is $19.99/month, suitable for smaller integrations that don’t require high-frequency updates. Evaluate endpoint needs and update intervals in the Documentation and pick a plan that matches your ILV OHLC backfill and live collection requirements.
FAQ
Can I get hourly ILV OHLC directly from a single endpoint?
Use the Intraday endpoint to fetch within-day data and aggregate into hourly candles on your side. The OHLC endpoint is ideal for daily validation or obtaining open/high/low/close for a specific date.
What is the difference between ILV and USDILV fields?
With base=USD, ILV is “ILV per USD.” USDILV is “USD per ILV” (the typical price). Prefer USDILV when building price charts and candles.
Which timezone should I use for hourly buckets?
Store and aggregate in UTC. Convert to user timezones at display time. This ensures cross-system reproducibility and consistent backtesting.
What happens on weekends or holidays?
ILV trades 24/7. You may see quieter periods but not formal closures. Still, implement gap handling and backfills for network or scheduler interruptions.
How often should I poll?
Polling cadence depends on your subscription’s update frequency and latency targets. For hourly candles, use Intraday for completeness and cache responses to avoid double counting. The Latest endpoint update cadence varies by plan.
Ready to build your ILV hourly OHLC feed and wire it into your pricing, research, or trading stack? Get your API key here: Register. Review endpoint specifics in the Documentation, and confirm symbols at Symbols. If you need managed connectivity or integration assistance, explore MCP.