{
  "openapi": "3.0.1",
  "info": {
    "title": "Commodity Futures Data API - Quotes, History, Options, Barchart",
    "description": "Commodity and futures market data from your own Barchart OnDemand key: real-time or delayed quotes, OHLC price history, futures options with greeks, contract specs, expirations, all futures on an exchange, local grain cash bids, USDA grain prices and commodity statistics. Read only.",
    "version": "0.1",
    "x-build-id": "8cVjI6ZkfxudvKkDJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~commodity-futures-market-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-commodity-futures-market-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~commodity-futures-market-data-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-commodity-futures-market-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~commodity-futures-market-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-commodity-futures-market-data-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "quote",
              "history",
              "futuresByExchange",
              "futuresOptions",
              "futuresSpecifications",
              "futuresExpirations",
              "grainBids",
              "usdaGrainPrices",
              "commodityStats"
            ],
            "type": "string",
            "description": "Quotes reads the latest real-time, delayed or end-of-day quote of each symbol. Price history reads ticks, minute bars or daily to yearly bars of each symbol, including nearest and continuation futures series. Futures by exchange quotes every contract on one exchange. Futures options reads options on a futures root or contract with greeks. Specifications and expirations read futures contract reference data. Grain cash bids reads local elevator and processor bids around a place. USDA grain prices reads USDA reported cash grain bids. Commodity statistics reads dated values of statistics series.",
            "default": "quote"
          },
          "symbols": {
            "title": "Symbols",
            "type": "array",
            "description": "Quotes, price history, futures options (option symbols) and commodity statistics (series symbols). Barchart symbols, one per line: ZC*1 is the front corn contract, ZC*2 the second, ZC^F every corn contract, CLZ26 one contract, GC*0 the active gold contract; stocks, indexes, currencies and crypto use their Barchart symbols such as AAPL or $SPX. Statistics series look like USDA-SOYB-PROD-MS-96.CS.",
            "default": [
              "ZC*1"
            ],
            "items": {
              "type": "string"
            }
          },
          "roots": {
            "title": "Futures roots",
            "type": "array",
            "description": "Futures options, specifications and expirations. Futures root symbols such as ZC (corn), ZS (soybeans), ZW (wheat), CL (crude oil), NG (natural gas), GC (gold), LE (live cattle), one per line.",
            "items": {
              "type": "string"
            }
          },
          "contracts": {
            "title": "Futures contracts",
            "type": "array",
            "description": "Futures options and expirations. Futures contract symbols such as ZCN26 or CLZ26, one per line.",
            "items": {
              "type": "string"
            }
          },
          "exchange": {
            "title": "Exchange",
            "enum": [
              "LIFFE",
              "IOM",
              "CROSS",
              "CME",
              "CBOT",
              "MIAX",
              "NYMEX",
              "CASH",
              "CBOE",
              "CFE",
              "ICEUS",
              "LME",
              "WCE",
              "GBLX",
              "IMM",
              "BMF",
              "ROFEX",
              "EUIDX",
              "SFE",
              "ICEFI",
              "ICE",
              "SIMEX",
              "EUREX",
              "MEFF",
              "COMEX",
              "HKFE",
              "ENDEX",
              "TIFFE",
              "MDEX",
              "SAFEX",
              "OMX",
              "CXMI",
              "NYMI",
              "TFEX",
              "MNTRL",
              "JPX",
              "TAIWA",
              "CBOTM",
              "MATIF",
              "LCE",
              "KFE",
              "BSE",
              "SHFE",
              "NCDEX",
              "NZX",
              "EEX",
              "CZCE",
              "DCE",
              "TURK",
              "MATBA",
              "TOCOM",
              "DGCX",
              "MCX",
              "CFFEX",
              "NSE",
              "EEX_POWER",
              "SGCOM",
              "SGXFX",
              "SGXNZ",
              "SGIDX"
            ],
            "type": "string",
            "description": "Futures by exchange (required), futures options and futures specifications. The exchange code, such as CBOT, CME, NYMEX, COMEX, ICEUS or EUREX."
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Futures by exchange. Only contracts in this commodity category, such as Grains, Energies, Metals or Meats."
          },
          "futuresCategories": {
            "title": "Futures categories",
            "type": "array",
            "description": "Futures specifications. Only these categories.",
            "items": {
              "type": "string",
              "enum": [
                "energies",
                "financials",
                "grains",
                "indices",
                "meats",
                "metals",
                "softs",
                "currencies"
              ],
              "enumTitles": [
                "Energies",
                "Financials",
                "Grains",
                "Indices",
                "Meats",
                "Metals",
                "Softs",
                "Currencies"
              ]
            }
          },
          "extraFields": {
            "title": "Extra output fields",
            "type": "array",
            "description": "Quotes, futures by exchange, futures options and expirations. Optional output fields to add, named as in the Barchart OnDemand docs, such as openInterest, settlement, previousSettlement, expirationDate, lastTradingDay, fiftyTwoWkHigh, exchangeMargin or impliedVolatility for quotes, or premium and openInterest for options.",
            "items": {
              "type": "string"
            }
          },
          "historyType": {
            "title": "History type",
            "enum": [
              "ticks",
              "minutes",
              "nearbyMinutes",
              "formTMinutes",
              "daily",
              "dailyNearest",
              "dailyContinue",
              "weekly",
              "weeklyNearest",
              "weeklyContinue",
              "monthly",
              "monthlyNearest",
              "monthlyContinue",
              "quarterly",
              "quarterlyNearest",
              "quarterlyContinue",
              "yearly",
              "yearlyNearest",
              "yearlyContinue"
            ],
            "type": "string",
            "description": "Price history. Ticks, minute bars, or daily, weekly, monthly, quarterly or yearly bars. The Nearest types roll a futures root through its front contracts; the Continue types build a continuation series.",
            "default": "daily"
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Price history and commodity statistics. As YYYY-MM-DD, or YYYY-MM-DD HH:MM for minute and tick history. Price history without a start date returns only the current day."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Price history and commodity statistics. As YYYY-MM-DD, or YYYY-MM-DD HH:MM for minute and tick history."
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Price history and commodity statistics. Oldest first or newest first. Empty uses the provider default."
          },
          "interval": {
            "title": "Minutes per bar",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "Price history, minute types only. The number of minutes in each bar, such as 5, 15 or 60."
          },
          "volumeType": {
            "title": "Volume",
            "enum": [
              "total",
              "sum",
              "contract",
              "sumcontract",
              "sumtotal"
            ],
            "type": "string",
            "description": "Price history. For futures, contract or total volume; the sum types add daily volumes over weekly and longer bars instead of averaging them."
          },
          "nearby": {
            "title": "Nearby contract",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "Price history, Nearest types. 1 is the front month, 2 the next contract and so on."
          },
          "backAdjust": {
            "title": "Back adjust",
            "type": "boolean",
            "description": "Price history, multi-contract futures series. Adjust earlier contracts by the roll gap."
          },
          "daysToExpiration": {
            "title": "Roll days before expiration",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Price history, multi-contract futures series. Calendar days before expiration to switch to the next contract, 0 to 60."
          },
          "contractRoll": {
            "title": "Contract roll",
            "enum": [
              "expiration",
              "combined"
            ],
            "type": "string",
            "description": "Price history, Nearest types. Roll on expiration, or on combined volume and open interest."
          },
          "optionType": {
            "title": "Option type",
            "enum": [
              "Call",
              "Put"
            ],
            "type": "string",
            "description": "Futures options. Calls or puts only. Empty reads both."
          },
          "expirationMonth": {
            "title": "Option expiration month",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Futures options. Only options expiring in this month, 1 to 12."
          },
          "expirationDay": {
            "title": "Option expiration day",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Futures options. Only options expiring on this day of the month."
          },
          "zipCode": {
            "title": "ZIP code",
            "type": "string",
            "description": "Grain cash bids. A US ZIP code or Canadian postal code; bids come from the closest buying locations."
          },
          "latitude": {
            "title": "Latitude",
            "type": "string",
            "description": "Grain cash bids. The center of the area, with the longitude, instead of a ZIP code."
          },
          "longitude": {
            "title": "Longitude",
            "type": "string",
            "description": "Grain cash bids. The center of the area, with the latitude."
          },
          "maxDistance": {
            "title": "Maximum distance (miles)",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Grain cash bids. How far from the ZIP code or point, up to 250 miles. The provider default is 100."
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "Grain cash bids. A county name and state code joined by a hyphen, such as BOONE COUNTY-IA."
          },
          "fipsCode": {
            "title": "County FIPS code",
            "type": "string",
            "description": "Grain cash bids. The state and county FIPS codes together, such as 17053."
          },
          "locationIds": {
            "title": "Location ids",
            "type": "array",
            "description": "Grain cash bids. Numeric grain buying location ids, up to 100. When set, the ZIP code, point, distance, county and number of locations are left off, as the provider requires.",
            "items": {
              "type": "string"
            }
          },
          "commodityNames": {
            "title": "Commodities",
            "type": "array",
            "description": "Grain cash bids. Only these commodities, by standard name, such as Soybeans or Corn (#2 Yellow).",
            "items": {
              "type": "string"
            }
          },
          "totalLocations": {
            "title": "Number of locations",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Grain cash bids. How many buying locations to return. The provider default is 30."
          },
          "bidsPerCommodity": {
            "title": "Bids per commodity",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Grain cash bids. The most bids per commodity at each location. The provider default is 2."
          },
          "allBids": {
            "title": "All bids",
            "type": "boolean",
            "description": "Grain cash bids. Return every cash bid at each location."
          },
          "deliveryStart": {
            "title": "Delivery from",
            "type": "string",
            "description": "Grain cash bids. Only bids for delivery starting on or after this date, as YYYY-MM-DD."
          },
          "deliveryEnd": {
            "title": "Delivery until",
            "type": "string",
            "description": "Grain cash bids. Only bids for delivery ending on or before this date, as YYYY-MM-DD."
          },
          "usdaCommodityTypes": {
            "title": "USDA commodity types",
            "type": "array",
            "description": "USDA grain prices. Only these commodities. Empty reads all.",
            "items": {
              "type": "string",
              "enum": [
                "C",
                "CCO",
                "CSO",
                "WDN",
                "HRW",
                "HRW11",
                "O",
                "HRWORD",
                "SM",
                "S",
                "SRW",
                "SWW"
              ],
              "enumTitles": [
                "Corn",
                "Corn crude oil",
                "Crude soybean oil",
                "DNS/NS wheat 14%",
                "HRW wheat",
                "HRW wheat 11.5%",
                "Oats",
                "Ordinary HRW wheat",
                "Soybean meal 48%",
                "Soybeans",
                "SRW wheat",
                "SWW wheat"
              ]
            }
          },
          "usdaBidTypes": {
            "title": "USDA bid types",
            "type": "array",
            "description": "USDA grain prices. Only these bid types. Empty reads all.",
            "items": {
              "type": "string",
              "enum": [
                "E",
                "P",
                "R",
                "T",
                "B"
              ],
              "enumTitles": [
                "Export",
                "Processor",
                "River",
                "Terminal",
                "Barge loading"
              ]
            }
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for, across all symbols and requests. Price history asks the provider for no more records than are left.",
            "default": 500
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Pacing. Barchart OnDemand query limits depend on your subscription; the actor also waits and retries when the provider answers 429.",
            "default": 60
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own Barchart OnDemand API key, issued by Barchart with your OnDemand subscription. Stored as a secret and sent in the request body, never in a URL. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}