S&P GSCI Soybean Oil Index (SPGSBO) Price Change API — Daily and Intraday Endpoints for Developers
To chart the S&P GSCI Soybean Oil Index or alert on a move, you need to retrieve SPGSBO, distinguish the index-oriented quote from its reciprocal, and compare observations on a consistent basis. By the end of this guide, you can request the latest value, read the returned fields, and plan daily and intraday data collection without treating a stale quote as a new market move.
Choose the right data for the job
The latest endpoint is the starting point for a current dashboard value or a polling-based alert. It returns a snapshot, not a sequence of intraday candles. Store successive observations if you want to calculate changes between snapshots, while remembering that your polling interval does not determine how often the underlying data updates.
For a daily chart or backfill, use the time-series endpoint, which returns historical daily rates between a start date and an end date. For interval-based candles on a specific date, use the intraday endpoint. Check the Documentation for the intraday request syntax, supported intervals, availability and applicable request limits before designing the chart.
SPGSBO is the symbol used in the response below. Confirm its current availability and specifications on the Symbols page before making it a production dependency.
Request the latest SPGSBO value
The following request calls the latest endpoint. Replace YOUR_API_KEY with your own key; the request authenticates through the access_key query parameter.
curl 'https://indices-api.com/api/latest?access_key=YOUR_API_KEY'
A response for this request has the following JSON shape. The outer data object matters: read the quote from its nested rates object, rather than looking for rates at the top level.
{"data":{"success":true,"timestamp":1796344860,"date":"2026-12-04","base":"USD","rates":{"SPGSBO":0.0034044987045882,"USD":1,"USDSPGSBO":293.7290000000037}}}
The fields needed for a dashboard or alert are:
data.success: whether the API reports a successful result. Check it before using the values.data.rates.USDSPGSBO: the index-oriented quote in this response. Use this field consistently if your chart displays that orientation.data.rates.SPGSBO: the reciprocal quote relative to the USD base. It is not interchangeable withUSDSPGSBO.data.base: the base currency,USDin this response.data.rates.USDis the base rate.data.date: the response’s date. Keep it with the observation, but confirm the relevant market and reporting timezone before using it as a session boundary.data.timestamp: a Unix timestamp in seconds. Interpret it as an instant in UTC and convert it to the display timezone in your application.
The two SPGSBO rate fields describe opposite quote orientations. In the example, SPGSBO is approximately the reciprocal of USDSPGSBO. That distinction changes the direction of a calculated move: an increase in one corresponds to a decrease in the other. Label the field and its orientation in your chart and alert configuration; do not present both as the same price.
This is an index quote, not a direct quote for a physical soybean oil purchase. If a product needs a particular index level, settlement value or tradable instrument price, confirm that the selected field and data entitlement meet that requirement before using it for decisions.
Read the response in Python
This example calls the same latest endpoint and extracts the fields from the response. It uses Python’s standard library and reads the API key from an environment variable so that the key does not need to be committed with the source.
import json
import os
from datetime import datetime, timezone
from decimal import Decimal
from urllib.parse import urlencode
from urllib.request import urlopen
api_key = os.environ["INDICES_API_KEY"]
query = urlencode({"access_key": api_key})
url = "https://indices-api.com/api/latest?" + query
with urlopen(url, timeout=10) as response:
payload = json.load(response, parse_float=Decimal)
data = payload["data"]
if not data["success"]:
raise RuntimeError("Indices-API did not return a successful result")
rates = data["rates"]
index_quote = rates["USDSPGSBO"]
reciprocal_quote = rates["SPGSBO"]
observed_at = datetime.fromtimestamp(
data["timestamp"], tz=timezone.utc
)
print("Base:", data["base"])
print("Date:", data["date"])
print("Timestamp UTC:", observed_at.isoformat())
print("USDSPGSBO:", index_quote)
print("SPGSBO:", reciprocal_quote)
Set INDICES_API_KEY in your runtime environment before running the script. The sample parses decimal JSON values with Decimal, which helps avoid adding binary floating-point rounding to subsequent calculations. Keep the original precision in storage and round only when formatting a value for display.
For production, handle network failures, unsuccessful API responses and missing fields as separate failure cases. A missing USDSPGSBO should result in a clear unavailable-data state, not a fallback to SPGSBO: the latter would silently reverse the quote orientation.
Because the key is in the request URL, configure application and proxy logging so that query strings containing credentials are not retained or exposed. Keep the key on the server when possible rather than embedding it in a public dashboard.
Calculate changes and build daily or intraday charts
For a snapshot-based change, compare two observations of the same field and base. The absolute change is the newer quote minus the earlier quote. The percentage change is that difference divided by the earlier quote, multiplied by 100; reject a zero or missing earlier value rather than dividing by it.
Persist the field name, base, quote, API timestamp and response date with each observation. That record lets you distinguish a genuine change from a repeated response and makes it possible to reproduce the value shown in an alert. It also prevents an accidental comparison between SPGSBO and USDSPGSBO.
For an alert, define the comparison explicitly: for example, a change since the previous stored observation is different from a change since the previous trading session. Only evaluate the alert when both observations are valid and fresh enough for the product. Deduplicate notifications for a repeated timestamp or repeated observation according to your alert policy.
Use the time-series endpoint when the goal is a daily historical chart rather than a collection of polling snapshots. Its rates object is organized by date, so the application can map each returned date to the relevant symbol rate after verifying the response and quote orientation. The end_date cannot be today; use an earlier date and check the documentation for the permitted date range per request.
Do not assume a row exists for every calendar day. Weekends, market holidays and index-specific schedules can leave gaps, and a returned observation is not automatically proof of a new trading session. Preserve the dates actually returned and decide whether the chart should show gaps or carry an earlier value forward; if you carry a value forward, mark it as carried rather than as a new observation.
Historical coverage can differ by symbol. Verify availability for SPGSBO before promising a particular backfill period, and validate the first and last returned observations against the requested range. If the range exceeds the applicable per-request limit, split it into permitted windows and reconcile the boundaries before loading the results into your chart.
For an intraday chart, request interval-based candles for the relevant date through the intraday endpoint. Confirm the available intervals, request parameters, response fields, timezone and symbol coverage in the documentation before implementing a candle parser. A series of latest snapshots can support a simple line chart, but it is not automatically equivalent to the endpoint’s interval candles.
Index sessions and calendar dates need special care around weekends and holidays. Use the timestamp as the observation instant, retain the API’s date separately, and apply a confirmed market calendar when labeling sessions. Do not infer an official close merely because an observation is the last one your polling job received that day.
Freshness, caching and operational checks
Latest data update frequency depends on the subscription plan. The available description includes updates every 60 minutes or every 10 minutes, depending on plan; check your entitlement for the cadence that applies to SPGSBO. Polling faster than the feed updates may return the same observation and should not be treated as additional market activity.
Cache the latest successful response for an interval appropriate to your plan and product. Show its timestamp alongside the displayed quote, and set a freshness threshold so that a dashboard can label or suppress stale data. If a request fails, retaining the last successful result may be useful, but it should remain visibly dated rather than appearing live.
For historical data, cache completed ranges separately from the latest snapshot and define when to refresh them if corrections matter to your application. Treat missing dates as data to investigate, not necessarily as an API failure. Check the documentation for the relevant range limits and any pagination or retrieval behavior before implementing a large backfill; do not assume that a single request will return every desired observation.
If your workflow uses an MCP client, the MCP page is a starting point for that integration. Apply the same checks for symbol, quote orientation and freshness regardless of how the data reaches the application.
FAQ
Which field should I use for an SPGSBO chart?
For the index-oriented quote in the latest response shown here, use data.rates.USDSPGSBO. data.rates.SPGSBO is its reciprocal orientation, so confirm your desired units and use the same field throughout a calculation.
Can I use the latest endpoint for intraday candles?
The latest endpoint provides a snapshot. Use the intraday endpoint for interval-based candles, after checking SPGSBO availability, supported intervals and the request and response details.
Why might a daily series skip a date?
Non-trading days, holidays and data availability can produce gaps. Keep returned dates intact and consult the applicable index calendar rather than treating every missing calendar day as an error.
Can a time-series request end today?
No. Set end_date to an earlier date. For a current snapshot, use the latest endpoint and retain its timestamp separately from historical daily observations.
Ready to test the integration? Visit Register to get a free API key, then request the latest response and confirm SPGSBO coverage and freshness for your intended workflow.