Historical Stats
取得近 52 週股價數據(依代碼查詢)
historical/stats/{symbol}
Parameters
| Name | Type | Description |
|---|---|---|
symbol* | string | 股票代碼 |
Response
| Name | Type | Description |
|---|---|---|
date* | string | 日期 |
type* | string | Ticker 類型 |
exchange* | string | 交易所 |
market* | string | 市場別 |
symbol* | string | 股票代碼 |
name* | string | 股票簡稱 |
openPrice* | number | 最後交易日開盤價 |
highPrice* | number | 最後交易日最高價 |
lowPrice* | number | 最後交易日最低價 |
closePrice* | number | 最後交易日收盤價 |
change* | number | 最後交易日漲跌 |
changePercent* | number | 最後交易日漲跌幅 |
tradeVolume* | number | 最後交易日成交量 |
tradeValue* | number | 最後交易日成交金額 |
previousClose* | number | 前一交易日收盤價 |
week52High* | number | 近 52 週高點 |
week52Low* | number | 近 52 週低點 |
Example
- Python
- Node.js
from configparser import ConfigParser
from esun_marketdata import EsunMarketdata
config = ConfigParser()
config.read('/path/to/config.ini')
sdk = EsunMarketdata(config)
sdk.login()
rest_stock = sdk.rest_client.stock
rest_stock.historical.stats(symbol = "0050")
const { EsunMarketdata } = require("@esun/marketdata");
(async () => {
const sdk = new EsunMarketdata({
configPath: "/path/to/config.ini",
});
await sdk.login();
const stock = sdk.restClient.stock;
const data = await stock.historical.stats({ symbol: "0050" });
console.log(data);
})();
Response Body:
{
"date": "2023-02-09",
"type": "EQUITY",
"exchange": "TWSE",
"market": "TSE",
"symbol": "0050",
"name": "元大台灣50",
"openPrice": 120.5,
"highPrice": 121,
"lowPrice": 120.3,
"closePrice": 120.9,
"change": 0.05,
"changePercent": 0.04,
"tradeVolume": 5032245,
"tradeValue": 607543546,
"previousClose": 120.85000000000001,
"week52High": 145.05,
"week52Low": 96.5
}