alphavantage

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiRequestsPerMinLimit = 5 // 0

)

Functions

func ApiGetResponseBody

func ApiGetResponseBody(url string) ([]byte, error)

func GetCurrencyExchangeRate

func GetCurrencyExchangeRate(fromCurrency, toCurrency, apiKey string) (float64, error)

func GetStockTimeSeriesIntradayAverage

func GetStockTimeSeriesIntradayAverage(symbol, key string) (float64, error)

func IsApiAlphavantage

func IsApiAlphavantage(apiServer string) bool

func NewApiAlphavantage

func NewApiAlphavantage(apiKey string) api.StockApi

Types

type ExchangeRate

type ExchangeRate struct {
	FromCode      string `json:"1. From_Currency Code"`
	FromName      string `json:"2. From_Currency Name"`
	ToCode        string `json:"3. To_Currency Code"`
	ToName        string `json:"4. To_Currency Name"`
	ExchangeRate  string `json:"5. Exchange Rate"`
	LastRefreshed string `json:"6. Last Refreshed"`
	Timezone      string `json:"7. Time Zone"`
	BidPrice      string `json:"8. Bid Price"`
	AskPrice      string `json:"9. Ask Price"`
}

func GetCurrencyExchangeRateInfo

func GetCurrencyExchangeRateInfo(fromCurrency, toCurrency, apiKey string) (*ExchangeRate, error)

type SymbolQuote

type SymbolQuote struct {
	Symbol           string `json:"01. symbol"`
	Open             string `json:"02. open"`
	High             string `json:"03. high"`
	Low              string `json:"04. low"`
	Price            string `json:"05. price"`
	Volume           string `json:"06. volume"`
	LatestTradingDay string `json:"07. latest trading day"`
	PreviousClose    string `json:"08. previous close"`
	Change           string `json:"09. change"`
	ChangePercent    string `json:"10. change percent"`
}

func GetSymbolQuote

func GetSymbolQuote(symbol, apiKey string) (*SymbolQuote, error)

type SymbolSearchMatch

type SymbolSearchMatch struct {
	Symbol      string `json:"1. symbol"`
	Name        string `json:"2. name"`
	Type        string `json:"3. type"`
	Region      string `json:"4. region"`
	MarketOpen  string `json:"5. marketOpen"`
	MarketClose string `json:"6. marketClose"`
	Timezone    string `json:"7. timezone"`
	Currency    string `json:"8. currency"`
	MatchScore  string `json:"9. matchScore"`
}

func GetSymbolSearch

func GetSymbolSearch(symbol, apiKey string) (*SymbolSearchMatch, error)

type TimeSeries

type TimeSeries struct {
	Open   string `json:"1. open"`
	High   string `json:"2. high"`
	Low    string `json:"3. low"`
	Close  string `json:"4. close"`
	Volume string `json:"5. volume"`
}

type TimeSeriesMetaData

type TimeSeriesMetaData struct {
	Information   string `json:"1. Information"`
	Symbol        string `json:"2. Symbol"`
	LastRefreshed string `json:"3. Last Refreshed"`
	Interval      string `json:"4. Interval"`
	OutputSize    string `json:"5. Output Size"`
	TimeZone      string `json:"6. TimeZone"`
}

type TsIntraday

type TsIntraday struct {
	MetaData TimeSeriesMetaData    `json:"Meta Data"`
	Ts       map[string]TimeSeries `json:"Time Series (5min)"`
}

func GetTimeSeriesIntraday

func GetTimeSeriesIntraday(symbol, apiKey string) (*TsIntraday, error)

Jump to

Keyboard shortcuts

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