從證券交易所 (TWSE) 及證券櫃台買賣中心 (TPEX) 抓取有價證卷資料
twstock-go is compatible with modern Go releases in module mode, with Go installed:
go get github.com/miles170/twstock-go/twstock
import "github.com/miles170/twstock-go/twstock"
client := twstock.NewClient()
securities, err := client.Security.Download()
securities, err := client.Security.DownloadTwseDelisted()
櫃買中心查詢下櫃證卷資料需要指定頁數
securities, err := client.Security.DownloadTpexDelisted(0)
quotes, err := client.Quote.DownloadTwse("2330", 2022, 8)
quotes, err := client.Quote.Realtime("2330", "3374")
marketData, err := client.MarketData.DownloadTwse(2022, 8)
marketData, err := client.MarketData.DownloadTpex(2022, 8)