{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-ninjas-com/json-schema/api-ninjas-com-commodity-forward-curve-response-schema.json",
  "title": "CommodityForwardCurveResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-ninjas-com-commodity-price-api-openapi.yml#/components/schemas/CommodityForwardCurveResponse",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Display name of the commodity."
    },
    "value": {
      "type": "string",
      "description": "The API ?name= parameter value."
    },
    "symbol_root": {
      "type": "string",
      "description": "Contract symbol root (e.g., CL for crude oil)."
    },
    "as_of": {
      "type": "integer",
      "description": "Unix timestamp of the most recent contract update across the curve."
    },
    "structure": {
      "type": "string",
      "enum": [
        "contango",
        "backwardation",
        "mixed",
        "flat"
      ],
      "description": "Curve-shape classification. Contango = strictly upward; backwardation = strictly downward; mixed = both; flat = no change."
    },
    "contango_slope_1m_pct": {
      "type": [
        "number",
        "null"
      ],
      "description": "Percent difference between the front month price and the next month price. Positive = contango at the front."
    },
    "contango_slope_12m_pct": {
      "type": [
        "number",
        "null"
      ],
      "description": "Percent difference between the front month price and the ~12-month-out contract price."
    },
    "curve": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ForwardCurveContract"
      }
    }
  },
  "$defs": {
    "ForwardCurveContract": {
      "type": "object",
      "properties": {
        "contract_symbol": {
          "type": "string",
          "description": "Full contract symbol (e.g., CLM26)."
        },
        "contract_month": {
          "type": "string",
          "description": "Contract delivery month in YYYY-MM format. The precise expiry day depends on the per-commodity rule; use the listing exchange's calendar for exact expiry."
        },
        "month_offset": {
          "type": "integer",
          "description": "Number of calendar months between today and the contract month (0 = current month)."
        },
        "last_price": {
          "type": "number"
        },
        "last_updated": {
          "type": "integer",
          "description": "Unix timestamp of the contract's last update."
        }
      }
    }
  }
}