skillfed

spgci

SPGCI is an API Client for the S&P Commodity Insights REST API

spgci v0.0.100 90.3K downloads/30d#13,604 on PyPI10
Permissive license Apache-2.0 Active released

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 spgci

uv

uv add spgci

poetry

poetry add spgci

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

S&P commodity insights API clientenergy market data pythoncrude oil price data APIcommodity market data libraryplatts API python clientrefining margins analyticsLNG global analytics data
commodity-marketsenergy-dataapi-client

More WWW/HTTP packages