S&P GSCI Aluminum Index (SPGSIA) OHLC API for intraday time-series retrieval
You need to chart the S&P GSCI Aluminum Index (SPGSIA) with OHLC candles and intraday intervals, wire it into an alerting pipeline, and backfill daily bars for your research store. By the end of this guide, you’ll have working requests to pull the latest SPGSIA print, know how to query daily OHLC and intraday candles, and understand the data formats, units, and operational details you must handle in production.
What you’ll build and the endpoints you’ll use
The goal is a small, composable workflow for SPGSIA:
- Fetch the latest SPGSIA rate for real-time dashboards.
- Retrieve daily OHLC for a specific trading date to draw bars and backtest entry/exit logic.
- Pull intraday interval-based candles for a chosen date to power time-of-day analytics and alerts.
We’ll focus on three endpoints that matter for this job:
- Latest: quick snapshot for SPGSIA.
- OHLC: daily Open/High/Low/Close for a given date.
- Intraday: interval-based candles for a single session day.
If you need to backfill multiple days at once, the Time-series endpoint is the right fit. Parameter details and additional options are documented in the API reference. See the Indices-API Documentation. To confirm the exact symbol code (SPGSIA) or to browse other indices, use the Indices-API Supported Symbols page.
Understand SPGSIA quote conventions: base currency, units, and reversals
Indices-API uses a base/quote convention similar to currency pairs and returns a “rates” object. The base is USD by default. Practically, you’ll work with two complementary numbers:
- rates.SPGSIA: index-units per USD (how many “units of the index” one USD buys).
- rates.USDSPGSIA: USD per one unit of SPGSIA (this is typically what you want for charting price levels).
For charting and analytics it’s more natural to use USD per index unit. In code, prefer rates.USDSPGSIA for the “price.” If you only have rates.SPGSIA, the inverse gives you USD per index: USDSPGSIA = 1 / SPGSIA.
All timestamps in responses are epoch seconds and should be treated as UTC for storage, cache keys, and scheduling.
Get the latest SPGSIA print
Use the Latest endpoint when refreshing dashboards or validating that your feed is up before kicking off more expensive jobs. Authentication is via an access_key query parameter. Plans determine how frequently the “latest” feed updates (for example, every 60 minutes or every 10 minutes depending on tier). See the plan details in the docs and your account page.
curl request
curl -s "https://indices-api.com/api/latest?access_key=YOUR_API_KEY"
Official JSON response example
{
"data": {
"success": true,
"timestamp": 1794357660,
"date": "2026-11-11",
"base": "USD",
"rates": {
"SPGSIA": 0.0051845707175446,
"USD": 1,
"USDSPGSIA": 192.87999999999954
}
}
}
How to interpret this payload:
- success: Boolean indicating the request succeeded.
- timestamp: Unix epoch seconds (UTC). Use this for cache freshness and UI “as of” labels.
- date: The market date for the quote snapshot.
- base: USD. All rates are expressed relative to this base.
- rates.USDSPGSIA: USD per one unit of the S&P GSCI Aluminum Index — use this for price charts.
- rates.SPGSIA: The inverse, index-units per USD. Only compute with it if you need normalized cross-rates.
Python: extract USDSPGSIA and cache the snapshot
import os
import time
import json
import urllib.request
API_KEY = os.getenv("INDICES_API_KEY", "YOUR_API_KEY")
URL = f"https://indices-api.com/api/latest?access_key={API_KEY}"
with urllib.request.urlopen(URL, timeout=10) as resp:
payload = json.loads(resp.read().decode("utf-8"))
# Defensive checks
if not payload.get("data", {}).get("success"):
raise RuntimeError("Latest endpoint returned success=false")
data = payload["data"]
ts = data["timestamp"] # epoch seconds, UTC
as_of_date = data["date"] # e.g., '2026-11-11'
base = data["base"] # 'USD'
rates = data["rates"]
# Prefer USD per index unit for plotting SPGSIA
usd_per_index = rates.get("USDSPGSIA")
if usd_per_index is None:
# Fallback: invert index-units per USD
index_per_usd = rates.get("SPGSIA")
usd_per_index = 1.0 / index_per_usd if index_per_usd else None
if usd_per_index is None:
raise KeyError("Neither USDSPGSIA nor SPGSIA found in latest rates")
print(f"As of {as_of_date} (ts={ts}) SPGSIA price = {usd_per_index:.6f} USD/index (base={base})")
# Example caching strategy (pseudo)
# cache_key = f"latest:SPGSIA:{as_of_date}"
# cache.set(cache_key, {"ts": ts, "price": usd_per_index}, ttl=300) # 5m TTL or align with plan update frequency
Retrieve daily OHLC for SPGSIA
Use the OHLC endpoint to pull a single day’s open, high, low, and close. This is ideal for drawing candlesticks, validating day-over-day moves, and calculating ranges.
- Path format: open-high-low-close/YYYY-MM-DD
- Query: pass your access_key and then read the “rates” object for the SPGSIA entry.
- The response returns OHLC values relative to the base currency (USD). Use the SPGSIA or USDSPGSIA fields as explained earlier, depending on the endpoint representation.
Notes that save time:
- Use a completed market date. If the market is still open or the date is today in your timezone, the close might not be final. For backfills, choose a past business date.
- If you request a weekend or a holiday, the service may return the most recent available trading day for some indices, or an empty/null structure. Build a safe fallback.
- The OHLC response timestamp is UTC; keep your downstream normalization consistent.
Example (pseudocode call shape):
# GET https://indices-api.com/api/open-high-low-close/2026-11-11?access_key=YOUR_API_KEY
# Then select rates["SPGSIA"] from the returned JSON for that date's OHLC.
Because candles evolve intraday, do not persist partial OHLC as “final close” until the session is complete. If you need provisional candlesticks during the session, use the Intraday endpoint (next section) and compute rolling OHLC by interval.
Intraday interval-based candles for SPGSIA
The Intraday endpoint lets you request interval-based bars for a specific date. This is the right choice if you’re powering:
- 15-minute or 5-minute aluminum index monitoring.
- VWAP or hourly range analytics.
- Tight alerting on breakouts or mean reversion mid-session.
Usage pattern:
- Select the trade date in the path or query parameters (see documentation for the supported shape).
- Set the interval you need (e.g., 1m, 5m, 15m) as supported by your plan.
- Filter to the SPGSIA symbol from the returned series and plot or aggregate.
Important operational considerations:
- Intervals are aligned to UTC unless otherwise noted. Convert to user-local time in the UI layer.
- During off-hours you may see sparse or no bars. Do not assume even cadence; prefer plotting libraries that handle missing points gracefully.
- Caching: For active dashboards, cache the most recent intraday response for a short TTL and only refetch at the update cadence your plan allows.
For request parameters, supported intervals, and pagination for longer sessions, refer to the Indices-API Documentation.
Backfill a daily series with the Time-series endpoint
When you need multiple consecutive trading days (e.g., last 250 sessions for a backtest), the Time-series endpoint returns daily snapshots between a start_date and end_date. This allows you to reconstruct closes, compute rolling returns, and bootstrap your store without many single-day calls.
- Set start_date and end_date to past dates. Avoid using today as end_date; use yesterday or the most recent completed business day.
- Some markets do not trade on weekends/holidays; expect gaps. Fill-forward only if your analytics require it, and tag those fills to avoid contaminating realized volatility measures.
- The response provides a date-keyed “rates” map. Extract SPGSIA (or USDSPGSIA) at each date.
For full parameterization, date limits per request, and examples, see the Indices-API Documentation. Confirm the SPGSIA code on the Symbols page before automating.
Production details that prevent footguns
- Base currency: USD. All examples in this guide assume USD base. If you change base in your account or requests, re-check your math and labels.
- Units:
- USDSPGSIA is USD per index unit — best for price charts.
- SPGSIA is index-units per USD — best for cross-normalization when needed.
- Timestamps and timezone: timestamp is epoch seconds in UTC. Normalizing all series to UTC avoids intraday alignment errors.
- Trading days vs weekends: expect no new data on market holidays and weekends. Your backfill job should skip non-trading days or fill-forward consciously with metadata.
- Update frequency: The Latest endpoint refresh cadence depends on your plan tier (for example, every 60 minutes or every 10 minutes). Set cache TTLs to at least the plan’s latency to prevent hammering the API and to avoid phantom “stale” alerts.
- End-of-day finalization: For daily OHLC, only treat a bar as final when the date is completed. If your job runs before finalization, mark the bar provisional.
- End_date cannot be today: When calling time-series, choose yesterday (or latest completed trading day) as end_date for deterministic results.
- Error handling: Always check success in the JSON. If false, retry with backoff, log the request-id if provided, and fall back to cached data for user interfaces.
- Security: Keep your access_key out of client-side code in production. Route requests via your backend.
- Pricing and trial: Pro is $49.99/month with a 7-day trial. Start with a trial key to validate coverage and latency in your environment.
Symbol verification and metadata
This article uses SPGSIA for the S&P GSCI Aluminum Index. If you are scripting dynamic lookups or mapping a user’s selection to API symbols, verify the exact code on the Indices-API Supported Symbols page before issuing requests. For institutional metadata, methodologies, and maintenance schedules, consult the index provider’s official publications. For example, S&P publishes GSCI methodology and governance materials on its site; align roll schedules and holiday calendars before computing strategy metrics.
Putting it together: a minimal SPGSIA pipeline
Here’s a practical workflow you can ship:
- Every N minutes (based on your plan’s update frequency), call Latest and store:
- ts (UTC), date, and USDSPGSIA (price).
- At end of session (cron after market close), call OHLC for the session date:
- Persist open, high, low, close for SPGSIA. If unavailable, backfill at the next retry window.
- Intraday (optional): during the session, call Intraday for the current date and chosen interval:
- Stream or batch-update your candle store, compute session VWAP and intraday ranges.
- Backfill: weekly job using Time-series for the prior month/quarter:
- Use end_date = yesterday, and reconcile any gaps from holidays or outages.
This approach gives you continuous dashboards, timely alerts, and reproducible research datasets, all derived from the same consistent JSON structures.
Where to learn more and get access
- Register for an API key: Register
- Read the endpoint behaviors, plan-specific update frequencies, and parameters: Documentation
- Confirm SPGSIA and browse other supported tickers: Symbols
- Explore multi-counterparty connectivity and platform options: MCP
If you need to validate your aluminum index thesis with third-party literature, consider reviewing the index provider’s methodology pages for roll mechanics, composition, and reweighting cadence. Align these with your time-series fetch logic so your backtests match ground truth.
FAQ
Q1: How are SPGSIA prices expressed in the JSON?
A: With base=USD, rates.USDSPGSIA is USD per one unit of the S&P GSCI Aluminum Index. rates.SPGSIA is the inverse (index-units per USD). For plotting price levels, use USDSPGSIA directly.
Q2: Why does the end_date of my time-series request exclude today?
A: The service treats the market day as complete only after close; using today as end_date yields partial or non-final data. Use yesterday or the most recent completed trading date for deterministic backfills.
Q3: I requested OHLC for a weekend date and got unexpected data or nothing. Is that normal?
A: Yes. Many indices do not trade on weekends or market holidays. You may see no OHLC for that date or the most recent available bar. Your ETL should handle non-trading days explicitly.
Q4: How often does the Latest endpoint update?
A: It depends on your subscription tier; plans commonly refresh every 60 minutes or every 10 minutes. Set your polling and cache TTL to that cadence to avoid unnecessary calls and to keep UI “as of” labels accurate. See the Documentation for details.
Q5: How can I be sure SPGSIA is the right symbol name?
A: Always confirm symbols on the Symbols page before automating. Symbol naming can differ across vendors, and checking once saves debugging time later.
Ready to ship your SPGSIA OHLC and intraday integration? Start your 7-day trial and get an access key here: Register. With an API key in hand, you can copy the curl above, confirm the symbol on the Symbols page, and wire the Latest, OHLC, Intraday, and Time-series endpoints into your pipeline.