Skip to content

miles170/twstock-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

665 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twstock-go

GoDoc Test Status Test Coverage Go Report Card Code Climate

台灣證券交易所 (TWSE)證券櫃檯買賣中心 (TPEx) 下載台股資料的 Go 套件。

Installation

go get github.com/miles170/twstock-go/twstock

Usage

import "github.com/miles170/twstock-go/twstock"

client := twstock.NewClient()

證券資料

下載上市及上櫃國際證券識別碼 (ISIN)

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)

指數資料

下載發行量加權股價指數 (TAIEX) 歷史資料

最早資料:1999 年 1 月

indices, err := client.MarketData.DownloadTAIEX(1999, 1)

下載櫃買指數歷史資料

最早資料:1999 年 9 月

indices, err := client.MarketData.DownloadTPExIndex(1999, 9)

License

BSD-3-Clause

About

Go library 從證券交易所及證券櫃台買賣中心抓取有價證卷資料

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages