cURL
curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/financial-data"import requests
url = "https://open-api.fhsc.com.vn/market/financial-data"
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/financial-data', 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/financial-data",
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/financial-data"
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/financial-data")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/financial-data")
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{
"error_code": "0",
"message": "success",
"data": [
{
"financial_type": "GOLD",
"name": "Giá vàng",
"values": [
{
"index": "SJC_GOLD_BAR",
"name": "Vàng miếng SJC",
"description": "Đơn vị: 1.000đ/chỉ",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739437064948-gold.png",
"value_type": "BUY_SELL",
"buy_value": 16750,
"sell_value": 17000
},
{
"index": "PNJ_9999_GOLD_RING",
"name": "Vàng nhẫn PNJ",
"description": "Đơn vị: 1.000đ/chỉ",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739437064948-gold.png",
"value_type": "BUY_SELL",
"buy_value": 16670,
"sell_value": 16970
}
],
"last_updated": "2026-04-22 23:09:12"
},
{
"financial_type": "USD_EXCHANGE_RATE",
"name": "Tỷ giá USD",
"values": [
{
"index": "USD_VND_EXCHANGE_RATE",
"name": "Vietcombank",
"description": "Giao dịch tiền mặt",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739846863045-vcb.png",
"value_type": "BUY_SELL",
"buy_value": 26198,
"sell_value": 26448
},
{
"index": "BLACK_MARKET_USD_VND_EXCHANGE_RATE",
"name": "Chợ đen",
"description": "Giao dịch tiền mặt",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739846837853-blackmarket.png",
"value_type": "BUY_SELL",
"buy_value": 26484,
"sell_value": 26584
}
],
"last_updated": "2025-09-23 16:00:03"
},
{
"financial_type": "CRYPTO",
"name": "Tài sản số",
"values": [
{
"index": "BITCOIN",
"name": "BTC",
"description": "",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739758983132-btc.png",
"value_type": "SINGLE",
"value": 79283.83,
"change": 3324.45,
"change_percent": 4.377
}
],
"last_updated": "2026-04-22 23:10:00"
},
{
"financial_type": "US_INDEX",
"name": "Chứng khoán Mỹ",
"values": [
{
"index": "SP_500",
"name": "S&P 500",
"description": "",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739774157905-sp500.png",
"value_type": "SINGLE",
"value": 7124,
"change": 59.99,
"change_percent": 0.85
},
{
"index": "NASDAQ",
"name": "NASDAQ",
"description": "",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739774139495-nasdaq.png",
"value_type": "SINGLE",
"value": 24574.612,
"change": 314.647,
"change_percent": 1.3
}
],
"last_updated": "2026-04-22 23:10:00"
}
],
"traceId": "5ecb0251-aa07-421c-876c-89d6a7c67461"
}{
"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"
}Tổng hợp đa loại
Tổng hợp mọi loại dữ liệu tài chính
Endpoint tổng hợp giá vàng, bạc, crypto, lãi suất ngân hàng, tỷ giá USD và US index trong 1 call duy nhất. Nên dùng các endpoint chuyên biệt nếu chỉ cần 1 loại dữ liệu.
GET
/
market
/
financial-data
cURL
curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/financial-data"import requests
url = "https://open-api.fhsc.com.vn/market/financial-data"
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/financial-data', 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/financial-data",
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/financial-data"
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/financial-data")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/financial-data")
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{
"error_code": "0",
"message": "success",
"data": [
{
"financial_type": "GOLD",
"name": "Giá vàng",
"values": [
{
"index": "SJC_GOLD_BAR",
"name": "Vàng miếng SJC",
"description": "Đơn vị: 1.000đ/chỉ",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739437064948-gold.png",
"value_type": "BUY_SELL",
"buy_value": 16750,
"sell_value": 17000
},
{
"index": "PNJ_9999_GOLD_RING",
"name": "Vàng nhẫn PNJ",
"description": "Đơn vị: 1.000đ/chỉ",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739437064948-gold.png",
"value_type": "BUY_SELL",
"buy_value": 16670,
"sell_value": 16970
}
],
"last_updated": "2026-04-22 23:09:12"
},
{
"financial_type": "USD_EXCHANGE_RATE",
"name": "Tỷ giá USD",
"values": [
{
"index": "USD_VND_EXCHANGE_RATE",
"name": "Vietcombank",
"description": "Giao dịch tiền mặt",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739846863045-vcb.png",
"value_type": "BUY_SELL",
"buy_value": 26198,
"sell_value": 26448
},
{
"index": "BLACK_MARKET_USD_VND_EXCHANGE_RATE",
"name": "Chợ đen",
"description": "Giao dịch tiền mặt",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739846837853-blackmarket.png",
"value_type": "BUY_SELL",
"buy_value": 26484,
"sell_value": 26584
}
],
"last_updated": "2025-09-23 16:00:03"
},
{
"financial_type": "CRYPTO",
"name": "Tài sản số",
"values": [
{
"index": "BITCOIN",
"name": "BTC",
"description": "",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739758983132-btc.png",
"value_type": "SINGLE",
"value": 79283.83,
"change": 3324.45,
"change_percent": 4.377
}
],
"last_updated": "2026-04-22 23:10:00"
},
{
"financial_type": "US_INDEX",
"name": "Chứng khoán Mỹ",
"values": [
{
"index": "SP_500",
"name": "S&P 500",
"description": "",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739774157905-sp500.png",
"value_type": "SINGLE",
"value": 7124,
"change": 59.99,
"change_percent": 0.85
},
{
"index": "NASDAQ",
"name": "NASDAQ",
"description": "",
"icon_url": "https://cdn1.finhay.com.vn/vnsc-prod/1739774139495-nasdaq.png",
"value_type": "SINGLE",
"value": 24574.612,
"change": 314.647,
"change_percent": 1.3
}
],
"last_updated": "2026-04-22 23:10:00"
}
],
"traceId": "5ecb0251-aa07-421c-876c-89d6a7c67461"
}{
"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
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.
Response
Thành công.
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.
⌘I