gotd - TD Ameritrade API in Go
Table of Contents
Apply
- Go to TD Ameritrade API
- Follow this site [TD] API 申請流程
- Modify client_secret.json.sample and pass it to auth.GetClient
Installation
$ go get github.com/z-Wind/gotd
Examples
HTTP
auth := NewAuth()
client := auth.GetClient(clientsecretPath, "TDAmeritrade-go.json")
td, err := New(client)
HTTPS
auth := NewAuth()
auth.SetTLS(TLSCertPath, TLSKeyPath)
client := auth.GetClient(clientsecretPath, "TDAmeritrade-go.json")
td, err := New(client)
Quotes
call := td.Quotes.GetQuote("VTI")
quote, err := call.Do()