-
Notifications
You must be signed in to change notification settings - Fork 5
Market Data Tools
市場資料服務提供台股、期貨/選擇權、股務事件、快照與技術訊號,共 28 個 tools。此分類本身不送出、修改或取消委託;其中四個工具需要帳戶物件,仍屬唯讀。
historical_candles:
| 欄位 | 必填 | 說明 |
|---|---|---|
symbol |
是 | 商品代碼 |
from_date |
是 | YYYY-MM-DD |
to_date |
是 | YYYY-MM-DD |
timeframe |
否 | 富邦 API 支援的週期;日線為 D
|
adjusted |
否 | 是否還原股價 |
fields |
否 | API 欄位選擇字串 |
sort |
否 |
asc 或 desc,預設 desc
|
{
"args": {
"symbol": "2330",
"from_date": "2026-01-01",
"to_date": "2026-06-30",
"adjusted": true,
"sort": "asc"
}
}日期跨度超過單次 API 可接受範圍時,服務會切成最長 364 天的片段再合併。
只有以下查詢會讀寫 stock_data.db:
-
adjusted不是true。 -
timeframe未指定或為D。 - 未指定
fields。
還原、非日線或欄位投影會直接查官方 API。這項隔離避免把不同價格語意寫入同一資料表。快取命中不代表資料永遠最新;服務會依目標日期檢查並嘗試增補。
| Tool | 欄位 | 說明 |
|---|---|---|
get_capital_changes |
start_date, end_date, sort?
|
上市櫃股票與 ETF 資本變動 |
get_dividends |
start_date, end_date
|
除權息資料 |
get_listing_applicants |
start_date, end_date, sort?
|
申請上市櫃公司 |
這三個 endpoint 保留官方 REST response 的 wire shape,包括 camelCase 欄位。日期格式應依富邦官方 API 規格提供。
-
get_intraday_tickers:market必填;可用type、exchange、industry、isNormal、isAttention、isDisposition、isHalted篩選。 -
get_intraday_ticker:商品基本資料;type可用於 odd lot。 -
get_intraday_quote:單一商品即時報價。 -
get_intraday_candles:盤中 K 線。 -
get_intraday_trades:成交明細;支援offset、limit。 -
get_intraday_volumes:分價量。
常用 market 包含 TSE、OTC、ESB、TIB、PSB;實際有效組合以官方 API 為準。
-
get_snapshot_quotes:依market/type取得行情快照。 -
get_snapshot_movers:direction預設up,change預設percent,可傳gt、gte、lt、lte、eq。 -
get_snapshot_actives:trade預設volume。 -
get_historical_stats:52 週統計。 -
get_market_overview:無參數的市場概況。
| Tool | 主要欄位 | 用途 |
|---|---|---|
get_realtime_quotes |
symbol |
即時行情 |
query_symbol_snapshot |
account, market_type, stock_type[]
|
帳戶介面的商品快照 |
margin_quota |
account, stock_no
|
資券配額 |
daytrade_and_stock_info |
account, stock_no
|
現沖券與商品資訊 |
query_symbol_quote |
account, symbol, market_type?
|
商品漲跌幅報表 |
需要 account 的工具會透過共用 helper 驗證帳戶;帳戶不存在或登入失效時回傳 status: error。
| Tool | 必填欄位 | 選填欄位 |
|---|---|---|
get_intraday_futopt_products |
無 |
type, exchange, session, contractType, status
|
get_intraday_futopt_tickers |
type |
exchange, session, product, contractType
|
get_intraday_futopt_ticker |
symbol |
session |
get_intraday_futopt_quote |
symbol |
session |
get_intraday_futopt_candles |
symbol |
session, timeframe
|
get_intraday_futopt_volumes |
symbol |
session |
get_intraday_futopt_trades |
symbol |
session, offset, limit
|
期貨/選擇權 REST response 與台股 response 形狀不同。服務會正規化常用 option 欄位,例如 contract_type、expiration_date、strike_price、option_type 與 underlying_symbol。不要假設所有 endpoint 都有相同 envelope。
get_trading_signals 以 symbol 和選填日期範圍產生多因子訊號。訊號是資料分析輸出,不是成交保證或送單指示。
analyze_stock 位於分析服務,會使用正式日 K 並保持唯讀;詳見 帳戶、回報與分析。
-
reststock或restfutopt未初始化時應視為登入/即時初始化問題。 - API 有 business error 時,即使 HTTP 層成功也可能回傳
status: error。 - 空資料不應自動解讀為零值。
- 分析前應記錄商品、資料範圍、最後資料日期與觀測數。
Fubon API MCP Server v2.2.8 · MCP 2026-07-28 · Repository · Issues · Apache-2.0
社群專案,非富邦證券官方產品。交易前請確認參數、帳戶權限與最終券商狀態。