Futures, Commodities & Indices

Futures Data API

Real-time and historical futures data in one API

Stream real-time futures prices over WebSocket and pull up to 3 years of 1-minute history over REST. Follow a continuous contract for long backtests, or a single month when the expiry matters.

  • Exchange futures, spot prices and CFDs data
  • Best 1-level order book
  • 1-minute candles with up to 3 years of history
Data Coverage

Comprehensive Futures Coverage

Explore futures across major global markets and asset classes. Access market data through a unified interface with consistent fields and WebSocket delivery.

CATEGORYTYPESYMBOL QTYEXAMPLES
Equity Index FuturesFutures64ES · NQ · YM · RTY · HSI · NKD · FDAX
Energy FuturesFutures12CL · BZ · NG · HO · TTF
Global IndicesCFDINDEX35US500 · NAS100 · GER40 · JPN225 · HSII
Metals FuturesFutures18GC · SI · HG · PA · ALI
Agriculture & LivestockFutures29ZC · ZS · ZW · LE · HE
Interest Rate FuturesFutures26ZT · ZF · TN · ZB · SR3
FX FuturesFutures406E · 6J · 6B · 6A · CNH
Spot & CFD MetalsSpotCFD17XAUUSD · XAGUSD · XPTUSD · XCUUSD
Crypto FuturesFutures25BTC · ETH · SOL · XRP
Commodity IndexFutures3AW · GD · ECF
China Commodity FuturesFutures41AU · CU · RB · RU · TA · CF
Spot & CFD EnergySpotCFD4WTI · USOIL · UKOIL · NGAS

Symbol counts as of October 2026. We add new symbols regularly, so the API's symbol list is always the source of truth.

API Playground

Try Live Data for Popular Contracts

Open any symbol in the API Playground and test real-time data instantly.

XAUUSD
Gold / USD
-USD
-
Test in API Playground
XAGUSD
Silver / USD
-USD
-
Test in API Playground
XCUUSD
Copper / USD
-USD
-
Test in API Playground
NGAS
Natural Gas
-USD
-
Test in API Playground
Backtests That Don't Break at Every Roll

Continuous & Single-Month Contracts

Backtest on one unbroken series, or drill into a specific expiry. No manual stitching of contract months.

Continuous contracts

One symbol per product that always points to the active contract. Ideal for long backtests, charts and signals that should not break at every roll.

Single-month contracts

Query a specific expiry, such as December crude oil, for calendar spreads, roll analysis and expiry-aware strategies.

Get Free API Key
Market Data Endpoints

Real-Time Futures Data, and the History Behind It

Stream live trades, candles and order books over WebSocket, or pull snapshots and futures historical data over REST. The same request works for futures, spot and CFD products.

Infoway Real-time Futures API
POSThttps://data.infoway.io/common/v2/batch_kline
import requests

api_url = "https://data.infoway.io/common/v2/batch_kline"

headers = {
    "User-Agent": "Mozilla/5.0",
    "Accept": "application/json",
    "Content-Type": "application/json",
    "apiKey": "yourApikey",
}

payload = {
    "klineType": 1,
    "klineNum": 10,
    "codes": "CL,GC,NG"
}

response = requests.post(api_url, headers=headers, json=payload)
print(f"HTTP code: {response.status_code}")
print(f"message: {response.text}")
Why Infoway

Everything You Need In a Futures Data API

Real-time & Historical

Stream live prices, then backtest on up to 3 years of 1-minute candles from the same API.

WebSocket Streaming

Trades, candles and order books pushed over one connection. No polling.

Futures, Spot & CFD

Three product types, each clearly labeled, all in one schema.

Continuous & Single Contracts

Unbroken series for backtests, plus single months when the expiry matters.

1-Level Order Book

Best bid and ask only, on every futures product.

7-Day Free Trial

Full access to real-time quotes and history for 7 days, no credit card required.

Get Free API Key

Build with Infoway API

Power your financial products, strategies, research, and workflows.

QUANT TRADING

Backtest Across Contract Rolls

Run strategies on continuous 1-minute series without stitching expiries yourself, then switch to single months for spread trades.

import time

import pandas as pd
import requests

URL = "https://data.infoway.io/common/v2/batch_kline"  # futures, spot and CFD
HEADERS = {"apiKey": "YOUR_API_KEY"}


