--- id: spgci version: "0.0.100" license: Apache-2.0 license_treatment: permissive maintenance: active --- # spgci — SPGCI is an API Client for the S&P Commodity Insights REST API License: permissive · Maintenance: active · Downloads: 90.3K/mo ## 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 above — 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 pip install spgci uv add spgci 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_current - Install friction: low - Maintenance: active - Downloads: 90.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags S&P commodity insights API client, energy market data python, crude oil price data API, commodity market data library, platts API python client, refining margins analytics, LNG global analytics data, commodity-markets, energy-data, api-client [View on SkillFed](https://skillfed.io/packages/spgci) · [View on PyPI](https://pypi.org/project/spgci/)