2026 Vietnam Stock Exchange (VN30, HOSE) API Integration Guide

  1. iTick
  2. Tutorial
2026 Vietnam Stock Exchange (VN30, HOSE) API Integration Guide - iTick
2026 Vietnam Stock Exchange (VN30, HOSE) API Integration Guide

The Vietnam Stock Exchange (primarily the Ho Chi Minh City Stock Exchange, HOSE, with its core index VN30) has garnered significant attention in recent years. As a key component of emerging markets, HOSE and its VN30 constituent stocks have attracted numerous investors. To obtain stable real-time quotes, historical data, and order book information, selecting an appropriate API provider is crucial. This guide outlines a comparison of mainstream API service providers and provides Python integration examples to assist developers in efficiently accessing relevant data.

I. Core Overview

  • Core Components of Vietnam Stock Exchange: Primarily includes HOSE (Ho Chi Minh City) and HNX (Hanoi)
  • Real-Time Quotes API: Used to retrieve dynamic data such as latest prices and trading volumes
  • Historical Data API: Used for backtesting candlestick lines (minute/daily/weekly, etc.)
  • Order Book Data: Includes bid levels 1 to 5 and ask levels 1 to 5 with prices and order quantities, suitable for high-frequency trading scenarios

II. Comparison of Mainstream Vietnam HOSE (VN30) API Providers

Currently, the main API providers supporting the Vietnam HOSE market include the following three options, compared across key dimensions such as data coverage, stability, and cost:

1. iTick API

Core Advantages:

  • Global multi-market coverage with comprehensive support for Vietnam HOSE
  • Supports real-time quotes, historical quotes, and Level 2 order book data for VN30 constituent stocks
  • Supports both RESTful and WebSocket protocols
  • Free tier sufficient for daily testing, with high cost-effectiveness in paid versions

Technical Specifications:

  • Latency as low as 100ms, meeting non-ultra-high-frequency trading needs
  • Historical data coverage over 30 years, supporting minute-level to daily-level candlestick lines
  • API Token provided upon registration, no credit card required
  • Mature Python client library, low integration cost

2. RPDS DATA

Core Advantages:

  • Covers multiple emerging markets globally, including Vietnam HOSE, India, Malaysia, etc.
  • Strong data cleansing capabilities with low anomaly rates
  • Supports HTTP and WS protocols for full market data retrieval

Technical Specifications:

  • Excellent stability
  • Suitable for academic research or professional quantitative teams, priced by data volume

Limitations: Limited customized documentation for the Vietnam market; beginners may need more time for debugging

3. Bloomberg API

Core Advantages:

  • Benchmark in global financial data, with deep coverage of Vietnam HOSE market and VN30 constituent stocks
  • Data includes real-time quotes, deep order books, historical candlestick lines, and fundamental data
  • System availability up to 99.99%, backed by global distributed architecture for stability
  • Built-in comprehensive compliance and risk control modules, suitable for institutional regulatory needs

Technical Specifications:

  • Supports full data for VN30 constituent stocks, including Level 2 order books and tick-level historical data
  • Latency as low as milliseconds

Limitations: Not user-friendly for individual developers and small teams; no independent free tier, high annual fees for terminals and API services, and steep learning curve

III. Python Integration for HOSE (VN30) Technical Implementation

The following demonstrates integration with Vietnam HOSE using iTick API via Python.

Environment Configuration

Obtaining API Token

  • Visit iTick Official Website and complete registration
  • Locate the API Token in your personal center; this is the core credential for API calls

Installing Dependencies

Install requests (for REST API calls) and websocket-client (for real-time quote subscriptions):

      pip install requests websocket-client

    

Core API Call Examples

The following examples target VN30 constituent stocks on HOSE.

REST API for Real-Time Quotes of VN30 Constituent Stocks

This method is suitable for one-time retrieval of basic data such as latest price, percentage change, and trading volume:

      import requests

# Replace with your iTick API Token
ITICK_API_TOKEN = "YOUR_API_TOKEN"
# Target symbol: Vietnam HOSE market VN30 constituent stock - Vietnam Airlines (HVN)
symbol = "HVN"
# Real-time quote API endpoint
url = f"https://api.itick.org/stock/quote?region=VN&code={symbol}"

# Request headers (must include token)
headers = {
    "accept": "application/json",
    "token": ITICK_API_TOKEN
}

# Send request and handle response
response = requests.get(url, headers=headers)
if response.status_code == 200:
    data = response.json()
    # Parse core data (latest price, open price, percentage change, trading volume)
    stock_data = data.get("data", {})
    print(f"Symbol: {symbol}")
    print(f"Latest Price: {stock_data.get('ld')} VND")
    print(f"Open Price: {stock_data.get('o')} VND")
    print(f"Percentage Change: {stock_data.get('chp')}%")
    print(f"Current Volume: {stock_data.get('v')} shares")