def fetch_continuous(symbol, pages=10):
    """1-minute candles for a continuous contract, 500 per request.
    The series already rolls from month to month, so there is nothing to stitch."""
    rows, ts = [], None
    for _ in range(pages):
        body = {"klineType": 1, "klineNum": 500, "codes": symbol}
        if ts:
            body["timestamp"] = ts
        resp = requests.post(URL, headers=HEADERS, json=body, timeout=10).json()
        if resp.get("ret") != 200 or not resp.get("data"):
            break  # e.g. the request reaches past your plan's history
        batch = resp["data"][0]["respList"]  # newest first
        if not batch:
            break
        rows += batch
        ts = int(batch[-1]["t"]) - 60  # continue before the oldest candle
        time.sleep(1)  # stay within your plan's rate limit
    df = pd.DataFrame(rows).drop_duplicates("t")
    df["t"] = pd.to_datetime(df["t"].astype(int), unit="s")
    return df.set_index("t").sort_index()[["o", "h", "l", "c", "v"]].astype(float)


bars = fetch_continuous("CL")  # WTI crude oil, continuous contract
bars_15m = bars.resample("15min").agg(
    {"o": "first", "h": "max", "l": "min", "c": "last", "v": "sum"}
).dropna()  # skips the daily break and weekends

# Breakout: long above the 20-bar high, short below the 20-bar low
upper = bars_15m["h"].rolling(20).max().shift(1)
lower = bars_15m["l"].rolling(20).min().shift(1)
signal = pd.Series(float("nan"), index=bars_15m.index)
signal[bars_15m["c"] > upper] = 1
signal[bars_15m["c"] < lower] = -1
position = signal.ffill().fillna(0).shift(1).fillna(0)
returns = bars_15m["c"].pct_change().fillna(0)

print(f"{len(bars):,} one-minute bars, {bars.index[0]:%Y-%m-%d} to {bars.index[-1]:%Y-%m-%d}")
print(f"Buy & hold: {(1 + returns).prod() - 1:.2%}")
print(f"Breakout:   {(1 + position * returns).prod() - 1:.2%}")
TRADING & CFD PLATFORM

One Feed for Futures, Spot and CFDs

Power quote boards, charts and order tickets for index, commodity and metals products from a single WebSocket connection.

import asyncio
import json
import uuid

import websockets

WS_URL = "wss://data.infoway.io/ws?business=common&apikey=YOUR_API_KEY"

# Futures, spot and CFD symbols share one connection and one message format
BOARD = {
    "GC": "Futures",       # gold futures, continuous (USD/oz)
    "XAUUSD": "Spot",      # spot gold (USD/oz)
    "HG": "Futures",       # copper futures, continuous (USD/lb)
    "XCUUSD": "CFD",       # copper CFD (USD/lb)
    "XCUUSD_S": "Spot",    # spot copper (USD/t)
}
last = {}


def frame(code, data=None):
    msg = {"code": code, "trace": uuid.uuid4().hex}
    if data is not None:
        msg["data"] = data
    return json.dumps(msg)


async def heartbeat(ws):
    while True:
        await asyncio.sleep(30)
        await ws.send(frame(10010))


def on_trade(symbol, price):
    last[symbol] = price
    line = f"{symbol:<9} {BOARD[symbol]:<8} {price:>12,.4f}"
    if "GC" in last and "XAUUSD" in last:
        line += f"   gold futures vs spot: {last['GC'] - last['XAUUSD']:+.2f}"
    print(line)


async def quote_board():
    while True:
        try:
            async with websockets.connect(WS_URL) as ws:
                await ws.send(frame(10000, {"codes": ",".join(BOARD)}))
                hb = asyncio.create_task(heartbeat(ws))
                try:
                    async for raw in ws:
                        msg = json.loads(raw)
                        if msg.get("code") == 10002:  # trade push
                            data = msg["data"]
                            on_trade(data["s"], float(data["p"]))
                finally:
                    hb.cancel()
        except (websockets.ConnectionClosed, OSError):
            await asyncio.sleep(5)  # back off before reconnecting


asyncio.run(quote_board())
AI & LLM AGENTS

Feed Your AI with High Quality Market Data

Give LLMs and trading agents structured, real-time prices, fundamentals and news through our API or MCP server.

Get Started

Access Market Data Your Way

Infoway Official SDK

Access Infoway market data directly from your code with developer-friendly SDKs built for seamless integration.

Google Sheets Add-on

Bring market data directly into Google Sheets to analyze, track, and work with financial data without writing code.

Install Now

FAQ

If you need any help, please feel free to contact our support team.

Get Started. For Free!

Get instant access to Infoway's market data APIs with a free trial. Simply sign up with your email and get your API key.

Get Free API Key No Credit Card Required