Thông tin mã, giá
curl --request GET \
--url https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons', 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.tcbs.com.vn/tartarus/v1/tickerCommons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tcbs.com.vn/tartarus/v1/tickerCommons"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tcbs.com.vn/tartarus/v1/tickerCommons")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"symbol": "FPT",
"ceilPrice": 106100,
"floorPrice": 92300,
"refPrice": 99200,
"bidPrice01": 98700,
"bidPrice02": 98600,
"bidPrice03": 98500,
"bidQtty01": 11300,
"bidQtty02": 56800,
"bidQtty03": 45600,
"offerPrice01": 98800,
"offerPrice02": 98900,
"offerPrice03": 99000,
"offerQtty01": 100,
"offerQtty02": 23200,
"offerQtty03": 56100,
"matchPrice": 98800,
"matchQtty": 100,
"change": -400,
"changePercent": -0.4032,
"open": 99200,
"avg": 98800,
"high": 99200,
"low": 98500,
"totalVol": 833900,
"totalVal": 82409370000,
"buyForeignQtty": 647300,
"sellForeignQtty": 648500,
"room": "84",
"indexNumber": 1
}
],
"tradingDate": "29/10/2024"
}Dữ liệu thị trường
Thông tin mã, giá
Lấy thông tin mã và giá của thị trường cơ sở.
GET
/
tartarus
/
v1
/
tickerCommons
Thông tin mã, giá
curl --request GET \
--url https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons', 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.tcbs.com.vn/tartarus/v1/tickerCommons",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tcbs.com.vn/tartarus/v1/tickerCommons"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tcbs.com.vn/tartarus/v1/tickerCommons")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.tcbs.com.vn/tartarus/v1/tickerCommons")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"symbol": "FPT",
"ceilPrice": 106100,
"floorPrice": 92300,
"refPrice": 99200,
"bidPrice01": 98700,
"bidPrice02": 98600,
"bidPrice03": 98500,
"bidQtty01": 11300,
"bidQtty02": 56800,
"bidQtty03": 45600,
"offerPrice01": 98800,
"offerPrice02": 98900,
"offerPrice03": 99000,
"offerQtty01": 100,
"offerQtty02": 23200,
"offerQtty03": 56100,
"matchPrice": 98800,
"matchQtty": 100,
"change": -400,
"changePercent": -0.4032,
"open": 99200,
"avg": 98800,
"high": 99200,
"low": 98500,
"totalVol": 833900,
"totalVal": 82409370000,
"buyForeignQtty": 647300,
"sellForeignQtty": 648500,
"room": "84",
"indexNumber": 1
}
],
"tradingDate": "29/10/2024"
}Ủy quyền
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Tham số truy vấn
Danh sách mã cổ phiếu phân tách bằng dấu phẩy. Không dùng kết hợp với tham số index.
Rổ chứng khoán: 1 = HOSE, 2 = VN30, 3 = HNX, 4 = HNX30, 5 = UPCOM, 10 = Midcap, 11 = VN100, 12 = VNAllShare, 13 = VNSmallCap, 14 = VNXAllShare, 15 = VN50, 16 = VNSI. Không dùng kết hợp với tham số tickers.