Real-time & Historical Stock Data

Stock Market Data API

Real-time Global Stock Data in One API

Stream live quotes, OHLCV and order book depth for global stock markets. Real-time, not delayed. REST and WebSocket, ready for quant, strategies, trading platforms and AI agents.

  • Real-time & Historical Data Included
  • WebSocket streaming with millisecond latency
  • Free plan, no credit card required
Data Coverage

One API,Global Stock Market Coverage

Access real-time and historical stock market data across major markets worldwide

US Stock API

Real-time and historical data for US-listed stocks and ETFs.

Symbols
15,000+
Exchange
NASDAQ
View US Stock API Docs

China A-Share API

Real-time quotes and Level 2 depth from the Shanghai and Shenzhen exchanges.

Symbols
5,600+
Exchange
SZSE, SSE
View China A-Share API Docs

Japan Stock API

Real-time and historical data for Tokyo Stock Exchange listed stocks.

Symbols
4,000+
Exchange
TSE
View Japan Stock API Docs

Korea Stock API

Real-time and historical data for KOSPI and KOSDAQ listed stocks.

Symbols
2,800+
Exchange
KRX
View Korea Stock API Docs

India Stock API

Real-time and historical data from NSE, BSE, and major Indian listed stocks.

Symbols
5,600+
Exchange
NSE, BSE
View Indian Stock API Docs

Taiwan Stock API

Real-time and historical data from TWSE, TPEX, and listed Taiwanese stocks.

Symbols
2,300+
Exchange
TWSE, TPEX
View Taiwan Stock API Docs

MORE MARKET
COMING SOON

Start Your Free Trial

Instant access. No credit card required.

Market Data Endpoints

Real-Time & Historical Stock Data

Get quotes, candles, trades and order book depth through simple REST endpoints or a single WebSocket stream.

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

api_url = 'https://data.infoway.io/stock/v2/batch_kline'

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

payload = {
    'klineType': 1,
    'klineNum': 10,
    'codes': '002594.SZ,00285.HK,TSLA.US',
}

response = requests.post(api_url, headers=headers, json=payload)

print(f"HTTP code: {response.status_code}")
print(f"message: {response.text}")
{
  "ret": 200,
  "msg": "success",
  "traceId": "demo",
  "data": [
    {
      "symbol": "AAPL.US",
      "periodType": "fq",
      "periodDate": "2026-03-31",
      "itemId": "unusual_expense_inc",
      "itemName": "Unusual income/expense",
      "itemGroup": "",
      "itemValue": 0,
      "ttm": null,
      "parentItemId": "total_non_oper_income"
    },
    {
      "symbol": "AAPL.US",
      "periodType": "fq",
      "periodDate": "2026-03-31",
      "itemId": "total_revenue",
      "itemName": "Total revenue",
      "itemGroup": "",
      "itemValue": 54032000000,
      "ttm": 210000000000,
      "parentItemId": ""
    }
  ]
}
Financial Statements API

Structured Financial Statement Data

Access standardized financial statement data through a simple API.

Quarterly and annual statements
Same schema across all supported markets
Company Profile API

Build Beautiful Ticker Profiles with Rich Data

Build rich and engaging stock experiences with structured data designed for modern financial applications.

  • Company name
  • Logo
  • Founded year
  • Website
  • Headquarters
  • Industry
  • Sector
  • Market capitalization
  • Total shares
  • BPS
  • EPS
  • P/E ratio

And many more...

Get Free API Key
API Playground

Try Live Data for Popular Stocks

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

AAPL.US
Apple
-USD
-
Test in API Playground
01810.HK
Xiaomi
-HKD
-
Test in API Playground
002352.SZ
SF Holding
-CNY
-
Test in API Playground
7203.JP
Toyota
-JPY
-
Test in API Playground
INFY.IN
Infosys
-INR
-
Test in API Playground
005930.KS
Samsung
-KRW
-
Test in API Playground
2330.TW
TSMC
-TWD
-
Test in API Playground
Why Infoway

The Best Stock Market Data API For Global Markets

Many stock APIs cover a single country, or serve international markets on a delay. Infoway streams every market we cover in real time, through one API.

Real Time Update

