curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/stocks/HPG/technicals?indicators=RSI(14),MACD(12,26,9)"
import requests
url = "https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals"
headers = {"X-FH-APIKEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-FH-APIKEY': '<api-key>'}};
fetch('https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-FH-APIKEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-FH-APIKEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-FH-APIKEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"symbol": "HPG",
"resolution": "1D",
"from": "2026-05-04",
"to": "2026-07-31",
"prices": [
{
"date": "2026-07-31",
"close": 21.7
}
],
"indicators": [
{
"indicator": "MACD",
"params": "12,26,9",
"display_name": "MACD(12,26,9)",
"data": [
{
"date": "2026-07-31",
"macd_line": -0.179,
"signal_line": 0.014,
"histogram": -0.193
}
],
"note": "Cần tối thiểu 200 phiên, mã hiện có 143"
}
]
},
"error_code": "0",
"message": "success"
}{
"error_code": "400",
"message": "Invalid parameter"
}{
"error_code": "401",
"message": "Invalid signature"
}{
"error_code": "404",
"message": "Not found"
}{
"error_code": "429",
"message": "Too many requests"
}{
"error_code": "500",
"message": "Internal server error"
}Chỉ báo kỹ thuật
Giá trị 16 chỉ báo kỹ thuật của 1 mã, tính trực tiếp từ lịch sử giá khung ngày (1D — không có khung intraday).
Chọn chỉ báo và tham số bằng ký pháp trader quen viết: indicators=RSI(14),SMA(20),MACD(12,26,9). Viết tên trần (RSI) thì dùng bộ tham số mặc định của chỉ báo đó.
Một endpoint phục vụ cả hai chế độ: bỏ trống from/to → phiên gần nhất đã chốt; truyền cả cặp → chuỗi theo phiên. Một phiên trong quá khứ là from và to cùng đặt vào ngày đó — không có param date riêng. Hình dạng response không đổi giữa hai chế độ: snapshot là chuỗi có đúng một phần tử.
Chỉ trả giá trị, không quy ra khuyến nghị mua/bán.
curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/stocks/HPG/technicals?indicators=RSI(14),MACD(12,26,9)"
import requests
url = "https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals"
headers = {"X-FH-APIKEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-FH-APIKEY': '<api-key>'}};
fetch('https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-FH-APIKEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-FH-APIKEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/stocks/{symbol}/technicals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-FH-APIKEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"symbol": "HPG",
"resolution": "1D",
"from": "2026-05-04",
"to": "2026-07-31",
"prices": [
{
"date": "2026-07-31",
"close": 21.7
}
],
"indicators": [
{
"indicator": "MACD",
"params": "12,26,9",
"display_name": "MACD(12,26,9)",
"data": [
{
"date": "2026-07-31",
"macd_line": -0.179,
"signal_line": 0.014,
"histogram": -0.193
}
],
"note": "Cần tối thiểu 200 phiên, mã hiện có 143"
}
]
},
"error_code": "0",
"message": "success"
}{
"error_code": "400",
"message": "Invalid parameter"
}{
"error_code": "401",
"message": "Invalid signature"
}{
"error_code": "404",
"message": "Not found"
}{
"error_code": "429",
"message": "Too many requests"
}{
"error_code": "500",
"message": "Internal server error"
}Authorizations
API key dài hạn của client. Cấu hình 1 lần lúc khởi tạo; có thể wire thẳng
vào static setter của SDK tự-gen. Đi kèm với FINHAY_API_SECRET — secret
này chỉ dùng ở phía client để tính X-FH-SIGNATURE, không bao giờ
gửi qua mạng.
Path Parameters
Mã cổ phiếu niêm yết (3–10 ký tự chữ/số, không phân biệt hoa thường). VD: VNM, FPT.
"HPG"
Query Parameters
Danh sách chỉ báo, ngăn bởi dấu phẩy, mỗi cái theo ký pháp TÊN(tham số) — tối đa 20 chỉ báo.
Xu hướng: SMA(period), EMA(period), ADX(period), SUPERTREND(period,multiplier), PSAR(step,max_step), ICHIMOKU(tenkan,kijun,senkou_b,displacement).
Động lượng: RSI(period), MACD(fast,slow,signal), STOCH(period,k_smooth,d_smooth), CCI(period), WILLIAMS_R(period).
Biến động: BBANDS(period,std_dev), ATR(period).
Khối lượng: OBV(), MFI(period), VOLUME_SMA(period).
Bỏ trống → bộ mặc định phủ cả 4 nhóm: SMA(20),SMA(50),EMA(20),RSI(14),MACD(12,26,9),BBANDS(20,2),VOLUME_SMA(20).
"RSI(14),SMA(20),MACD(12,26,9)"
Ngày bắt đầu (bao gồm), dạng YYYY-MM-DD. Phải đi kèm to.
"2026-05-01"
Ngày kết thúc (bao gồm), dạng YYYY-MM-DD. Phải đi kèm from, không sớm hơn from, không ở tương lai, khoảng cách tối đa 5 năm.
"2026-07-31"
Response
data gồm prices (giá đóng cửa của cửa sổ) và indicators (mỗi chỉ báo một chuỗi).
Các field chung của envelope trong mọi response của Finhay API.
error_codelà"0"(string) khi thành công, mã khác"0"khi lỗi.messagelà thông điệp ngắn từ server.