yahoofinance

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: BSD-3-Clause Imports: 5 Imported by: 2

README

yahoo-finance

A Go library for interacting with Yahoo Finance.

Yahoo API

Example

[nuc10 yahoo-finance] $ curl -s "https://query1.finance.yahoo.com/v8/finance/chart/amd" | jq .

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	TickerData struct {
		Results []struct {
			Meta struct {
				Currency       string  `json:"currency"`
				Symbol         string  `json:"symbol"`
				Exchange       string  `json:"exchangeName"`
				Instrument     string  `json:"instrumentType"`
				FirstTrade     int64   `json:"firstTradeDate"`
				MarketTime     int64   `json:"regularMarketTime"`
				GMTOffset      int     `json:"gmtoffset"`
				TimeZone       string  `json:"timezone"`
				TimeZoneName   string  `json:"exchangeTimezoneName"`
				MarketPrice    float64 `json:"regularMarketPrice"`
				PrevClosePrice float64 `json:"previousClose"`
			} `json:"meta"`
		} `json:"result"`
	} `json:"chart"`
}

func (*Chart) Currency added in v0.0.1

func (c *Chart) Currency() string

func (*Chart) Delta added in v0.0.1

func (c *Chart) Delta() float64

func (*Chart) DeltaPerc added in v0.0.1

func (c *Chart) DeltaPerc() float64

func (*Chart) Exchange added in v0.0.1

func (c *Chart) Exchange(symbol bool) string

func (*Chart) FirstTrade added in v0.0.1

func (c *Chart) FirstTrade() time.Time

func (*Chart) InstrumentType added in v0.0.1

func (c *Chart) InstrumentType() string

func (*Chart) MarketTime added in v0.0.1

func (c *Chart) MarketTime() time.Time

func (*Chart) PrevClosePrice added in v0.0.1

func (c *Chart) PrevClosePrice() float64

func (*Chart) Price added in v0.0.1

func (c *Chart) Price() float64

func (*Chart) Symbol added in v0.0.1

func (c *Chart) Symbol() string

type Client

type Client interface {
	Lookup(ticker string) (*Chart, error)
}

func New

func New(opts *Options) Client

type Options

type Options struct {
	HTTPClient *http.Client
}

Jump to

Keyboard shortcuts

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