Real-time & Historical

Forex Data API

Real-time Bid/Ask Quotes & Candles for Global Forex

Stream every price change over WebSocket, or query quotes and 1-minute history over REST. Built for trading platforms and quant teams.

  • Major currency pairs in one symbol format
  • Tick-by-tick streaming during all trading sessions, 24/5
  • 1-minute candles with up to 3 years of history
API Playground

Global Forex Data, In One API

Every pair includes real-time quotes and historical candles. Pick a pair to view live data.

EURUSD
Euro / US Dollar
-USD
-
Test Live
CHFUSD
Swiss Franc / US Dollar
-USD
-
Test Live
GBPUSD
British Pound / US Dollar
-USD
-
Test Live
CNYUSD
Chinese Yuan / US Dollar
-USD
-
Test Live
24/5 Coverage

Live Through Every Trading Session

Forex never closes on weekdays. Infoway streams quotes continuously from the Sydney open on Monday to the New York close on Friday.

Approximate hours in UTC; they shift with daylight saving. London–New York overlap (12:00–16:00 UTC) is the most liquid window.

Market Data Endpoints

Real-Time & Historical Forex Data

Query quotes and history over REST, or stream every update over WebSocket. Same symbols and response format for all pairs.

Infoway Real-time Forex 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": "EURUSD,GBPUSD,USDJPY"
}

response = requests.post(api_url, headers=headers, json=payload)
print(f"HTTP code: {response.status_code}")
print(f"message: {response.text}")
Built for Market Volatility

High-Frequency Forex Data That Stays Stable Under Pressure

Stream real-time forex quotes with stable WebSocket connections, even when market activity spikes.

Forex Ticks Around NFP Release

Quote update activity across five major currency pairs before and after the U.S. Nonfarm Payrolls release.

  • 62,839Quote updates delivered during the 30 minutes before and after the NFP release
  • ~60msAverage latency. Fast, real-time WebSocket delivery
  • +60%Quote update volume surged after the NFP release, with stable WebSocket delivery throughout.

During the NFP release, quote update volume across five major currency pairs surged by 60%. Infoway Forex Websocket API remained stable throughout, delivering 62,839 quote updates with an average latency of approximately 60 ms.

Why Infoway

The Best Forex API Built for Real-Time Trading

One Schema For Every Pairs

Majors, crosses and Asian currencies share one symbol format and one response shape.

Stream Every Tick

Subscribe once over WebSocket and receive every quote change as it happens.

No Gaps Between Sessions

Continuous data from the Sydney open to the New York close.

Backtest on 1-Minute Candles

Historical OHLCV from 1-minute to monthly bars, in the same format you use live.

Multiple Asset Class

The same plan covers stocks, crypto and commodity futures. Add them without a second vendor.

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.

CFD PLATFORMS

A Live FX Price Feed for Your Platform

Push bid/ask quotes straight into quote boards, order tickets and charts over one WebSocket connection.

import asyncio
import json
import uuid

import websockets

WS_URL = "wss://data.infoway.io/ws?business=common&apikey=YOUR_API_KEY"
PAIRS = "EURUSD,GBPUSD,USDJPY"


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))


async def price_feed(on_quote, on_trade):
    while True:
        try:
            async with websockets.connect(WS_URL) as ws:
                await ws.send(frame(10003, {"codes": PAIRS}))  # best bid / ask
                await ws.send(frame(10000, {"codes": PAIRS}))  # every price change
                hb = asyncio.create_task(heartbeat(ws))
                try:
                    async for raw in ws:
                        msg = json.loads(raw)
                        data = msg.get("data")
                        if msg.get("code") == 10005:
                            on_quote(data["s"], bid=data["b"][0][0], ask=data["a"][0][0], ts=data["t"])
                        elif msg.get("code") == 10002:
                            on_trade(data["s"], price=data["p"], ts=data["t"])
                finally:
                    hb.cancel()
        except (websockets.ConnectionClosed, OSError):
            await asyncio.sleep(5)  # back off before reconnecting


def show_quote(symbol, bid, ask, ts):
    print(f"{symbol}  bid {bid}  ask {ask}")


def show_trade(symbol, price, ts):
    print(f"{symbol}  last {price}")


asyncio.run(price_feed(show_quote, show_trade))
QUANT TRADING

Backtest FX Strategies on 1-Minute Data

Pull up to 3 years of 1-minute candles and test mean-reversion or breakout rules in Python.

import time

import pandas as pd
import requests

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


def fetch_1m(symbol, pages=10):
    """Page backwards through 1-minute candles, 500 per request."""
    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. 513: timestamp is beyond 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"]].astype(float)


bars = fetch_1m("EURUSD")  # about 5,000 minutes

# Mean reversion: hold long while price is 2 std devs below its 60-minute mean
mean = bars["c"].rolling(60).mean()
std = bars["c"].rolling(60).std()
zscore = (bars["c"] - mean) / std
position = (zscore < -2).astype(int).shift(1).fillna(0)
returns = bars["c"].pct_change().fillna(0)

print(f"Buy & hold: {(1 + returns).prod() - 1:.4%}")
print(f"Strategy:   {(1 + position * returns).prod() - 1:.4%}")
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