S&P Colombia SmallCap Growth Index (SPCOLSMG) Price API — Getting started guide for developers
You need to chart and alert on the S&P Colombia SmallCap Growth Index in your app. By the end of this guide you’ll fetch the latest SPCOLSMG print for a live dashboard tile and backfill a date range to draw a working chart, with clear handling of base currency, rate semantics, trading days, and caching.
What you will ship: a live tile and a backfilled chart for SPCOLSMG
The minimal integration includes two data paths:
- A latest quote request for your “now” tile and alerts.
- A time-series request to backfill several days for your chart or analytics pipeline.
We’ll use two endpoints only: latest and timeseries. If you need OHLC candles or fluctuation metrics afterward, see the Documentation.
Know your symbol and how the quotes are expressed
Symbol to use: SPCOLSMG. Always confirm on the live directory before you hardcode anything: Indices-API Supported Symbols. For reference on the underlying benchmark, see S&P DJI’s official page for the index: S&P Colombia SmallCap Growth Index overview.
Base currency: USD. By default, Indices-API responses return rates “relative to USD.” You’ll typically see two relevant keys for a given index:
- rates.SPCOLSMG: index units per 1 USD (how many index units you get for one USD).
- rates.USDSPCOLSMG: USD per 1 index unit (how many USD one index unit represents).
For dashboards, most teams display rates.USD[INDEX] (USD per index unit) because it maps directly to “price-like” semantics. If you alert on percent changes, you can use either representation consistently; do not mix them within a series.
Get an API key and environment ready
Sign up for an API key (7-day trial, PRO $49.99/mo) here: Register. Keep this key in a secure secret store (env var, vault). The key is supplied via the access_key query parameter.
Skim the endpoint reference and request semantics: Indices-API Documentation. If you’re auditing coverage or commercial terms (market coverage, calendars), review the MCP page.
Fetch the latest SPCOLSMG print (curl)
This request retrieves the current SPCOLSMG rate set, expressed relative to USD.
curl -s "https://indices-api.com/api/latest?access_key=YOUR_API_KEY"
Sample response (use these exact values to develop before wiring to your key):
{"data":{"success":true,"timestamp":1793407140,"date":"2026-10-31","base":"USD","rates":{"SPCOLSMG":0.080064051240993,"USD":1,"USDSPCOLSMG":12.489999999999968}}}
What you will use from this payload:
- data.success: boolean flag for request status.
- data.timestamp: Unix epoch seconds for when the snapshot was computed; convert to your app’s timezone.
- data.date: ISO date of the price context (trading day boundary).
- data.base: “USD”. All rates are relative to this base.
- data.rates.SPCOLSMG: index units per 1 USD.
- data.rates.USDSPCOLSMG: USD per 1 SPCOLSMG unit (price-like number for tiles and charts).
Update cadence: the latest endpoint refreshes intra-day depending on your plan (every 60 minutes, 10 minutes, etc.). For alerting, cache for at least one interval plus network jitter to avoid noisy polls.
Read and display SPCOLSMG in Python
Below is a minimal Python snippet to fetch the latest rate and display it in “USD per index unit” (rates.USDSPCOLSMG). It also keeps the index-units-per-USD value handy for internal conversions.
import os
import time
import requests
from datetime import datetime, timezone
API_KEY = os.getenv("INDICES_API_KEY", "YOUR_API_KEY")
URL = "https://indices-api.com/api/latest"
resp = requests.get(URL, params={"access_key": API_KEY}, timeout=15)
resp.raise_for_status()
payload = resp.json()
if not payload.get("data", {}).get("success"):
raise RuntimeError("Indices-API request was not successful")
data = payload["data"]
ts = data["timestamp"]
as_of = datetime.fromtimestamp(ts, tz=timezone.utc)
rates = data["rates"]
idx_units_per_usd = rates.get("SPCOLSMG")
usd_per_idx_unit = rates.get("USDSPCOLSMG")
print(f"As of {as_of.isoformat()} (base={data['base']})")
print(f"SPCOLSMG (USD per index unit): {usd_per_idx_unit}")
print(f"SPCOLSMG (index units per USD): {idx_units_per_usd}")
Notes:
- Display the UTC timestamp alongside the human date to avoid timezone ambiguity on dashboards.
- If you store historical rows, persist both representations (SPCOLSMG and USDSPCOLSMG) or one consistently, along with timestamp and date fields.
Backfill a time series for SPCOLSMG
Use the time-series endpoint to retrieve daily closes between two dates. This returns a date-keyed map of rates, where you’ll read the same fields for your symbol on each day (SPCOLSMG and/or USDSPCOLSMG).
curl -s "https://indices-api.com/api/timeseries?access_key=YOUR_API_KEY&start_date=2026-10-01&end_date=2026-10-30"
Implementation details you’ll care about:
- Date windows: end_date cannot be today; pick yesterday or the last completed trading day to avoid incomplete data.
- Trading days vs weekends: markets close on weekends and local holidays; the series may omit non-trading dates entirely. When building a continuous chart axis, left-join on a calendar and forward-fill only if your UX requires it, labeling non-trading days accordingly.
- Symbol filtering: the response may include many symbols; read only rates.SPCOLSMG (or rates.USDSPCOLSMG) per date. If you are aggregating multiple indices, parse each key within each date bucket.
- Units: the base is USD; apply the same interpretation per date as in the latest response. Stick to one chosen representation throughout a series to keep math consistent.
Transform the rates into a chart-ready series
After fetching the timeseries, transform to a simple structure like [{date, close_usd_per_unit}] for plotting libraries. For example:
- date: the object key from the “rates” map (ISO yyyy-mm-dd).
- close_usd_per_unit: the value of rates[date].USDSPCOLSMG.
If you use a charting library (e.g., TradingView Charting Library or D3 line chart examples), normalize dates to midnight UTC and ensure the x-axis skips missing calendar days or clearly marks them.
Operational behavior to account for
Update frequency and polling
The latest endpoint is updated periodically by plan tier (for example, every 60 minutes or every 10 minutes). Align your poll interval at or slightly above the documented refresh frequency. Cache each snapshot for that full interval to avoid duplicate traffic with no new data.
Timezones and timestamps
The payload includes a Unix timestamp (seconds) and a date string. Treat timestamp as canonical. Convert once at ingestion to your standardized timezone (commonly UTC) and only for display switch to user-local time.
Non-trading days
Weekends and local holidays will not produce new official closes. Do not assume the API will synthesize weekend values; when building analytics, operate on trading-day rows only. For UX continuity, you may forward-fill a “last close” on non-trading days, but keep it visually distinct or annotate it as “market closed.”
end_date cannot be today
When calling timeseries, use a bounded range that ends on a completed date (yesterday or the most recent trading day). Trying to include the current date can yield partial or unavailable values.
Caching layers
Client-side: cache by (endpoint, params) for the duration of the refresh interval. Server-side: if you fan out to many clients, centralize a single fetch per interval and serve downstream from your cache. Include the data.timestamp in the cache key to bust only when there’s a new print.
Error handling and retries
- Check data.success before parsing rates.
- Implement exponential backoff on 5xx or transient network errors.
- Validate that expected keys exist: rates.SPCOLSMG or rates.USDSPCOLSMG.
End-to-end example: build a “now” tile and a 30-day chart
- Fetch latest with GET /api/latest. Display data.rates.USDSPCOLSMG, rounded per your UI standards. Keep data.timestamp for the “As of” label.
- Backfill with GET /api/timeseries over the last 30 completed days. Extract per-date USDSPCOLSMG values and draw a line chart.
- On a timer aligned to your plan’s refresh interval, refresh the latest tile. Refresh the timeseries once per day after the close (or after the previous print rolls into the range).
- On weekends, keep the last print and mark the market as closed; do not show a blank chart day.
Troubleshooting data interpretation
If you see small decimals and wonder whether you’re looking at the inverted value: remember the base is USD.
- rates.SPCOLSMG ≈ index units per 1 USD.
- rates.USDSPCOLSMG ≈ USD per 1 index unit (price-like; often what you want).
Pick one and stick to it throughout your pipeline. If you need to switch, use simple inversion where applicable, but prefer the provided pair to avoid floating point drift: use USDSPCOLSMG directly for display.
Production checklists
- Confirm your symbol in production against the live directory: Indices-API Supported Symbols.
- Store raw payloads for a short retention window to aid debugging.
- Log the request URL (without the key), HTTP status, and data.timestamp.
- Normalize all dates to UTC in your database.
- Render an “As of” label using the timestamp to avoid confusion during market holidays.
- If you expand to OHLC, use the dedicated endpoint and keep close values in a separate field from USDSPCOLSMG to avoid type confusion.
Where to go deeper
To add open/high/low/close, intraday intervals, or fluctuation analytics, start with the endpoint index in the Documentation. If you’re evaluating broader market coverage or need a purchasing path, see MCP. When adding new indices, keep your symbol registry authoritative by syncing against the Symbols endpoint before deployment.
FAQ
Q: Which field should I chart for SPCOLSMG — SPCOLSMG or USDSPCOLSMG?
A: For a “price-like” series, use rates.USDSPCOLSMG (USD per 1 index unit). Use rates.SPCOLSMG only if your analytics are designed around index-units-per-USD. Stay consistent across the series.
Q: Why is my timeseries missing weekend dates?
A: The API returns trading-day data. Weekends and local holidays do not have new closes. If you need a continuous axis, forward-fill for display only and annotate those days as market closed.
Q: Can I set end_date to today?
A: No. Use the most recent completed day (yesterday or the last trading day). Timeseries queries that include today can be incomplete or unavailable by design.
Q: How often should I poll latest?
A: Match your plan’s refresh interval (e.g., every 60 or 10 minutes). Cache each successful result for at least that interval to avoid unnecessary calls without new data.
Q: Where do I verify SPCOLSMG is supported?
A: Check the live symbol directory here: Indices-API Supported Symbols.
Spin up your first SPCOLSMG live tile in minutes. Create your key now and start building: Register. For endpoint specifics and expansions (OHLC, intraday, fluctuations), keep the Documentation open as you code.