Quick Start
Make your first API call with curl, JavaScript, Python
Step 1: Get an Access Token
All APIs require a Bearer token. First, call the authentication endpoint:
Endpoint
POST /api/v3/auth/tokenWith cURL
curl -X POST "https://api.ssi.com.vn/api/v3/auth/token" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "your_api_key_here",
"apiSecret": "your_api_secret_here"
}'Response
{
"tokenType": "Bearer",
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJl...",
"expiresAt": 1779806203,
"refreshExpiresAt": 1779892603
}Save the accessToken for subsequent API calls. When the token expires, use the refreshToken to get a new one via POST /api/v3/auth/refresh.
To execute trades, you must include the
otpfield in the request body. Tokens without OTP only have Market Data access.
Step 2: Get Securities List
Endpoint
GET /api/v3/data/securitiesByBoardWith cURL
curl -X GET "https://api.ssi.com.vn/api/v3/data/securitiesByBoard?board=HOSE" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Response
[
{
"symbol": "SSI",
"symboNameVi": "CTCP Chứng khoán SSI",
"symbolNameEn": "SSI Securities Corporation",
"board": "HOSE",
"lotSize": "100",
"firstTradingDate": "2000-12-28",
"icbCode": "8771",
"icbName": "Financial Services"
},
{
"symbol": "VNM",
"symboNameVi": "CTCP Sữa Việt Nam",
"symbolNameEn": "Vietnam Dairy Products JSC",
"board": "HOSE",
"lotSize": "100",
"firstTradingDate": "2006-01-19",
"icbCode": "3577",
"icbName": "Food Products"
}
]Step 3: Get Trading Summary for a Security
Endpoint
GET /api/v3/data/securitiesSummaryWith JavaScript/TypeScript
const ACCESS_TOKEN = "YOUR_ACCESS_TOKEN";
async function getSecuritiesSummary(symbol, fromDate, toDate) {
const params = new URLSearchParams({
symbol,
from: fromDate,
to: toDate,
pageNumber: "1",
pageSize: "1",
});
const response = await fetch(
`https://api.ssi.com.vn/api/v3/data/securitiesSummary?${params}`,
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${ACCESS_TOKEN}`,
},
}
);
return await response.json();
}
const result = await getSecuritiesSummary("SSI", "2026-05-20", "2026-05-20");
const item = result.data[0];
console.log(`${item.symbol}: ${item.close} (${item.priceChangePercentage}%)`);Output:
SSI: 45.50 (+2.25%)With Python
import requests
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
def get_securities_summary(symbol, from_date, to_date):
url = "https://api.ssi.com.vn/api/v3/data/securitiesSummary"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {ACCESS_TOKEN}"
}
params = {
"symbol": symbol,
"from": from_date,
"to": to_date,
"pageNumber": "1",
"pageSize": "1"
}
response = requests.get(url, headers=headers, params=params)
return response.json()
result = get_securities_summary("SSI", "2026-05-20", "2026-05-20")
item = result["data"][0]
print(f"{item['symbol']}: {item['close']} ({item['priceChangePercentage']}%)")Response
{
"pageSize": 1,
"pageNumber": 1,
"itemsCount": 1,
"pageCount": 1,
"data": [
{
"symbol": "SSI",
"tradingDate": "2026-05-20",
"priceChange": "1.00",
"priceChangePercentage": "2.25",
"open": "44.50",
"high": "46.00",
"low": "44.20",
"close": "45.50",
"totalMatch": "1250000",
"totalMatchValue": "56875000000",
"totalBuy": "620000",
"totalTradeBuy": "28210000000",
"totalSell": "630000",
"totalTradeSell": "28665000000"
}
]
}Step 4: Get OHLCV Candlestick Data
Endpoint
GET /api/v3/data/ohlcWith cURL
curl -X GET "https://api.ssi.com.vn/api/v3/data/ohlc?symbol=SSI&from=2026-01-01&to=2026-05-20&timeFrame=1d&pageIndex=1&pageSize=5" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Response
{
"pageSize": 5,
"pageNumber": 1,
"itemsCount": 98,
"pageCount": 20,
"data": [
{
"symbol": "SSI",
"tradingDate": "2026-01-02",
"open": "42.00",
"high": "43.50",
"low": "41.80",
"close": "43.20",
"volume": "980000",
"value": "41860000000"
},
{
"symbol": "SSI",
"tradingDate": "2026-01-03",
"open": "43.20",
"high": "44.00",
"low": "42.90",
"close": "43.75",
"volume": "1120000",
"value": "49000000000"
}
]
}The timeFrame parameter supports: 1m, 3m, 5m, 15m, 30m, 1h, 1d (default 1d). Intraday data is available for the last 1 year only.
Complete Flow Example
import requests
API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.ssi.com.vn"
# 1. Get access token
token_resp = requests.post(f"{BASE_URL}/api/v3/auth/token", json={
"apiKey": API_KEY,
"apiSecret": API_SECRET
})
access_token = token_resp.json()["accessToken"]
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {access_token}"
}
# 2. Get securities list on HOSE
securities = requests.get(
f"{BASE_URL}/api/v3/data/securitiesByBoard",
headers=headers,
params={"board": "HOSE"}
).json()
print(f"Total symbols on HOSE: {len(securities)}")
# 3. Get trading summary for SSI
summary = requests.get(
f"{BASE_URL}/api/v3/data/securitiesSummary",
headers=headers,
params={
"symbol": "SSI",
"from": "2026-05-20",
"to": "2026-05-20"
}
).json()
item = summary["data"][0]
print(f"SSI on {item['tradingDate']}: close {item['close']}, volume {item['totalMatch']}")
# 4. Get OHLCV data
ohlc = requests.get(
f"{BASE_URL}/api/v3/data/ohlc",
headers=headers,
params={
"symbol": "SSI",
"from": "2026-05-01",
"to": "2026-05-20",
"timeFrame": "1d"
}
).json()
print(f"Sessions: {ohlc['itemsCount']}")
for candle in ohlc["data"][:3]:
print(f" {candle['tradingDate']}: O={candle['open']} H={candle['high']} L={candle['low']} C={candle['close']}")Tips & Troubleshooting
Next Steps
Everything working? Continue with FAQ or explore the full API Reference for all available endpoints!