Intraday Trades
Contract trade details (query by contract code).
intraday/trades/{symbol}
Parameters
| Name | Type | Description |
|---|---|---|
symbol* | string | Contract Symbol |
session | string | Session Type,valid in afterhours |
offset | number | Offset |
limit | number | Limit |
isTrial | boolean | Query trial-match details, default false (returns official matched trades) |
Response
| Name | Type | Description |
|---|---|---|
date* | string | Date |
type* | string | Ticker Type |
exchange* | string | Exchange |
market | string | Market Type |
symbol* | string | Contract Code |
data* | object[] | list |
>> price | number | Trading Price |
>> size | number | Trade size |
>> time | number | Trading Time |
info
'*' Indicates mandatory disclosure fields.
Trial query
isTrial=true queries trade details from the pre-market trial matching session. The default (false) returns only officially matched trades — the two are independent query modes, not a flag mixed into one result set. This parameter is rolled out in stages together with the futures/options advanced market data features; before it is enabled, the behavior of querying isTrial=true is subject to the official announcement.
Example
- Python
- Node.js
- C#
from fubon_neo.sdk import FubonSDK, Order
sdk = FubonSDK()
accounts = sdk.login("Your ID", "Your password", "Your cert path", "Your cert password") #
sdk.init_realtime()
restfutopt = sdk.marketdata.rest_client.futopt
# restfutopt.intraday.trades(symbol='TXFA4') # Version 2.2.3 and before
## Aftrer version 2.2.4 (use Exception for exception handling)
from fubon_neo.fugle_marketdata.rest.base_rest import FugleAPIError
try:
restfutopt.intraday.trades(symbol='TXFA4')
except FugleAPIError as e:
print(f"Error: {e}")
print("------------")
print(f"Status Code: {e.status_code}") # Ex: 429
print(f"Response Text: {e.response_text}") # Ex: {"statusCode":429,"message":"Rate limit exceeded"}
const { FubonSDK } = require('fubon-neo');
const sdk = new FubonSDK();
const accounts = sdk.login("Your ID", "Your Password", "Your Cert Path", "Your Cert Password");
sdk.initRealtime();
const client = sdk.marketdata.restClient
client.futopt.intraday.trades({ symbol: 'TXFA4' })
.then(data => console.log(data));
using FubonNeo.Sdk;
using FugleMarketData.QueryModels.FuOpt;
using FugleMarketData.QueryModels.FuOpt.Intraday;
var sdk = new FubonSDK();
var result = sdk.Login("Your ID", "Your Password", "Your Cert Path", "Your Cert Password");
sdk.InitRealtime();
var rest = sdk.MarketData.RestClient.FutureOption;
var trade = await rest.Intraday.Trades("TXFA4");
// var trade = await rest.Intraday.Trades("TXFA4", new(){Session=FugleMarketData.QueryModels.FuOpt.TradeSession.AfterHours}); // After hours
var trade_cont = trade.Content.ReadAsStringAsync().Result;
Console.WriteLine(trade_cont);
Response Body:
{
"date": "2023-12-20",
"type": "FUTURE",
"exchange": "TAIFEX",
"symbol": "TXFA4",
"data": [
{
"price": 17660,
"size": 3,
"time": 1703051099834000,
"serial": 218307
},
{
"price": 17661,
"size": 2,
"time": 1703051099779000,
"serial": 218304
},
{
"price": 17661,
"size": 1,
"time": 1703051099778000,
"serial": 218303
},
{
"price": 17661,
"size": 1,
"time": 1703051099778000,
"serial": 218301
},
....
]
}