goAlphaVantage

module
v0.0.0-...-b86247b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2021 License: MIT

README

goAlphaVantage

Golang API client for AlphaVantage.


To need a key to use the API. You can get one for free here.

To install this library:

go get github.com/ClintonMorrison/goAlphaVantage

Instantiate a client:

client := alphaVantage.Client().
    Key("your-alpha-vantage-key")

Most method calls and the data they return match the documented AlphaVantage endpoints.

Examples

Getting a real time quote for Microsoft:

quote, err := client.Quote("MSFT")

// Prints "MSFT: 141.340000"
fmt.Printf("%s: %f", quote.Ticker, quote.Current) 

Printing monthly historical prices for Shopify (on the TSX):

quotes, err := client.TimeSeriesMonthlyAdjusted("TSE:SHOP")

for _, quote := range quotes.Sorted() {
    fmt.Printf("%s: %f\n", quote.Time.Format("2006-01-02"), quote.Close)
}

Directories

Path Synopsis
cmd
demo command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL