spgci
SPGCI is an API Client for the S&P Commodity Insights REST API
What it is and what it does
SPGCI is a Python wrapper around the S&P Global Commodity Insights REST API, designed to simplify access to commodity market data, energy forecasts, and refining analytics. It handles authentication token generation automatically, returns results as pandas DataFrames by default, and supports optional auto-pagination and type coercion for date fields. The library covers multiple datasets including market assessments, forward curves, energy price forecasts, refinery data, world oil supply, LNG analytics, and market insights.
The package is built on standard dependencies (pandas for data handling, requests for HTTP calls, tenacity for retry logic) and accepts native Python types—lists and pandas Series are automatically converted to filter expressions. It requires API credentials from S&P Global and targets developers working with commodity markets, energy trading, or supply-chain analytics who want programmatic access to Platts data without writing raw HTTP clients.
Use it for:
- Fetch current crude oil assessments and forward curves for a portfolio of trading symbols in a single DataFrame.
- Build automated energy price forecasts by querying monthly and annual predictions across multiple sectors and regions.
- Retrieve refinery operational data (yields, runs, outages) and refining margins for a specific location or time period.
- Search and download market commentary, subscriber notes, and energy insights articles filtered by keyword and date range.
- Construct historical demand and supply models by querying archived scenarios and reference data for countries and products.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for the S&P Global Commodity Insights REST API, returning market data, forward curves, price forecasts, and energy analytics as pandas DataFrames.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. Install it if you need programmatic access to S&P Global Commodity Insights data and have valid API credentials; the pandas integration and automatic token handling make it substantially easier than calling the REST API directly.
Install
spgci on PyPI
pip
pip install spgciuv
uv add spgcipoetry
poetry add spgciInstalling spgci
Before you install
Low install friction with a pure Python wheel and six common dependencies (pandas, requests, tqdm, typing-extensions, tenacity, packaging). Active maintenance with a recent release (3 days old) and ongoing repository activity.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install spgci
import spgci as ci
ci.set_credentials(username, password)
mdd = ci.MarketData()
df = mdd.get_assessments_by_symbol_current(symbol=["PCAAS00", "PCAAT00"])
Requires Python >= 3.9.0 and valid S&P Global Commodity Insights API credentials (username and password or environment variables SPGCI_USERNAME and SPGCI_PASSWORD).
Verify before relying
- Whether API rate limits or quota constraints apply to typical usage patterns.
- Performance characteristics when paginating large result sets or querying multiple symbols.
- Availability and completeness of historical data across all supported datasets.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0.0,>=3.9.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — pandas, requests, tqdm, typing-extensions, tenacity, packaging |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 90,296/month — #13,604 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spgci-0.0.100-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
energyquantifiedA Python client library for querying Energy…
permissive · top 15,000 on PyPI
pydexcomFetches real-time glucose readings from Dexcom…
permissive · top 15,000 on PyPI
tradingeconomicsProvides Python access to over 300,000 economic…
permissive · top 15,000 on PyPI
wapi-pythonA Python client library for accessing Volue…
unclear · top 15,000 on PyPI
forecast-solarAsynchronous Python client for fetching solar…
permissive · top 15,000 on PyPI
openbb-us-eiaIntegrates U.S. Energy Information…
agpl · top 15,000 on PyPI
Nasdaq-Data-LinkProvides Python access to Nasdaq Data Link's…
permissive · top 15,000 on PyPI
tushareFetches historical and real-time Chinese stock…
permissive · top 15,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI
energyzeroAsynchronous Python client for retrieving…
permissive · top 15,000 on PyPI