eodhistoricaldata

package module
v0.0.0-...-bf19313 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 3 Imported by: 0

README

eodhistoricaldata

eodhistoricaldata is a Go client library for eodhistoricaldata.com API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps eodhistoricaldata.com REST endpoints.

func New

func New(token string) *Client

New constructs a new Client.

func (*Client) GetHistoricalDividends

func (m *Client) GetHistoricalDividends(symbol, exchange string, opts map[string]string) ([]*Dividend, error)

GetHistoricalDividends for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/api-splits-dividends/

func (*Client) GetHistoricalShortInterest

func (m *Client) GetHistoricalShortInterest(symbol, exchange string, opts map[string]string) ([]*ShortInterest, error)

GetHistoricalShortInterest for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/api-splits-dividends/

func (*Client) GetHistoricalSplits

func (m *Client) GetHistoricalSplits(symbol, exchange string, opts map[string]string) ([]*Split, error)

GetHistoricalSplits for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/api-splits-dividends/

func (*Client) GetIntradayData

func (m *Client) GetIntradayData(symbol, exchange string, opts map[string]string) ([]*IntradayData, error)

GetIntradayData for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/intraday-historical-data-api/

func (*Client) GetOptionData

func (m *Client) GetOptionData(symbol, exchange string, opts map[string]string) (*OptionData, error)

GetOptionData gets option data for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/stock-options-data/

func (*Client) GetPrice

func (m *Client) GetPrice(symbol, exchange string) (*Price, error)

GetPrice of symbol on exchange. (20 minute delay) https://eodhistoricaldata.com/knowledgebase/live-realtime-stocks-api/

func (*Client) GetPriceEOD

func (m *Client) GetPriceEOD(symbol, exchange string, opts map[string]string) ([]*PriceEOD, error)

GetPriceEOD get end of day prices for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/api-for-historical-data-and-volumes/

func (*Client) GetSymbolsForExchange

func (m *Client) GetSymbolsForExchange(exchange string) ([]*Symbol, error)

GetSymbolsForExchange gets a list of symbols for exchange. https://eodhistoricaldata.com/knowledgebase/list-symbols-exchange/

func (*Client) GetTechnicalIndicator

func (m *Client) GetTechnicalIndicator(symbol, exchange, function string, period int, opts map[string]string) ([]*TechnicalIndicator, error)

GetTechnicalIndicator for symbol on exchange. https://eodhistoricaldata.com/knowledgebase/technical-indicators-api/

type Dividend

type Dividend struct {
	Date            string `json:"date"`
	DeclarationDate string `json:"declarationDate"`
	PaymentDate     string `json:"paymentDate"`
	RecordDate      string `json:"recordDate"`
	Value           string `json:"value"`
}

Dividend models a response from /api/div/:symbol

type IntradayData

type IntradayData struct {
	AdjustedClose float64 `json:"adjusted_close"`
	Close         float64 `json:"close"`
	Datetime      string  `json:"datetime"`
	Gmtoffset     int     `json:"gmtoffset"`
	High          float64 `json:"high"`
	Low           float64 `json:"low"`
	Open          float64 `json:"open"`
	Timestamp     int     `json:"timestamp"`
	Volume        int     `json:"volume"`
}

IntradayData models a response from /api/intraday/:symbol

type OptionContract

type OptionContract struct {
	ContractName      string `json:"contractName"`
	ContractSize      string `json:"contractSize"`
	Currency          string `json:"currency"`
	Type              string `json:"type"`
	InTheMoney        string `json:"inTheMoney"`
	LastTradeDateTime string `json:"lastTradeDateTime"`
	ExpirationDate    string `json:"expirationDate"`
	Strike            string `json:"strike"`
	LastPrice         string `json:"lastPrice"`
	Bid               string `json:"bid"`
	Ask               string `json:"ask"`
	Change            string `json:"change"`
	ChangePercent     string `json:"changePercent"`
	Volume            int    `json:"volume"`
	OpenInterest      int    `json:"openInterest"`
	ImpliedVolatility string `json:"impliedVolatility"`
	Delta             string `json:"delta"`
	Gamma             string `json:"gamma"`
	Theta             string `json:"theta"`
	Vega              string `json:"vega"`
	Rho               string `json:"rho"`
	Theoretical       string `json:"theoretical"`
	IntrinsicValue    string `json:"intrinsicValue"`
	TimeValue         string `json:"timeValue"`
	UpdatedAt         string `json:"updatedAt"`
}

OptionContract holds data about an option contract.

type OptionData

type OptionData struct {
	Code     string `json:"code"`
	Exchange string `json:"exchange"`
	Data     []*struct {
		ExpirationDate string `json:"expirationDate"`
		Options        struct {
			Put  []*OptionContract `json:"PUT"`
			Call []*OptionContract `json:"CALL"`
		} `json:"options"`
	} `json:"data"`
}

OptionData models a response from /api/options/:symbol

type Price

type Price struct {
	Change           float64 `json:"change"`
	ChangePercentage float64 `json:"change_p"`
	Close            float64 `json:"close"`
	Code             string  `json:"code"`
	GMTOffset        int     `json:"gmtoffset"`
	High             float64 `json:"high"`
	Low              float64 `json:"low"`
	Open             float64 `json:"open"`
	PreviousClose    float64 `json:"previousClose"`
	Timestamp        int     `json:"timestamp"`
	Volume           int     `json:"volume"`
}

Price models a response from /api/real-time/:symbol

type PriceEOD

type PriceEOD struct {
	AdjustedClose float64 `json:"adjusted_close"`
	Close         float64 `json:"close"`
	Date          string  `json:"date"`
	High          float64 `json:"high"`
	Low           float64 `json:"low"`
	Open          float64 `json:"open"`
	Volume        int     `json:"volume"`
}

PriceEOD models a response from /api/eod/:symbol

type ShortInterest

type ShortInterest struct {
	Date   string `json:"date"`
	Short  int    `json:"short"`
	Volume int    `json:"volume"`
}

ShortInterest models a response from /api/shorts/:symbol

type Split

type Split struct {
	Date  string `json:"date"`
	Split string `json:"split"`
}

Split models a repsonse from /api/splits/:symbol

type Symbol

type Symbol struct {
	Code     string
	Name     string
	Country  string
	Exchange string
	Currency string
	Type     string
}

Symbol models an item from /api/exchanges/:exchange

type TechnicalIndicator

type TechnicalIndicator struct {
	Date          string  `json:"string"`
	AverageVolume float64 `json:"avgvol"`
	SMA           float64 `json:"sma"`
	EMA           float64 `json:"ema"`
	WMA           float64 `json:"wma"`
	RSI           float64 `json:"rsi"`
}

TechnicalIndicator models an item from /api/technical/:symbol

Jump to

Keyboard shortcuts

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