openbb-cftc
The mission of the Commodity Futures Trading Commission (CFTC) is to promote the integrity, resilience, and vibrancy of the U.S. derivatives markets through sound regulation.
What it is and what it does
openbb-cftc is an extension to the OpenBB platform that wraps the CFTC Commitment of Traders database, exposing it through a Python API and optional REST server. It lets you search for commodity contracts by name and retrieve historical open-interest data broken down by trader classification (commercial, non-commercial, managed money, etc.) across different report types.
The package depends on openbb-core and openbb-platform-api, integrating into the OpenBB ecosystem as a router module with two endpoints: `cot_search` for finding contracts and `cot` for fetching reports. Data can be returned as DataFrames or accessed via REST. No credentials are required, though an optional free Socrata app_token can be set to avoid IP-based throttling.
Use it for:
- Search for specific commodity futures contracts (e.g., gold, crude oil) and retrieve their full historical positioning data
- Analyze trader sentiment and positioning trends across commercial, non-commercial, and other trader classes
- Build dashboards or monitoring systems using the REST API to track open interest and trader classification changes
- Compare positioning across different report types (Legacy, Disaggregated, Financial, Supplemental) for the same contract
- Integrate CFTC data into quantitative trading or research workflows via Python DataFrames
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides access to CFTC Commitment of Traders data through a Python API and REST interface, enabling queries of historical contract positions by CFTC code.
Yes, if you need CFTC Commitment of Traders data and are comfortable with AGPL-3.0 licensing. The package is actively maintained, has low install friction, and integrates cleanly into the OpenBB ecosystem. No known vulnerabilities. Consider it essential for derivatives market analysis; skip it if AGPL licensing conflicts with your project or if you need a standalone tool outside OpenBB.
Install
openbb-cftc on PyPI
pip
pip install openbb-cftcuv
uv add openbb-cftcpoetry
poetry add openbb-cftcInstalling openbb-cftc
Before you install
Low install friction with a pure-Python wheel. Actively maintained as of 51 days ago. Requires running `openbb-build` after installation to set up static assets, and optionally `openbb-api` to start a REST server.
License in practice
Licensed under AGPL-3.0-only, which requires derivative works and modifications to be open-sourced under the same license. Suitable for internal tools and open-source projects; review carefully if you plan to distribute proprietary software.
Quickstart
pip install openbb-cftc
openbb-build
from openbb import obb
results = obb.cftc.cot_search(query="gold")
report = obb.cftc.cot(code="CFTC_088695", measure="percent_of_oi", limit=4)
Requires Python 3.10–3.14. Optional: free Socrata account and app_token to avoid IP throttling; set CFTC_APP_TOKEN environment variable if using one.
Verify before relying
- Exact throttling behavior and rate limits when using IP address without app_token
- Performance characteristics and response times for large historical queries
- Whether all four report types (Legacy, Disaggregated, Financial, Supplemental) are fully implemented in this version
Package facts
| License | AGPL-3.0-only (agpl) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — openbb-core, openbb-platform-api |
| Maintenance | actively maintained — 51 days since the last release |
| First released | |
| Downloads | 91,126/month — #13,538 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openbb_cftc-1.4.2-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
openbb-tradingeconomicsIntegrates Trading Economics data into the…
agpl · top 15,000 on PyPI
openbb-benzingaIntegrates Benzinga financial data into the…
agpl · top 15,000 on PyPI
openbb-derivativesProvides derivatives market data and analytics…
agpl · top 15,000 on PyPI
openbb-regulatorsProvides structured access to data from global…
agpl · top 15,000 on PyPI
openbb-cryptoProvides cryptocurrency data retrieval commands…
agpl · top 15,000 on PyPI
openbb-fmpIntegrates Financial Modeling Prep as a data…
agpl · top 15,000 on PyPI
openbb-yfinanceIntegrates Yahoo!Finance data into the OpenBB…
agpl · top 15,000 on PyPI
openbb-commodityProvides commodity-related data commands as an…
agpl · top 15,000 on PyPI
openbb-etfExtends the OpenBB SDK with commands to…
agpl · top 15,000 on PyPI
openbb-indexProvides access to global and European index…
agpl · top 15,000 on PyPI