twmarket
參考API

興櫃

ESB

查詢興櫃歷史資料及推薦券商個別報價.

__init__

def __init__(http: Http) -> None: ...

Initialize the source namespace with its owning HTTP transport.

history

def history(code: str, *, start: date, end: date) -> list[EmergingDaily]: ...

回傳含起訖兩日的歷史資料;無符合資料時回傳空清單.

quote

def quote(code: str) -> EmergingQuote: ...

取得最新報價;價格缺值為 None,查無快照時拋出 NoDataError.

instruments

def instruments(*, category: str | None=None) -> list[Instrument]: ...

取得最新 ISIN 目錄;category 使用來源分類名稱.

trading_restrictions

def trading_restrictions(*, kind: RestrictionKind='attention', code: str | None=None) -> list[TradingRestriction]: ...

依 kind 查詢注意、處置或最新暫停資料;code 可篩選證券.

quote_many

def quote_many(codes: Iterable[str]) -> list[BatchResult[EmergingQuote]]: ...

逐筆回傳 BatchResult,保留輸入順序、重複輸入及個別錯誤.

AsyncESB

以 await 查詢興櫃歷史資料及推薦券商個別報價.

__init__

def __init__(http: AsyncHttp) -> None: ...

Initialize the source namespace with its owning HTTP transport.

history

async def history(code: str, *, start: date, end: date) -> list[EmergingDaily]: ...

回傳含起訖兩日的歷史資料;無符合資料時回傳空清單.

quote

async def quote(code: str) -> EmergingQuote: ...

取得最新報價;價格缺值為 None,查無快照時拋出 NoDataError.

instruments

async def instruments(*, category: str | None=None) -> list[Instrument]: ...

取得最新 ISIN 目錄;category 使用來源分類名稱.

trading_restrictions

async def trading_restrictions(*, kind: RestrictionKind='attention', code: str | None=None) -> list[TradingRestriction]: ...

依 kind 查詢注意、處置或最新暫停資料;code 可篩選證券.

quote_many

async def quote_many(codes: Iterable[str]) -> list[BatchResult[EmergingQuote]]: ...

逐筆回傳 BatchResult,保留輸入順序、重複輸入及個別錯誤.

本頁目錄