curl --request GET \
--url https://openapi.dnse.com.vn/price/ohlc \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>'import requests
url = "https://openapi.dnse.com.vn/price/ohlc"
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.dnse.com.vn/price/ohlc', 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.dnse.com.vn/price/ohlc",
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.dnse.com.vn/price/ohlc"
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.dnse.com.vn/price/ohlc")
.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.dnse.com.vn/price/ohlc")
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{
"t": [
1773715500,
1773716400,
1773800100,
1773801000,
1773801900,
1773802800,
1773803700,
1773804600,
1773805500,
1773806400
],
"o": [
23.8,
23.75,
23.75,
23.85,
23.8,
23.85,
23.9,
23.75,
23.8,
23.8
],
"h": [
23.8,
23.8,
23.9,
23.9,
23.85,
23.9,
23.9,
23.85,
23.8,
23.8
],
"l": [
23.7,
23.7,
23.7,
23.8,
23.75,
23.8,
23.7,
23.75,
23.7,
23.75
],
"c": [
23.75,
23.75,
23.8,
23.85,
23.8,
23.9,
23.85,
23.75,
23.75,
23.75
],
"v": [
2530900,
514100,
494000,
344400,
429000,
315300,
582100,
205300,
361300,
3040800
],
"nextTime": 0
}{
"status": 400,
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ"
}{
"status": 500,
"code": "OA-009",
"message": "Lỗi hệ thống"
}Lịch sử OHLC
curl --request GET \
--url https://openapi.dnse.com.vn/price/ohlc \
--header 'X-Api-Key: <x-api-key>' \
--header 'X-Aux-Date: <x-aux-date>' \
--header 'X-Signature: <x-signature>'import requests
url = "https://openapi.dnse.com.vn/price/ohlc"
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.dnse.com.vn/price/ohlc', 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.dnse.com.vn/price/ohlc",
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.dnse.com.vn/price/ohlc"
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.dnse.com.vn/price/ohlc")
.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.dnse.com.vn/price/ohlc")
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{
"t": [
1773715500,
1773716400,
1773800100,
1773801000,
1773801900,
1773802800,
1773803700,
1773804600,
1773805500,
1773806400
],
"o": [
23.8,
23.75,
23.75,
23.85,
23.8,
23.85,
23.9,
23.75,
23.8,
23.8
],
"h": [
23.8,
23.8,
23.9,
23.9,
23.85,
23.9,
23.9,
23.85,
23.8,
23.8
],
"l": [
23.7,
23.7,
23.7,
23.8,
23.75,
23.8,
23.7,
23.75,
23.7,
23.75
],
"c": [
23.75,
23.75,
23.8,
23.85,
23.8,
23.9,
23.85,
23.75,
23.75,
23.75
],
"v": [
2530900,
514100,
494000,
344400,
429000,
315300,
582100,
205300,
361300,
3040800
],
"nextTime": 0
}{
"status": 400,
"code": "OA-003",
"message": "Thông tin nhập không hợp lệ"
}{
"status": 500,
"code": "OA-009",
"message": "Lỗi hệ thống"
}Tiêu đề
API key được cấp khi đăng ký dịch vụ DNSE OpenAPI.
Ví dụ: b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=
Thời gian thực hiện request, dùng trong cơ chế ký request của DNSE.
Ví dụ: Sat, 01 May 2026 14:24:23 +0000
Chữ ký xác thực request được tạo từ API key secret và X-Aux-Date.
Ví dụ: Signature keyId="b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=",algorithm="hmac-sha256",headers="(request-target) x-aux-date",signature="rfbVXHDUi%2B%2FsOkLXle7O17Qm%2F05cbISSR%2BDcFrBHfqQ%3D",nonce="4add8c3264e4492b9f8ecde0cf26b523"
Tham số truy vấn
Mã chứng khoán
Loại thị trường
-
STOCK: Cổ phiếu
-
DERIVATIVE: Phái sinh
-
INDEX: Chỉ số thị trường Loại nhóm thị trường.
-
STOCK: Cổ phiếu -
DERIVATIVE: Phái sinh -
INDEX: Chỉ số
STOCK, DERIVATIVE, INDEX "STOCK"
Khung thời gian nến
-
1,3,5,15,30,1h,1D,1W Khung thời gian nến.
-
1: 1 phút -
3: 3 phút -
5: 5 phút -
15: 15 phút -
30: 30 phút -
1H: 1 giờ -
1D: 1 ngày -
1W: 1 tuần
1, 3, 5, 15, 30, 1H, 1D, 1W "15"
Thời gian bắt đầu
Thời gian kết thúc
Phản hồi
OK
Dữ liệu biểu đồ nến (OHLCV) theo từng khoảng thời gian.
Danh sách thời gian nến
Thời gian nến (timestamp)
[1773715500]
Danh sách giá mở cửa của nến theo thời gian tương ứng
Giá mở cửa của nến
[23.8]
Danh sách giá cao nhất trong nến theo thời gian tương ứng
Giá cao nhất trong nến
[23.8]
Danh sách giá thấp nhất trong nến theo thời gian tương ứng
Giá thấp nhất trong nến
[23.7]
Danh sách giá đóng cửa của nến theo thời gian tương ứng
Giá đóng cửa của nến
[23.75]
Danh sách khối lượng giao dịch theo thời gian tương ứng
Khối lượng giao dịch
[2530900]
Timestamp của cây nến tiếp theo (nếu có), 0 nếu không còn
0