googlefinance-client-go is a Go client library for google finance.
execute:
$ go get github.com/pdevty/googlefinance-client-go
package main
import (
"context"
"fmt"
gf "github.com/pdevty/googlefinance-client-go"
"time"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
prices, err := gf.GetPrices(ctx, &gf.Query{P: "1Y", I: "86400", X: "TYO", Q: "7203"})
if err != nil {
panic(err)
}
fmt.Println(prices)
}
Refer to godoc for more infomation.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request