Stockbook is a stock crawler written in Go (Golang). It is fast, flexible, yet simple module for fetching data from Taiwan Stock Exchange(TWSE). Here express my greatest gratitude to gogrs.
To install Stockbook package, you need to install Go and set your Go workspace first.
- The first need Go installed (version 1.16+ is required), then you can use the below Go command to install Stockbook.
$ go get -u github.com/suwenyu/stockbook- Import it in your code:
import "github.com/suwenyu/stockbook"func main() {
data := stockbook.NewTWSE("2330", time.Now())
data.RetrievePrevMonth(2)
fmt.Println(data.FormatData())
}