skillfed

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.

openbb-cftc v1.4.2 91.1K downloads/30d#13,538 on PyPI
AGPL license AGPL-3.0-only Active released

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-cftc

uv

uv add openbb-cftc

poetry

poetry add openbb-cftc

Installing 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

License :: OSI Approved :: GNU Affero General Public License v3Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

CFTC commitment of traders datafutures market positioning reportscommodity trader positions APIopen interest analysisCFTC database accessderivatives market datatrader classification reports
cftc-datafutures-marketopenbb-extension

More WWW/HTTP packages