curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/calendar?country=United%20States&page=1&page_size=20"import requests
url = "https://open-api.fhsc.com.vn/market/calendar"
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/calendar', 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/calendar",
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/calendar"
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/calendar")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/calendar")
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": {
"results": [
{
"type": "ECONOMIC",
"country": "United States",
"title": "Fed Interest Rate Decision",
"detail": {
"date": "2026-07-29T01:00:00+07:00",
"category": "Interest Rate",
"actual": null,
"previous": "5.25",
"consensus": "5.50",
"forecast": "5.50",
"unit": "Percent"
}
},
{
"type": "ECONOMIC",
"country": "Vietnam",
"title": "CPI MoM",
"detail": {
"date": "2026-07-29T00:00:00+07:00",
"category": "Inflation",
"actual": null,
"previous": "0.2",
"consensus": "0.3",
"forecast": "0.3",
"unit": "Percent"
}
}
],
"total": 137,
"current_page": 1,
"next_page": 2,
"previous_page": 1,
"page_size": 20,
"page_total": 7
}
}{
"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"
}Lịch sự kiện thị trường
Lịch các sự kiện thị trường theo ngày, không gắn với mã cổ phiếu. Hiện trả về sự kiện công bố số liệu vĩ mô (FOMC / quyết định lãi suất, CPI, GDP, PMI, …) của 6 nền kinh tế — Trung Quốc, Khu vực đồng Euro, Nhật Bản, Mỹ, Anh, Việt Nam.
Mỗi sự kiện có type phân loại (hiện chỉ ECONOMIC) và phần đặc thù nằm trong detail. Với sự kiện vĩ mô, detail gồm số liệu actual (thực tế), previous (kỳ trước), consensus (đồng thuận thị trường) và forecast (dự báo) — dạng chuỗi số đã bỏ ký hiệu đơn vị, null khi sự kiện chưa diễn ra hoặc nguồn chưa có số — kèm unit là đơn vị chung của 4 số liệu (ví dụ Percent, Thousand, USD Billion).
Khoảng thời gian lọc qua from/to (Unix timestamp tính bằng GIÂY). Bỏ trống cả hai thì mặc định lấy sự kiện từ hôm nay trở đi. Sort theo detail.date tăng dần, phân trang qua page/page_size.
curl -H "X-FH-APIKEY: $FINHAY_API_KEY" \
"https://open-api.fhsc.com.vn/market/calendar?country=United%20States&page=1&page_size=20"import requests
url = "https://open-api.fhsc.com.vn/market/calendar"
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/calendar', 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/calendar",
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/calendar"
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/calendar")
.header("X-FH-APIKEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open-api.fhsc.com.vn/market/calendar")
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": {
"results": [
{
"type": "ECONOMIC",
"country": "United States",
"title": "Fed Interest Rate Decision",
"detail": {
"date": "2026-07-29T01:00:00+07:00",
"category": "Interest Rate",
"actual": null,
"previous": "5.25",
"consensus": "5.50",
"forecast": "5.50",
"unit": "Percent"
}
},
{
"type": "ECONOMIC",
"country": "Vietnam",
"title": "CPI MoM",
"detail": {
"date": "2026-07-29T00:00:00+07:00",
"category": "Inflation",
"actual": null,
"previous": "0.2",
"consensus": "0.3",
"forecast": "0.3",
"unit": "Percent"
}
}
],
"total": 137,
"current_page": 1,
"next_page": 2,
"previous_page": 1,
"page_size": 20,
"page_total": 7
}
}{
"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.
Query Parameters
Lọc theo quốc gia. Bỏ qua để lấy mọi quốc gia hỗ trợ.
Tên quốc gia hiển thị (full name) cho dữ liệu kinh tế. Dùng trong
/market/calendar.
| Giá trị | Ý nghĩa |
|---|---|
China | Trung Quốc |
Euro Area | Khu vực đồng Euro |
Japan | Nhật Bản |
United States | Mỹ |
United Kingdom | Anh |
Vietnam | Việt Nam |
China, Euro Area, Japan, United States, United Kingdom, Vietnam Mốc đầu khoảng lọc — Unix timestamp tính bằng GIÂY.
x >= 01767225600
Mốc cuối khoảng lọc — Unix timestamp tính bằng GIÂY, phải >= from.
x >= 01769904000
Trang (bắt đầu từ 1). Mặc định 1.
x >= 11
Số sự kiện mỗi trang (1–50). Mặc định 20.
1 <= x <= 5020
Response
data là trang sự kiện kèm results và thông tin phân trang.
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.