-
Notifications
You must be signed in to change notification settings - Fork 0
COTClient
Victor Kaiuki edited this page Jun 20, 2026
·
2 revisions
The COTClient is the main entry point for the SDK.
from cftc_cot import COTClient
# Initialize (unauthenticated, rate-limited)
client = COTClient()
# Initialize with API token (recommended for higher limits)
client = COTClient(app_token="YOUR_TOKEN")
# With caching (see the Caching guide)
client = COTClient(cache="memory")
client = COTClient(cache="disk", cache_dir="./cot_cache", cache_ttl=86400)| Parameter | Default | Description |
|---|---|---|
app_token |
None |
Socrata API app token for higher rate limits. |
cache |
None |
"memory", "disk", a COTCache instance, or None. See Caching. |
cache_dir |
"./cot_cache" |
Directory for the disk cache backend. |
cache_ttl |
86400 |
Cache time-to-live in seconds (24h). |
The configured token and cache are automatically applied to every query the client creates.
-
client.legacy(): Legacy Combined -
client.legacy_futures(): Legacy Futures Only -
client.disaggregated(): Disaggregated Combined -
client.disaggregated_futures(): Disaggregated Futures Only -
client.tff(): TFF Combined -
client.tff_futures(): TFF Futures Only
-
client.latest(dataset, market): Fetch latest row. -
client.history(dataset, market, weeks=52): Fetch historical data. -
client.list_markets(dataset): Return unique list of all available markets.
Getting Started
API Reference
Field Reference
Guides
Reference