Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Free and keyless. The portal is a Socrata site: each dataset is queried with SoQL parameters ($where, $select, $order, $limit, $offset, $q).
- Common columns: report_date_as_yyyy_mm_dd (the as-of date of the positions), market_and_exchange_names, contract_market_name, cftc_contract_market_code, commodity_name, open_interest_all; the position columns differ by report.
- Values come back as JSON strings, numbers included.
- Default $limit is 1,000 rows; add an $order when paging with $offset.
- Each report family has a futures-only and a futures-and-options-combined dataset; pick the dataset id in the path.