Intraday Trades
取得期權成交明細(依代碼查詢)
GET /intraday/trades/{symbol}
Parameters
| Name | Type | Description |
|---|---|---|
symbol* | string | 商品代碼 |
session | string | 交易時段,可選 afterhours 盤後交易 |
offset | number | 偏移量 |
limit | number | 限制量,預設 50,上限 500(超過上限時回傳 500 筆,不會回錯誤) |
isTrial | boolean | 查詢試撮明細,預設 false(回傳正式成交) |
分頁與查詢範圍
- 成交明細由新到舊排列,最新一筆在最前面;期權不支援排序參數。
- 只能查詢最近一個交易日的成交,無法指定日期;更早的交易日請改用歷史K線。
- 要取完當日成交,從
offset=0開始,每次以limit=500遞增offset,直到data為空陣列為止;offset超過總筆數時回傳 HTTP 200 與空的data,不是錯誤。 - 建議在該交易時段收盤後再分頁取完。交易時段進行中,新成交會排到最前面、後面的頁面隨之往後位移,相鄰兩頁之間會出現重複的成交。
- 一般交易時段與盤後交易時段分開查詢,盤後交易時段請帶
session=afterhours,各自分頁。
Response
| Name | Type | Description |
|---|---|---|
date* | string | 交易日期;夜盤(session=afterhours)為開盤當天的日期,與歷史行情不同,見 夜盤的日期歸屬 |
type* | string | 期權類型 |
exchange* | string | 交易所 |
symbol* | string | 商品代碼 |
data* | object[] | 成交明細 |
data[0].bid | number | 成交買價 |
data[0].ask | number | 成交賣價 |
data[0].price | number | 成交價格 |
data[0].size | number | 成交單量 |
data[0].time | number | 成交時間 |
data[0].serial | number | 流水號 |
Example
- cURL
- Python
- Node.js
curl -X 'GET' \
'https://api.fugle.tw/marketdata/v1.0/futopt/intraday/trades/TXF1!' \
-H 'X-API-KEY: <YOUR_API_KEY>'
from fugle_marketdata import RestClient
client = RestClient(api_key = 'YOUR_API_KEY')
futopt = client.futopt
print(futopt.intraday.trades(symbol='TXF1!'))
const { RestClient } = require("@fugle/marketdata");
const client = new RestClient({ apiKey:"YOUR_API_KEY" });
client.futopt.intraday
.trades({ symbol:"TXF1!" })
.then((data) => console.log(data));
Response Body:
{
"date": "2024-10-22",
"type": "FUTURE",
"exchange": "TAIFEX",
"symbol": "TXFC5",
"data": [
{
"bid": 23622,
"ask": 23655,
"price": 23655,
"size": 1,
"time": 1729574996621000,
"serial": 218421
},
{
"bid": 23583,
"ask": 23597,
"price": 23583,
"size": 1,
"time": 1729573825049000,
"serial": 208004
},
{
"bid": 23607,
"ask": 23648,
"price": 23648,
"size": 1,
"time": 1729571331711000,
"serial": 188854
},
{
"bid": 23568,
"ask": 23605,
"price": 23605,
"size": 1,
"time": 1729563837862000,
"serial": 140103
},
{
"bid": 23568,
"ask": 23605,
"price": 23604,
"size": 1,
"time": 1729563835924000,
"serial": 140081
},
{
"bid": 23568,
"ask": 23605,
"price": 23602,
"size": 1,
"time": 1729563833108000,
"serial": 140018
},
{
"bid": 23568,
"ask": 23605,
"price": 23602,
"size": 1,
"time": 1729563830690000,
"serial": 140008
},
{
"bid": 23568,
"ask": 23605,
"price": 23600,
"size": 1,
"time": 1729563826344000,
"serial": 139988
},
{
"bid": 23559,
"ask": 23602,
"price": 23593,
"size": 1,
"time": 1729563713019000,
"serial": 139171
},
{
"bid": 23572,
"ask": 23611,
"price": 23611,
"size": 1,
"time": 1729563629699000,
"serial": 138540
}
]
}