從台灣證券交易所 (TWSE) 及證券櫃檯買賣中心 (TPEx) 下載台股資料的 Go 套件。
go get github.com/miles170/twstock-go/twstockimport "github.com/miles170/twstock-go/twstock"
client := twstock.NewClient()securities, err := client.Security.Download()securities, err := client.Security.DownloadTwseDelisted()櫃買中心需指定頁數(從第 0 頁開始)
securities, err := client.Security.DownloadTpexDelisted(0)quotes, err := client.Quote.DownloadTwse("2330", 2022, 8)quotes, err := client.Quote.DownloadTpex("3374", 2022, 8)quotes, err := client.Quote.Realtime("2330", "3374")marketData, err := client.MarketData.DownloadTwse(2022, 8)marketData, err := client.MarketData.DownloadTpex(2022, 8)最早資料:1999 年 1 月
indices, err := client.MarketData.DownloadTAIEX(1999, 1)最早資料:1999 年 9 月
indices, err := client.MarketData.DownloadTPExIndex(1999, 9)