A stock data centered golang library
Download the library into your existing golang project
go get -u github.com/torbenconto/plutus/v2
import "github.com/torbenconto/plutus/v2"
stock, err := plutus.GetQuote("AMD")
if err != nil {
fmt.Printf("An error occured: %e", err)
}
fmt.Printf("The current price of AMD is: %f", stock.RegularMarketPrice)
import "github.com/torbenconto/plutus/v2"
import _range "github.com/torbenconto/plutus/v2/range"
import "github.com/torbenconto/plutus/v2/interval"
// Create a new historical data object using the ticker of the stock you want data on as well as the range and interval of the data.
stock, err := plutus.GetHistoricalQuote("AMD", _range.FiveDay, interval.OneMin)
if err != nil {
fmt.Printf("An error occured: %e", err)
}
// Returns a list of all the data points as structs containing the time in unix time and the price of the stock at that time.
for _, data := range stock.Data {
fmt.Println(data.Time, data.Open, data.Close, data.High, data.Low, data.Volume)
}
import "github.com/torbenconto/plutus/v2"
info, err := plutus.GetDividendInfo("T")
if err != nil {
fmt.Printf("An error occured: %s\n", err)
}
The repo containing the api and information about it is contained here plutus-api
Please use the provided examples to guide you to using plutus to it's full potential.
To run the tests for the library, simply run the following command in the root of the project.
go test ./...
Please only use this module for personal use. Don't overload my deployment or ill get really sad 🥲.