go-finance
go-finance copied to clipboard
'index out of range' for basic GetQuote example
main.go:
package main
import (
"fmt"
finance "github.com/FlashBoys/go-finance"
)
func main() {
// 15-min delayed full quote for Apple.
q, err := finance.GetQuote("AAPL")
if err == nil {
fmt.Println(q)
}
}
$ go run main.go
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/FlashBoys/go-finance.mapFields(0xc42015a120, 0x3, 0x3, 0x29, 0x122b0c0, 0xc420035c00)
/go/src/github.com/FlashBoys/go-finance/fields.go:28 +0x737
github.com/FlashBoys/go-finance.GetQuote(0x1294dfd, 0x4, 0x50, 0xc42007cc60, 0xc42008c8c0, 0x8, 0xc4200532f0, 0x11f3298, 0x126f5c0, 0xc420086230, ...)
/go/src/github.com/FlashBoys/go-finance/quotes.go:72 +0x2b3
main.main()
/test.go:11 +0x75
exit status 2
Yahoo has shut down this service...
Let me look into it. Let me also look into getting email notifications when issues get posted to this repo...
Sigh... yahoo.
Maybe we can use the Morningstar API? https://gist.github.com/hahnicity/45323026693cdde6a116
Any other idea?
Hmm. Looks like they actually have some pretty expansive datasets available. I think short-term I'm going to fix the ailing quote snapshot api call with yahoo's new endpoint: https://query1.finance.yahoo.com/v7/finance/quote?symbols=AAPL,GE and set up a long-term goal of incorporating morningstar's data into some separate api calls. Sound good?
Sounds good to me. I didn't find this new endpoint...