Skip to content

Troubleshooting

Victor Kaiuki edited this page Jun 20, 2026 · 2 revisions

Troubleshooting

  • 0 rows: Market names are ALL CAPS in the API. SDK market() helper handles this automatically, but if using where() raw, uppercase your search string.
  • 400 Bad Request: Field name mismatch. Use fields.py constants.
  • 403 Forbidden: Rate limit. Use COTClient(app_token="...").
  • Classification Error: Wrong helper method for dataset type.
  • Missing columns: TFF has fewer columns than Legacy/Disaggregated. Check dataset type.
  • COTConnectionError: The API failed repeatedly (429/5xx) and retries were exhausted. Add an app_token to lift rate limits, or raise max_retries / backoff_base on COTQuery.
  • Disk cache error: cache="disk" requires the optional dependency — pip install cftc-cot-soda[cache].
  • NaN COT Index / Z-scores at the start: Rolling metrics need history to fill the window; early rows are NaN by design. Fetch more weeks than the window size.
  • COT Index mixes contracts: market() is a prefix match; a broad term can match several markets. Use a more specific name or market(name, exact=True).

Clone this wiki locally