Get the forward/futures curve for a commodity from Yahoo Finance – the historical daily closing (settlement) price of each of the nearest contracts dated futures contracts from the current month on (e.g. Crude Oil’s December 2026, January 2027, … contracts), rather than a single flat continuous/spot price.

This is what a Schwartz-Smith (2000) two-factor commodity price model needs to back out the convenience-yield term structure under the risk-neutral (Q) measure – the curve’s shape (contango or backwardation) at each point in time is exactly what a single spot price series cannot reveal.

Not every commodity has a listed contract for every calendar month (grains in particular only trade specific delivery months), and the contracts of the first months may already have expired (for crude oil the current month’s contract and, late in the month, the next month’s). Those months are skipped and later months are tried instead, until contracts contracts are found.

By default the columns are the contracts listed today, so a past date shows how those contracts traded then, not the curve as it stood that day. With generic=True the columns are the positions on each day’s curve instead: the front (the nearest contract that has not expired on that day), +1, +2 and so on, rolling to the next contract the day after the front’s last trading day (the generic or nearby series, CL1, CL2, … in Bloomberg notation). A position is a rank on the curve, not a constant maturity: the front’s time to expiry shortens each day and jumps at the roll, as no price is interpolated. The last trading days follow the CME Group contract specifications on the US exchange calendar.

Yahoo Finance only publishes the contracts that still trade: a contract’s history disappears once it expires, and no free source publishes it (FinancialModelingPrep has the continuous front contract only). On a past date the positions of the contracts that have expired since are therefore NaN rather than filled with another contract: for crude oil on 2026-09-15 the front (October 2026) and +1 (November 2026) are NaN and +2 is the December 2026 contract. The further back the date, the more positions are NaN, until none is left about contracts months back.

With growth=True the change is that of each column over lag trading days: of a contract, or with generic of a position, which compares two contracts across a roll.

Also known as: futures term structure, forward curve, generic futures, nearby futures.

Commodity Forward Curve in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_commodity_forward_curve as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2026-10-13', end_date='2026-10-23')

economics.get_commodity_forward_curve(
    "Crude Oil", contracts=4, generic=True
)

Or, after setting up the Finance Toolkit MCP, ask:

What did the front four crude oil futures contracts trade at from 13 to 23 October 2026, rolling to the next contract at each expiry?

Which returns:

Date Front +1 +2 +3
2026-10-13 nan 93.17 92.23 91.15
2026-10-14 nan 93.9 92.83 91.53
2026-10-15 nan 96.5 94.89 93.02
2026-10-16 nan 99.02 97.44 95.48
2026-10-19 nan 98.54 96.67 94.69
2026-10-20 nan 97.82 96.02 94.05
2026-10-21 97.15 95.46 93.71 91.99
2026-10-22 99.47 97.52 95.35 93.08
2026-10-23 103.27 100.94 98.36 95.68

Parameters

get_commodity_forward_curve accepts the following parameters.

ParameterTypeDescriptionExample
commoditystr | list[str] | NoneThe commodity, or a list of them, to retrieve the curve for: “Crude Oil”, “Natural Gas”, “Gold”, “Silver”, “Copper”, “Corn”, “Wheat” or “Soybeans”. Defaults to None, which retrieves every one of them."Gold"
contractsintThe number of contracts to return, the nearest listed ones from the current month on, or with generic the number of positions (the front included). Defaults to 12.6
genericboolWhether the columns are the positions on each day’s curve (Front, +1, +2, …) instead of the contracts listed today. Defaults to False.False
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
growthboolWhether to return the change of each column instead of the price. Defaults to False.True
lagint | list[int]The number of trading days to calculate the change over. Defaults to 1.4
Share