else:
    print(f"Request failed, status code: {response.status_code}, error message: {response.json().get('message')}")

    

Retrieving Historical Quotes (Candlestick Data) for VN30 Constituent Stocks

This method is suitable for strategy backtesting, supporting various periods such as minute-level and daily-level (refer to iTick Official Documentation for other periods):

      import requests

ITICK_API_TOKEN = "YOUR_API_TOKEN"
symbol = "HVN"  # Vietnam Airlines
# Historical candlestick API (kType=8 for daily lines, limit=100 for 100 candlesticks)
url = f"https://api.itick.org/stock/kline?region=VN&code={symbol}&kType=8&limit=100"

headers = {
    "accept": "application/json",
    "token": ITICK_API_TOKEN
}

response = requests.get(url, headers=headers)
if response.status_code == 200:
    data = response.json()
    kline_list = data.get("data", [])
    print(f"Retrieved recent 100 daily candlesticks for {symbol}:")
    for kline in kline_list:
        # Parse candlestick data (timestamp, open, high, low, close, volume)
        print(f"Time: {kline.get('t')}, Open: {kline.get('o')}, High: {kline.get('h')}, Low: {kline.get('l')}, Close: {kline.get('c')}, Volume: {kline.get('v')}")
else:
    print(f"Request failed, status code: {response.status_code}, error message: {response.json().get('message')}")

    

WebSocket Subscription for Real-Time Order Book Data of VN30 Constituent Stocks

This method is suitable for scenarios requiring continuous monitoring of order book changes, enabling real-time retrieval of bid levels 1 to 5 and ask levels 1 to 5 with prices and order quantities:

      import websocket
import json

ITICK_API_TOKEN = "YOUR_API_TOKEN"
symbol = "VN$HVN"  # Vietnam Airlines

def on_open(ws):
    # Send subscription request after successful connection
    subscribe_msg = {
        "ac": "subscribe",
        "params": symbol,
        "types": "depth"  # Order book data
    }
    ws.send(json.dumps(subscribe_msg))
    print("WebSocket connection successful, subscribed to order book data...")

def on_message(ws, message):
    # Receive and parse real-time order book data
    data = json.loads(message)
    if data.get("type") == "depth":
        depth_data = data.get("data", {})
        buy_depth = depth_data.get("b", [])  # Bid data (bid 1 to 5)
        sell_depth = depth_data.get("a", [])  # Ask data (ask 1 to 5)
        print(f"\n{symbol} Real-Time Order Book ({depth_data.get('t')}):")
        print("Asks:", [(f"Ask {i+1}", f"{item.get('p')} VND", f"{item.get('v')} shares") for i, item in enumerate(sell_depth[:5])])
        print("Bids:", [(f"Bid {i+1}", f"{item.get('p')} VND", f"{item.get('v')} shares") for i, item in enumerate(buy_depth[:5])])

def on_error(ws, error):
    print(f"Connection error: {error}")

def on_close(ws, close_status_code, close_msg):
    print(f"Connection closed, status code: {close_status_code}, message: {close_msg}")

# Establish WebSocket connection
ws_url = "wss://api.itick.org/stock"
ws = websocket.WebSocketApp(ws_url,
                            on_open=on_open,
                            on_message=on_message,
                            on_error=on_error,
                            on_close=on_close)
# Run connection continuously
ws.run_forever()

    

IV. Important Reminders

  1. Subscription Limits: Free plans have subscription caps; for multiple symbols, consider upgrading to a paid tier
  2. Security Requirements: Do not disclose your API Token to others; leakage will prevent API access
  3. Rate Limiting: Avoid frequent API calls on free plans to prevent triggering rate limits

V. Summary

For developers planning to enter the Vietnam stock market quantitative field, iTick API is an ideal solution. It not only provides comprehensive data for the Vietnam Stock Exchange (HOSE) and VN30 Index but also offers the following significant advantages:

  • Comprehensive Data Coverage: Supports real-time quotes, historical quotes, and Level 2 order book data, meeting various quantitative analysis needs
  • Outstanding Performance: Latency as low as 100ms, with historical data coverage over 30 years
  • Flexible Integration Methods: Supports RESTful and WebSocket protocols, adapting to different application scenarios
  • User-Friendly Pricing: Free tier suitable for daily testing, with high cost-effectiveness in paid versions for commercial applications

Through the Python example code provided in this article, developers can quickly integrate iTick API, easily retrieve real-time and historical data from the Vietnam stock market, laying a solid foundation for quantitative strategy development and data analysis. As the Vietnam capital market continues to develop, iTick API will persist in providing stable and reliable data services to developers, supporting the successful implementation of quantitative trading.

Official Documentation: https://docs.itick.org
GitHub: https://github.com/itick-org