curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/indices?window=YTD&sort=-change_percent"import requests
url = "https://open-api.fhsc.com.vn/market/indices"
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/indices', 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/indices",
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/indices"
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/indices")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/indices")
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": {
"items": [
{
"index": "VNINDEX",
"name": "VN-Index",
"exchange": "HOSE",
"index_value": 1284.32,
"change": 11.17,
"change_percent": 0.88,
"market_cap": 5430000000000000,
"constituent_count": 30,
"advancers": 142,
"decliners": 131,
"unchanged": 44,
"volume": 728450000,
"trading_value": 18700000000000,
"foreign_net_value": -684000000000
}
],
"window": "1D",
"updated_at": "2026-08-17T14:30:15+07:00",
"page": 1,
"page_size": 20,
"total": 12
},
"error_code": "0",
"message": "success"
}{
"error_code": "400",
"message": "Invalid parameter"
}{
"error_code": "401",
"message": "Invalid signature"
}{
"error_code": "429",
"message": "Too many requests"
}{
"error_code": "500",
"message": "Internal server error"
}Bảng so sánh các chỉ số
Bảng so sánh các chỉ số: điểm số, thay đổi tuyệt đối và %, vốn hoá, số mã trong rổ, độ rộng, khối lượng / giá trị khớp và mua ròng khối ngoại.
window quyết định cửa sổ luỹ kế của các field dòng tiền. Độ rộng chỉ tính được cho phiên hiện tại, nên ngoài window=1D các field này trả null và sort/filter theo chúng bị từ chối.
Đây là bảng so sánh — giá realtime của MỘT chỉ số dùng GET /market/quotes/indices/{symbol}.
curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/indices?window=YTD&sort=-change_percent"import requests
url = "https://open-api.fhsc.com.vn/market/indices"
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/indices', 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/indices",
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/indices"
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/indices")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/indices")
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": {
"items": [
{
"index": "VNINDEX",
"name": "VN-Index",
"exchange": "HOSE",
"index_value": 1284.32,
"change": 11.17,
"change_percent": 0.88,
"market_cap": 5430000000000000,
"constituent_count": 30,
"advancers": 142,
"decliners": 131,
"unchanged": 44,
"volume": 728450000,
"trading_value": 18700000000000,
"foreign_net_value": -684000000000
}
],
"window": "1D",
"updated_at": "2026-08-17T14:30:15+07:00",
"page": 1,
"page_size": 20,
"total": 12
},
"error_code": "0",
"message": "success"
}{
"error_code": "400",
"message": "Invalid parameter"
}{
"error_code": "401",
"message": "Invalid signature"
}{
"error_code": "429",
"message": "Too many requests"
}{
"error_code": "500",
"message": "Internal server error"
}Authorizations
Query Parameters
Danh sách field cần trả, phân tách bằng dấu phẩy. Mặc định index,name,index_value,change_percent; field dùng trong sort/filter luôn được thêm vào. Field hợp lệ: index, name, exchange, index_value, change, change_percent, market_cap, constituent_count, advancers, decliners, unchanged, volume, trading_value, foreign_net_value.
"index,name,index_value,change_percent,foreign_net_value"
Response
data.items là danh sách chỉ số, mỗi item chỉ chứa các field được chọn qua fields.
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.