Korea Stocks API Integration Guide: KRX Real-Time Quotes & Historical Data Access

The Korea Exchange (KRX) ranks among the world's most dynamic equity markets. Its two primary boards — KOSPI (main board) and KOSDAQ (growth & tech-focused) — host globally significant companies such as Samsung Electronics, SK hynix, Hyundai Motor, and LG Energy Solution. Fueled by the global rise of K-culture, semiconductors, electric vehicles, and battery supply chains, the Korean equity market has become a key focus for quantitative traders and cross-border institutional investors.
This guide provides a step-by-step walkthrough on how to access the Korean equity market through the iTick API, covering real-time Level-1 quotes, historical candlestick data, and tick-level trades — complete with production-ready Python code examples to help you rapidly build a robust Korea equity data pipeline.
Why Choose iTick for KRX Market Access?
- Full Coverage — All KOSPI and KOSDAQ listed securities
- Ultra-Low Latency — WebSocket streaming with <50 ms delivery
- Flexible Protocols — REST + WebSocket + FIX
- Generous Free Tier — Unlimited calls for core real-time quotes
1. Quick Start
1.1 Register & Obtain API Token
Visit the iTick official website to register (≈30 seconds, no credit card required). Your personal API Token is available immediately in the developer console.
1.2 Install Dependencies
pip install requests websocket-client pandas
2. Core Functionality Implementation
2.1 Real-Time Quotes (REST API)
Fetch the latest quote for Samsung Electronics (005930):
import requests
API_TOKEN = "your_token_here" # ← replace with your actual token
BASE_URL = "https://api.itick.org"
def get_quote(symbol):
url = f"{BASE_URL}/stock/quote"
params = {"region": "KR", "code": symbol}
headers = {"token": API_TOKEN}
resp = requests.get(url, params=params, headers=headers).json()
if resp.get("code") == 0:
data = resp["data"]
print(f"{data['n']} ({data['s']})")
print(f"Last Price: {data['ld']} KRW | Change: {data['chp']}%")
else:
print("Error:", resp.get("msg"))
get_quote("005930") # Samsung Electronics
2.2 Historical OHLCV Bars (REST API)
Retrieve daily bars — ideal for backtesting:
def get_kline(symbol, ktype=8, limit=100):
url = f"{BASE_URL}/stock/kline"
params = {
"region": "KR",
"code": symbol,
"kType": ktype,
"limit": limit
}
headers = {"token": API_TOKEN}
resp = requests.get(url, params=params, headers=headers).json()
if resp.get("code") == 0:
# Print the most recent 5 bars
for item in resp["data"][-5:]:
print(f"Date: {item['t']} O:{item['o']} H:{item['h']} L:{item['l']} C:{item['c']} Vol:{item['v']}")
else:
print("Error:", resp.get("msg"))
get_kline("005930", limit=10) # Last 10 trading days
2.3 Low-Latency Real-Time Streaming (WebSocket)
Subscribe to live quote updates for Samsung Electronics and SK hynix:
import websocket
import json
import threading
import time
WS_URL = "wss://api.itick.org/stock"
API_TOKEN = "your_token_here" # ← replace
def on_message(ws, message):
data = json.loads(message)
if "data" in data:
md = data["data"]
if md["type"] == "quote":
print(f"{md['s']} Last: {md['ld']} KRW Chg: {md['chp']}%")
def on_open(ws):
subscribe_msg = {
"ac": "subscribe",
"params": "005930$KR,000660$KR", # Samsung + SK hynix
"types": "quote"
}
ws.send(json.dumps(subscribe_msg))
def send_ping(ws):
while True:
time.sleep(30)
ws.send(json.dumps({
"ac": "ping",
"params": str(int(time.time()*1000))
}))
ws = websocket.WebSocketApp(
WS_URL,
header={"token": API_TOKEN},
on_open=on_open,
on_message=on_message
)
threading.Thread(target=send_ping, args=(ws,), daemon=True).start()
ws.run_forever()
3. Korea Market Quick Reference
Ticker Format
- KRX uses 6-digit numeric codes (e.g. Samsung Electronics =
005930) - REST:
region=KR,code=005930 - WebSocket subscription:
005930$KR
Major Constituents Reference
| Company | Ticker | Sector |
|---|---|---|
| Samsung Electronics | 005930 | Semiconductors |
| SK hynix | 000660 | Semiconductors |
| Hyundai Motor | 005380 | Automobiles |
| LG Energy Solution | 373220 | Batteries |
| NAVER | 035420 | Internet / Tech |
KRX Regular Trading Hours (Korea Standard Time – KST)
- Continuous trading: 09:00 – 15:30 (no lunch break)
- Corresponding Beijing / Hong Kong time: 08:00 – 14:30
(Note: As of early 2026, KRX has announced plans to extend trading hours significantly in phases, potentially reaching 12 hours by mid-2026 and aiming for near-24-hour coverage by 2027. The above reflects standard regular-session hours.)
4. Summary
With the examples above, you can quickly integrate high-quality Korean equity data into your workflows. Key advantages of iTick for KRX coverage include:
- Reliable, low-latency data feed
- Developer-friendly API design
- Free tier sufficient for individuals, researchers, and early-stage teams
Further Reading: