{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-ninjas-com/json-schema/api-ninjas-com-commodity-price-response-schema.json",
  "title": "CommodityPriceResponse",
  "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/CommodityPriceResponse",
  "type": "object",
  "properties": {
    "exchange": {
      "type": "string",
      "description": "The symbol of the exchange where the commodity is traded."
    },
    "name": {
      "type": "string",
      "description": "The display name of the commodity (e.g. Gold Futures)."
    },
    "value": {
      "type": "string",
      "description": "The commodity's `?name=` slug (e.g. gold, crude_oil)."
    },
    "price": {
      "type": "number",
      "description": "The current price of the commodity. See currency_unit for the price convention."
    },
    "currency_unit": {
      "type": "string",
      "enum": [
        "USD",
        "USX"
      ],
      "description": "Price convention: USD = US dollars per unit; USX = US cents per unit. Grains, softs, and livestock are typically USX; metals and energy are typically USD."
    },
    "unit": {
      "type": "string",
      "description": "The quote unit (e.g., troy_ounce, barrel, bushel, lb, MMBtu, gallon, metric_ton, short_ton, hundredweight, board_feet)."
    },
    "previous_close": {
      "type": "number",
      "description": "Previous session's closing price in the same quote convention as price."
    },
    "change_24h": {
      "type": "number",
      "description": "Change vs previous close in the quote unit."
    },
    "change_24h_percent": {
      "type": "number",
      "description": "Percent change vs previous close."
    },
    "high_24h": {
      "type": "number",
      "description": "Day's high price."
    },
    "low_24h": {
      "type": "number",
      "description": "Day's low price."
    },
    "high_52w": {
      "type": "number",
      "description": "52-week high."
    },
    "low_52w": {
      "type": "number",
      "description": "52-week low."
    },
    "updated": {
      "type": "integer",
      "description": "Unix timestamp of the price update."
    },
    "futures_contract": {
      "type": "string",
      "description": "The futures contract `price` is quoted for (e.g., GCZ26 = December 2026 gold)."
    },
    "futures_contract_month": {
      "type": "string",
      "description": "Delivery month of futures_contract (YYYY-MM)."
    }
  }
}