Lịch sử khớp lệnh
curl --request GET \
--url https://openapi-uat.dnse.com.vn/price/{symbol}/trades \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>'import requests
url = "https://openapi-uat.dnse.com.vn/price/{symbol}/trades"
headers = {
"X-API-Key": "<x-api-key>",
"X-Aux-Date": "<x-aux-date>",
"X-Signature": "<x-signature>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-API-Key': '<x-api-key>',
'X-Aux-Date': '<x-aux-date>',
'X-Signature': '<x-signature>'
}
};
fetch('https://openapi-uat.dnse.com.vn/price/{symbol}/trades', 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://openapi-uat.dnse.com.vn/price/{symbol}/trades",
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-API-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>"
],
]);
$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://openapi-uat.dnse.com.vn/price/{symbol}/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Aux-Date", "<x-aux-date>")
req.Header.Add("X-Signature", "<x-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi-uat.dnse.com.vn/price/{symbol}/trades")
.header("X-API-Key", "<x-api-key>")
.header("X-Aux-Date", "<x-aux-date>")
.header("X-Signature", "<x-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi-uat.dnse.com.vn/price/{symbol}/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Aux-Date"] = '<x-aux-date>'
request["X-Signature"] = '<x-signature>'
response = http.request(request)
puts response.read_body{
"trades": [
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 87.6,
"matchQtty": 30,
"side": "BUY",
"avgPrice": 87.876,
"totalVolumeTraded": 12160,
"grossTradeAmount": 10.68574,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:19:39.855"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 87.6,
"matchQtty": 20,
"side": "BUY",
"avgPrice": 87.877,
"totalVolumeTraded": 12130,
"grossTradeAmount": 10.65946,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:19:39.854"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 87.6,
"matchQtty": 10,
"side": "SELL",
"avgPrice": 87.877,
"totalVolumeTraded": 12110,
"grossTradeAmount": 10.64194,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:01:41.729"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 88,
"matchQtty": 20,
"side": "SELL",
"avgPrice": 87.878,
"totalVolumeTraded": 12100,
"grossTradeAmount": 10.63318,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:01:41.729"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "UNSPECIFIED",
"avgPrice": 87.877,
"totalVolumeTraded": 12080,
"grossTradeAmount": 10.61558,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 10:50:52.615"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.872,
"totalVolumeTraded": 12070,
"grossTradeAmount": 10.60617,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 10:29:51.070"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 100,
"side": "BUY",
"avgPrice": 87.867,
"totalVolumeTraded": 12060,
"grossTradeAmount": 10.59676,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:53:37.234"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.815,
"totalVolumeTraded": 11960,
"grossTradeAmount": 10.50266,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:52:40.863"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 100,
"side": "BUY",
"avgPrice": 87.81,
"totalVolumeTraded": 11950,
"grossTradeAmount": 10.49325,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:45:50.879"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 88,
"matchQtty": 10,
"side": "SELL",
"avgPrice": 87.757,
"totalVolumeTraded": 11850,
"grossTradeAmount": 10.39915,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:45:27.028"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 20,
"side": "BUY",
"avgPrice": 87.756,
"totalVolumeTraded": 11840,
"grossTradeAmount": 10.39035,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:43:20.216"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.746,
"totalVolumeTraded": 11820,
"grossTradeAmount": 10.37153,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:43:16.440"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.74,
"totalVolumeTraded": 11810,
"grossTradeAmount": 10.36212,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:42:12.070"
}
],
"nextPageToken": null
}{
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ",
"status": 400
}{
"code": "OA-009",
"message": "Lỗi hệ thống",
"status": 500
}market-data
Lịch sử khớp lệnh
Truy vấn thông tin lịch sử khớp lệnh của mã chứng khoán theo bảng giao dịch và khoảng thời gian cụ thể.
GET
/
price
/
{symbol}
/
trades
Lịch sử khớp lệnh
curl --request GET \
--url https://openapi-uat.dnse.com.vn/price/{symbol}/trades \
--header 'X-API-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>'import requests
url = "https://openapi-uat.dnse.com.vn/price/{symbol}/trades"
headers = {
"X-API-Key": "<x-api-key>",
"X-Aux-Date": "<x-aux-date>",
"X-Signature": "<x-signature>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-API-Key': '<x-api-key>',
'X-Aux-Date': '<x-aux-date>',
'X-Signature': '<x-signature>'
}
};
fetch('https://openapi-uat.dnse.com.vn/price/{symbol}/trades', 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://openapi-uat.dnse.com.vn/price/{symbol}/trades",
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-API-Key: <x-api-key>",
"X-Aux-Date: <x-aux-date>",
"X-Signature: <x-signature>"
],
]);
$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://openapi-uat.dnse.com.vn/price/{symbol}/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("X-Aux-Date", "<x-aux-date>")
req.Header.Add("X-Signature", "<x-signature>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi-uat.dnse.com.vn/price/{symbol}/trades")
.header("X-API-Key", "<x-api-key>")
.header("X-Aux-Date", "<x-aux-date>")
.header("X-Signature", "<x-signature>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi-uat.dnse.com.vn/price/{symbol}/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
request["X-Aux-Date"] = '<x-aux-date>'
request["X-Signature"] = '<x-signature>'
response = http.request(request)
puts response.read_body{
"trades": [
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 87.6,
"matchQtty": 30,
"side": "BUY",
"avgPrice": 87.876,
"totalVolumeTraded": 12160,
"grossTradeAmount": 10.68574,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:19:39.855"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 87.6,
"matchQtty": 20,
"side": "BUY",
"avgPrice": 87.877,
"totalVolumeTraded": 12130,
"grossTradeAmount": 10.65946,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:19:39.854"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 87.6,
"matchQtty": 10,
"side": "SELL",
"avgPrice": 87.877,
"totalVolumeTraded": 12110,
"grossTradeAmount": 10.64194,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:01:41.729"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 88,
"matchQtty": 20,
"side": "SELL",
"avgPrice": 87.878,
"totalVolumeTraded": 12100,
"grossTradeAmount": 10.63318,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 11:01:41.729"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "UNSPECIFIED",
"avgPrice": 87.877,
"totalVolumeTraded": 12080,
"grossTradeAmount": 10.61558,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 10:50:52.615"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.872,
"totalVolumeTraded": 12070,
"grossTradeAmount": 10.60617,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 10:29:51.070"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 100,
"side": "BUY",
"avgPrice": 87.867,
"totalVolumeTraded": 12060,
"grossTradeAmount": 10.59676,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:53:37.234"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.815,
"totalVolumeTraded": 11960,
"grossTradeAmount": 10.50266,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:52:40.863"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 100,
"side": "BUY",
"avgPrice": 87.81,
"totalVolumeTraded": 11950,
"grossTradeAmount": 10.49325,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:45:50.879"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 88,
"matchQtty": 10,
"side": "SELL",
"avgPrice": 87.757,
"totalVolumeTraded": 11850,
"grossTradeAmount": 10.39915,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:45:27.028"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 20,
"side": "BUY",
"avgPrice": 87.756,
"totalVolumeTraded": 11840,
"grossTradeAmount": 10.39035,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:43:20.216"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.746,
"totalVolumeTraded": 11820,
"grossTradeAmount": 10.37153,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:43:16.440"
},
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.74,
"totalVolumeTraded": 11810,
"grossTradeAmount": 10.36212,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 09:42:12.070"
}
],
"nextPageToken": null
}{
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ",
"status": 400
}{
"code": "OA-009",
"message": "Lỗi hệ thống",
"status": 500
}Tiêu đề
API Key được cấp khi đăng ký dịch vụ
Thời gian thực hiện yêu cầu
Chữ ký xác thực yêu cầu
API version (YYYY-MM-DD)
Tham số đường dẫn
Mã chứng khoán
Tham số truy vấn
Mã bảng giao dịch
- G1: Lô chẵn
- G4: Lô lẻ
- T1: Thỏa thuận trong giờ (9h - 14h45)
- T3: Thỏa thuận sau giờ (14h45 - 15h)
- T4: Thỏa thuận lô lẻ trong giờ (9h - 14h45)
- T6: Thỏa thuận lô lẻ sau giờ (14h45 - 15h)
Thời gian bắt đầu (timestamp)
Thời gian kết thúc (timestamp) (không vượt quá 1 ngày)
Phản hồi
OK
Danh sách giao dịch khớp lệnh
Show child attributes
Show child attributes
Ví dụ:
[
{
"marketId": "STO",
"boardId": "G1",
"isin": "VN000000HPG4",
"symbol": "HPG",
"matchPrice": 94.1,
"matchQtty": 10,
"side": "BUY",
"avgPrice": 87.872,
"totalVolumeTraded": 12070,
"grossTradeAmount": 10.60617,
"highestPrice": 94.1,
"lowestPrice": 87.6,
"openPrice": 87.6,
"time": "2026-08-04 10:29:51.070"
}
]
Token dùng để lấy trang dữ liệu tiếp theo. Không có hoặc rỗng nếu không còn dữ liệu
Ví dụ:
"NTkzMDgyMThfMjAyNi0wOC0wNFQwMjoxNjozNy4zNlo="