Stream stocks from major exchanges around the world in real time, with one API key, one symbol format and one response schema.

<80 ms Latency

Subscribe once over WebSocket and receive every trade and order book update as it happens. No polling loops, no rate-limit guesswork.

Level 1 & Level 2

Get best bid and ask on every market, and full Level 2 order book depth where the exchange provides it. Build depth charts, execution tools and spread monitors on the same feed.

Backtest on 1-Minute Candles

Pull historical OHLCV from 1-minute to monthly bars, with up to 3 years of history depending on plan. Backtest intraday strategies with the same symbols and format you use live.

Multiple Asset Class

The same API and plan also cover forex, crypto and commodity futures, with the same schema and WebSocket stream. Add a currency pair or a gold contract next to your stocks without a second vendor.

7-Day Free Trial

Get real-time quotes, trades and depth across our markets for 7 days, no credit card required. Pick a plan once you have seen the data in your own app.

Get Free API Key

Build with Infoway API

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

QUANT & ALGO TRADING

Backtest Trading Strategies

Pull a year of daily bars, compute moving averages and test a golden-cross rule in a few lines of Python.

import pandas as pd
import requests

URL = "https://data.infoway.io/stock/v2/batch_kline"
HEADERS = {"apiKey": "YOUR_API_KEY"}

payload = {"klineType": 8, "klineNum": 270, "codes": "AAPL.US"}  # 270 daily candles
resp = requests.post(URL, headers=HEADERS, json=payload, timeout=10).json()
bars = resp["data"][0]["respList"]  # newest first

df = pd.DataFrame(bars)
df["t"] = pd.to_datetime(df["t"].astype(int), unit="s")
df = df.set_index("t").sort_index()  # oldest first, so averages look back in time
df["c"] = df["c"].astype(float)
df["sma20"] = df["c"].rolling(20).mean()
df["sma50"] = df["c"].rolling(50).mean()

above = df["sma20"] > df["sma50"]
golden_cross = above & ~above.shift(1, fill_value=True)  # 20-day crosses above 50-day
print("Golden crosses:", list(df.index[golden_cross].date))
print("20-day above 50-day now:", bool(above.iloc[-1]))
TRADING PLATFORMS

Power a Live Ticker Tape

Subscribe once over WebSocket and push every tick straight into your quote grid or order ticket. No polling.

import asyncio
import json
import uuid

import requests
import websockets

API_KEY = "YOUR_API_KEY"
REST_URL = "https://data.infoway.io/stock/v2/batch_kline"
WS_URL = f"wss://data.infoway.io/ws?business=stock&apikey={API_KEY}"
SYMBOLS = "AAPL.US,MSFT.US,NVDA.US"


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


def update_price_row(symbol, price, change, change_pct):
    print(f"{symbol:<8} {price:>10.2f} {change:>+8.2f}  {change_pct}")  # push into your quote grid


def load_snapshot():
    """Show the latest price right away, even when the market is closed."""
    body = {"klineType": 8, "klineNum": 1, "codes": SYMBOLS}
    resp = requests.post(REST_URL, headers={"apiKey": API_KEY}, json=body, timeout=10).json()
    for item in resp["data"]:
        bar = item["respList"][0]
        update_price_row(item["s"], float(bar["c"]), float(bar["pca"]), bar["pc"])


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


async def ticker_tape():
    while True:
        try:
            load_snapshot()
            async with websockets.connect(WS_URL) as ws:
                # daily candles carry the last price and the change vs the previous close
                await ws.send(frame(10006, {"arr": [{"type": 8, "codes": SYMBOLS}]}))
                hb = asyncio.create_task(heartbeat(ws))
                try:
                    async for raw in ws:
                        try:
                            msg = json.loads(raw)
                        except ValueError:
                            continue  # skip plain-text notices from the server
                        if msg.get("code") == 10008:  # candle push
                            d = msg["data"]
                            update_price_row(d["s"], float(d["c"]), float(d["pca"]), d["pfr"])
                finally:
                    hb.cancel()
        except (websockets.ConnectionClosed, OSError, requests.RequestException):
            await asyncio.sleep(5)  # back off before reconnecting


asyncio.run(ticker_tape())
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