goiex

package module
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 11 Imported by: 0

README

go-iex

GoDoc releases Go Report Card gopherbadger-tag-do-not-edit

ATTRIBUTION

Data provided by IEX

DESCRIPTION

Client interface to IEX trading API.

ENV

TEST
export IEX_TEST_SECRET_TOKEN=Tsk_ahsvyao12u4u0ausvn1o3rhw988120yf_FAKE
export IEX_TEST_PUBLISHABLE_TOKEN=Tpk_la091720ihakbso128uihotbfao_FAKE
PRODUCTION
export IEX_SECRET_TOKEN=Tsk_ahsvyao12u4u0ausvn1o3rhw988120yf_REAL
export IEX_PUBLISHABLE_TOKEN=Tpk_la091720ihakbso128uihotbfao_REAL

DEV NOTES

  • Use this online json to struct converter to save time
  • Use make test to run test suite
  • Use make coverage to update README.md coverage badge (install coverage tool first go get github.com/jpoles1/gopherbadger)

USAGE

See examples/

SUPPORTED ENDPOINTS

Expand to see supported endpoints
Introduction
  • Batch Requests
Account
  • Metadata
  • Usage
  • Pay as you go
  • Message Budget
  • Signed Requests
  • Setting up signed token
  • Getting the secret for a signed token
API System Metadata
  • Status
Data APIS
  • Data Points
  • Data Tables
  • Time Series
Stock Prices
  • Book
  • Charts
  • Delayed Quote
  • Extended Hours Quote (included as part of Quote response)
  • Historical Prices
  • Intraday Prices
  • Largest Trades
  • Open / Close Price
  • OHLC
  • Previous Day Price
  • Price Only
  • Quote
  • Real-time Quote (included as part of Quote response)
  • Volume by Venue
Stock Profiles
  • Company
  • Insider Roster
  • Insider Summary
  • Insider Transactions
  • Logo
  • Peer Groups
Stock Fundamentals
  • Balance Sheet
  • Cash Flow
  • Dividends (Basic)
  • Earnings
  • Financials
  • Financials As Reported
  • Income Statement
  • SEC Filings
  • Splits (Basic)
Stock Research
  • Advanced Stats
  • Analyst Recommendations (see RecommendationTrends)
  • Estimates
  • Fund Ownership
  • Institutional Ownership
  • Key Stats
  • Price Target
  • Technical Indicators
Corporate Actions
  • Bonus Issue
  • Distribution
  • Dividends
  • Return of Capital
  • Rights Issue
  • Right to Purchase
  • Security Reclassification
  • Security Swap
  • Spinoff
  • Splits
Market Info
  • Collections
  • Earnings Today
  • IPO Calendar
  • List
  • Market Volume (U.S.)
  • Sector Performance
  • Upcoming Events
News
  • News
  • Streaming News
  • Historical News
Cryptocurrency
  • Cryptocurrency Book
  • Cryptocurrency Event
  • Cryptocurrency Price
  • Cryptocurrency Quote
Forex / Currencies
  • Real-time Streaming
  • Latest Currency Rates
  • Currency Conversion
  • Historical Daily
Options
  • End of Day Options
Social Sentiment
  • Social Sentiment
CEO Compensation
  • CEO Compensation
Treasures
  • Daily Treasury Rates
Commodities
  • Oil Prices
  • Natural Gas Price
  • Heating Oil Prices
  • Jet Fuel Prices
  • Diesel Prices
  • Diesel Price
  • Gas Prices
  • Propane Prices
Economic Data
  • CD Rates
  • Consumer Price Index
  • Credit Card Interest Rate
  • Federal Fund Rates
  • Real GDP
  • Institutional Money Funds
  • Initial Claims
  • Industrial Production Index
  • Mortgage Rates
  • Total Housing Starts
  • Total Payrolls
  • Total Vehicle Sales
  • Retail Money Funds
  • Unemployment Rate
  • US Recession Probabilities
Reference Data
  • Search
  • Cryptocurrency Symbols
  • FX Symbols
  • IEX Symbols
  • International Symbols
  • International Exchanges
  • ISIN Mapping
  • Mutual Fund Symbols
  • Options Symbols
  • OTC Symbols
  • Sectors
  • Symbols
  • Tags
  • U.S. Exchanges
  • U.S. Holidays and Trading Dates
Investors Exchange Data
  • DEEP
  • DEEP Auction
  • DEEP Book
  • DEEP Operational Halt Status
  • DEEP Official Price
  • DEEP Security Event
  • DEEP Short Sale Price Test Status
  • DEEP System Event
  • DEEP Trades
  • DEEP Trade Break
  • DEEP Trading Status
  • Last
  • Listed Regulation SHO Threshold Securities List
  • Listed Short Interest List In Dev
  • Stats Historical Daily In Dev
  • Stats Historical Summary
  • Stats Intraday
  • Stats Recent
  • Stats Records
  • TOPS

Documentation

Index

Constants

View Source
const (
	// SandboxBaseURL use this as URL base if you do not want your account
	// message limits affected on IEX cloud
	SandboxBaseURL string = "https://sandbox.iexapis.com/"
	// DefaultBaseURL default base URL
	DefaultBaseURL string = "https://cloud.iexapis.com/"
	// DefaultVersion default IEX API version
	DefaultVersion string = "stable"
)

Variables

This section is empty.

Functions

func DefaultBackoff

func DefaultBackoff(min, max time.Duration, attempts int, resp *http.Response) time.Duration

DefaultBackoff defines the wait time as a exponential backoff

func DefaultRetryPolicy

func DefaultRetryPolicy(resp *http.Response, err error) (bool, error)

DefaultRetryPolicy defines a retry on status codes 0, 429, and >= 500

Types

type APISystemMetadata

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

APISystemMetadata struct to interface with / endpoints

func NewAPISystemMetadata

func NewAPISystemMetadata(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *APISystemMetadata

NewAPISystemMetadata return new APISystemMetadata

func (*APISystemMetadata) APIURL

func (a *APISystemMetadata) APIURL() *url.URL

APIURL return APIURL

func (*APISystemMetadata) Client

func (a *APISystemMetadata) Client() *http.Client

Client return HTTP client

func (*APISystemMetadata) Retry

func (a *APISystemMetadata) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*APISystemMetadata) Status

func (a *APISystemMetadata) Status() (status *Status, err error)

Status GET /status

func (*APISystemMetadata) Token

func (a *APISystemMetadata) Token() string

Token return token string

func (*APISystemMetadata) URL

func (a *APISystemMetadata) URL() *url.URL

URL return URL base

func (*APISystemMetadata) Version

func (a *APISystemMetadata) Version() string

Version return version string

type Account

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

Account struct to interface with /account endpoints

func NewAccount

func NewAccount(token, version string, base *url.URL, httpClient *http.Client, options ...IEXOption) *Account

NewAccount return new Account

func (*Account) APIURL

func (a *Account) APIURL() *url.URL

APIURL return APIURL

func (*Account) Client

func (a *Account) Client() *http.Client

Client return HTTP client

func (*Account) MessageBudget

func (a *Account) MessageBudget(params interface{}) (ifc interface{}, err error)

MessageBudget POST /account/messagebudget

func (*Account) Metadata

func (a *Account) Metadata() (metadata *Metadata, err error)

Metadata GET /account/metadata

func (*Account) Payasyougo

func (a *Account) Payasyougo(params interface{}) (ifc interface{}, err error)

Payasyougo POST /account/payasyougo

func (*Account) Retry

func (a *Account) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*Account) Token

func (a *Account) Token() string

Token return token string

func (*Account) URL

func (a *Account) URL() *url.URL

URL return URL base

func (*Account) Usage

func (a *Account) Usage() (usage *Usage, err error)

Usage GET /account/usage No support for GET /account/usage/{type}

func (*Account) Version

func (a *Account) Version() string

Version return version string

type AdvancedStat

type AdvancedStat struct {
	KeyStat
	TotalCash                int64       `json:"totalCash"`
	CurrentDebt              int64       `json:"currentDebt"`
	Revenue                  int64       `json:"revenue"`
	GrossProfit              int64       `json:"grossProfit"`
	TotalRevenue             int64       `json:"totalRevenue"`
	EBITDA                   int64       `json:"EBITDA"`
	RevenuePerShare          float64     `json:"revenuePerShare"`
	RevenuePerEmployee       float64     `json:"revenuePerEmployee"`
	DebtToEquity             float64     `json:"debtToEquity"`
	ProfitMargin             float64     `json:"profitMargin"`
	EnterpriseValue          int64       `json:"enterpriseValue"`
	EnterpriseValueToRevenue float64     `json:"enterpriseValueToRevenue"`
	PriceToSales             float64     `json:"priceToSales"`
	PriceToBook              float64     `json:"priceToBook"`
	ForwardPERatio           interface{} `json:"forwardPERatio"`
	PegRatio                 float64     `json:"pegRatio"`
}

AdvancedStat struct

type Asks

type Asks []struct {
	Price     float64 `json:"price"`
	Size      int     `json:"size"`
	Timestamp int64   `json:"timestamp"`
}

Asks struct

type Backoff

type Backoff func(min, max time.Duration, attempts int, resp *http.Response) time.Duration

Backoff defines the wait time between retry requests

type Backoffer

type Backoffer interface {
	Backoff(min, max time.Duration, attempts int, retry *http.Response) time.Duration
}

Backoffer is the interface to define a wait time in Backoff method.

type BalanceSheet

type BalanceSheet struct {
	Symbol       string `json:"symbol"`
	BalanceSheet []struct {
		ReportDate              string      `json:"reportDate"`
		CurrentCash             int64       `json:"currentCash"`
		ShortTermInvestments    int64       `json:"shortTermInvestments"`
		Receivables             int64       `json:"receivables"`
		Inventory               int64       `json:"inventory"`
		OtherCurrentAssets      int64       `json:"otherCurrentAssets"`
		CurrentAssets           int64       `json:"currentAssets"`
		LongTermInvestments     int64       `json:"longTermInvestments"`
		PropertyPlantEquipment  int64       `json:"propertyPlantEquipment"`
		Goodwill                interface{} `json:"goodwill"`
		IntangibleAssets        interface{} `json:"intangibleAssets"`
		OtherAssets             int64       `json:"otherAssets"`
		TotalAssets             int64       `json:"totalAssets"`
		AccountsPayable         int64       `json:"accountsPayable"`
		CurrentLongTermDebt     int64       `json:"currentLongTermDebt"`
		OtherCurrentLiabilities int64       `json:"otherCurrentLiabilities"`
		TotalCurrentLiabilities int64       `json:"totalCurrentLiabilities"`
		LongTermDebt            int64       `json:"longTermDebt"`
		OtherLiabilities        int64       `json:"otherLiabilities"`
		MinorityInterest        int         `json:"minorityInterest"`
		TotalLiabilities        int64       `json:"totalLiabilities"`
		CommonStock             int64       `json:"commonStock"`
		RetainedEarnings        int64       `json:"retainedEarnings"`
		TreasuryStock           interface{} `json:"treasuryStock"`
		CapitalSurplus          interface{} `json:"capitalSurplus"`
		ShareholderEquity       int64       `json:"shareholderEquity"`
		NetTangibleAssets       int64       `json:"netTangibleAssets"`
	} `json:"balancesheet"`
}

BalanceSheet struct

type BalanceSheetParams

type BalanceSheetParams struct {
	// Period specify either "annual" or "quarter" with PeriodQueryParameter
	Period PeriodQueryParameter `url:"period"`
	// Last with "quarter" period can specify up to 12 and up to 4 with "annual" period
	Last int `url:"last"`
}

BalanceSheetParams query parameters

type Batch

type Batch struct {
	Quote Quote
	News  News
	Chart []Chart
}

Batch struct

type Bids

type Bids []struct {
	Price     float64 `json:"price"`
	Size      int     `json:"size"`
	Timestamp int64   `json:"timestamp"`
}

Bids struct

type Book

type Book struct {
	Asks        Asks
	Bids        Bids
	Quote       Quote
	Trades      Trades
	SystemEvent SystemEvent
}

Book struct

type CashFlow

type CashFlow struct {
	Symbol   string `json:"symbol"`
	CashFlow []struct {
		ReportDate              string      `json:"reportDate"`
		NetIncome               int64       `json:"netIncome"`
		Depreciation            int64       `json:"depreciation"`
		ChangesInReceivables    int64       `json:"changesInReceivables"`
		ChangesInInventories    int         `json:"changesInInventories"`
		CashChange              int64       `json:"cashChange"`
		CashFlow                int64       `json:"cashFlow"`
		CapitalExpenditures     int64       `json:"capitalExpenditures"`
		Investments             int         `json:"investments"`
		InvestingActivityOther  int         `json:"investingActivityOther"`
		TotalInvestingCashFlows int64       `json:"totalInvestingCashFlows"`
		DividendsPaid           int64       `json:"dividendsPaid"`
		NetBorrowings           int         `json:"netBorrowings"`
		OtherFinancingCashFlows int         `json:"otherFinancingCashFlows"`
		CashFlowFinancing       int64       `json:"cashFlowFinancing"`
		ExchangeRateEffect      interface{} `json:"exchangeRateEffect"`
	} `json:"cashflow"`
}

CashFlow struct

type CashFlowQueryParams

type CashFlowQueryParams struct {
	Period PeriodQueryParameter `url:"period"`
	Last   uint                 `url:"last,omitempty"`
}

CashFlowQueryParams optional query parameters

type Chart

type Chart struct {
	Date           string  `json:"date"`
	Open           float64 `json:"open"`
	High           float64 `json:"high"`
	Low            float64 `json:"low"`
	Close          float64 `json:"close"`
	Volume         int     `json:"volume"`
	UOpen          float64 `json:"uOpen"`
	UHigh          float64 `json:"uHigh"`
	ULow           float64 `json:"uLow"`
	UClose         float64 `json:"uClose"`
	UVolume        int     `json:"uVolume"`
	Change         float64 `json:"change"`
	ChangePercent  float64 `json:"changePercent"`
	Label          string  `json:"label"`
	ChangeOverTime float64 `json:"changeOverTime"`
}

Chart struct

type ChartQueryParams

type ChartQueryParams struct {
	ChartCloseOnly  bool       `url:"chartCloseOnly,omitempty"`
	ChartByDay      bool       `url:"chartByDay,omitempty"`
	ChartSimplify   bool       `url:"chartSimplify,omitempty"`
	ChartInterval   uint       `url:"chartInterval,omitempty"`
	ChangeFromClose bool       `url:"changeFromClose,omitempty"`
	ChartLast       uint       `url:"chartLast,omitempty"`
	Range           ChartRange `url:"range,omitempty"`
	// ExactDate date formatted as YYYYMMDD
	ExactDate string `url:"exactDate,omitempty"`
	// Sort can be `asc` or `desc`. Defaults to `desc`.
	Sort string `url:"sort,omitempty"`
	// IncludeToday appends current trading to data
	IncludeToday bool `url:"includeToday,omitempty"`
}

ChartQueryParams optional query parameters

type ChartRange

type ChartRange int

ChartRange for Chart API

const (
	// ChartRangeMax chart range
	ChartRangeMax ChartRange = iota
	// ChartRangeFiveYear chart range
	ChartRangeFiveYear
	// ChartRangeTwoYear chart range
	ChartRangeTwoYear
	// ChartRangeOneYear chart range
	ChartRangeOneYear
	// ChartRangeYearToDate chart range
	ChartRangeYearToDate
	// ChartRangeSixMonth chart range
	ChartRangeSixMonth
	// ChartRangeThreeMonth chart range
	ChartRangeThreeMonth
	// ChartRangeOneMonth chart range
	ChartRangeOneMonth
	// ChartRangeOneDay chart range
	ChartRangeOneDay
)

func (ChartRange) String

func (cr ChartRange) String() string

type Client

type Client struct {

	// IEX Cloud APIs
	*Account
	*APISystemMetadata
	*Commodities
	*Cryptocurrency
	*DataAPI
	*EconomicData
	*Forex
	*InvestorsExchangeData
	*ReferenceData
	*Stock
	// contains filtered or unexported fields
}

Client API struct to IEX

func NewClient

func NewClient(token string, options ...ClientOption) (*Client, error)

NewClient creates client interface to IEX Cloud APIs

func NewSandboxClient

func NewSandboxClient(token string, options ...ClientOption) (*Client, error)

NewSandboxClient creates sandbox client interface to IEX Cloud APIs

func (*Client) APIURL

func (c *Client) APIURL() *url.URL

APIURL return APIURL

func (*Client) Client

func (c *Client) Client() *http.Client

Client return HTTP client

func (*Client) Get

func (c *Client) Get(endpoint string, response, params interface{}) error

Get helper func to make custom GET requests against client's base url

func (*Client) Post

func (c *Client) Post(endpoint string, response interface{}, params map[string]interface{}) error

Post helper func to make custom POST requests against client's base url

func (*Client) Retry

func (c *Client) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*Client) Token

func (c *Client) Token() string

Token return token string

func (*Client) URL

func (c *Client) URL() *url.URL

URL return URL base

func (*Client) Version

func (c *Client) Version() string

Version return version string

type ClientOption

type ClientOption func(*Client) error

ClientOption is a func that operates on *Client

func SetAPISystemMetadata

func SetAPISystemMetadata(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetAPISystemMetadata set new APISystemMetadata

func SetAPIURL

func SetAPIURL(rawurl string) ClientOption

SetAPIURL assigns API URL

func SetAccount

func SetAccount(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetAccount set new Account

func SetClientRetry

func SetClientRetry(retries ...*Retry) ClientOption

SetClientRetry enables HTTP request retries with default Retry or first Retry parameter given method ignores all other Retry in variadic param

func SetCommodities

func SetCommodities(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetCommodities set new Commodities

func SetCryptocurrency

func SetCryptocurrency(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetCryptocurrency set new Cryptocurrency

func SetDataAPI

func SetDataAPI(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetDataAPI set new DataAPI

func SetEconomicData

func SetEconomicData(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetEconomicData set new EconomicData

func SetForex

func SetForex(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetForex set new Forex

func SetHTTPClient

func SetHTTPClient(httpClient *http.Client) ClientOption

SetHTTPClient assigns HTTP client

func SetInvestorsExchangeData

func SetInvestorsExchangeData(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetInvestorsExchangeData set new InvestorsExchangeData

func SetReferenceData

func SetReferenceData(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetReferenceData set new ReferenceData

func SetStock

func SetStock(token, version string, url *url.URL, httpClient *http.Client) ClientOption

SetStock set new Stock

func SetToken

func SetToken(token string) ClientOption

SetToken assigns secret token

func SetURL

func SetURL(rawurl string) ClientOption

SetURL assigns URL base

func SetVersion

func SetVersion(version string) ClientOption

SetVersion set IEX version

type Collection

type Collection []struct {
	Quote
}

Collection struct

type CollectionQueryParams

type CollectionQueryParams struct {
	CollectionName string `url:"collectionName"`
}

CollectionQueryParams required/optional query parameters

type CollectionType

type CollectionType int

CollectionType for Collection API

const (
	// CollectionSector for sectors
	CollectionSector CollectionType = iota
	// CollectionTag for tags
	CollectionTag
	// CollectionList for lists
	CollectionList
)

func (CollectionType) String

func (ct CollectionType) String() string

type Commodities

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

Commodities struct to interface with /data-points endpoints

func NewCommodities

func NewCommodities(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *Commodities

NewCommodities return new Commodities

func (*Commodities) APIURL

func (c *Commodities) APIURL() *url.URL

APIURL return APIURL

func (*Commodities) Client

func (c *Commodities) Client() *http.Client

Client return HTTP client

func (*Commodities) CommoditiesPrices

func (c *Commodities) CommoditiesPrices(symbol string) (value interface{}, err error)

CommoditiesPrices GET /data-points/market/{symbol}

func (*Commodities) Retry

func (c *Commodities) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*Commodities) Token

func (c *Commodities) Token() string

Token return token string

func (*Commodities) URL

func (c *Commodities) URL() *url.URL

URL return URL base

func (*Commodities) Version

func (c *Commodities) Version() string

Version return version string

type Company

type Company struct {
	Symbol      string   `json:"symbol"`
	CompanyName string   `json:"companyName"`
	Employees   int      `json:"employees"`
	Exchange    string   `json:"exchange"`
	Industry    string   `json:"industry"`
	Website     string   `json:"website"`
	Description string   `json:"description"`
	CEO         string   `json:"CEO"`
	IssueType   string   `json:"issueType"`
	Sector      string   `json:"sector"`
	Tags        []string `json:"tags"`
}

Company struct

type CryptoBook

type CryptoBook struct {
	Bids []struct {
		Price     string `json:"price"`
		Size      string `json:"size"`
		Timestamp int64  `json:"timestamp"`
	} `json:"bids"`
	Asks []struct {
		Price     string `json:"price"`
		Size      string `json:"size"`
		Timestamp int64  `json:"timestamp"`
	} `json:"asks"`
}

CryptoBook struct

type CryptoPrice

type CryptoPrice struct {
	Symbol string  `json:"symbol"`
	Price  float64 `json:"price,string"`
}

CryptoPrice struct

type CryptoQuote

type CryptoQuote struct {
	Symbol           string  `json:"symbol"`
	Sector           string  `json:"sector"`
	CalculationPrice string  `json:"calculationPrice"`
	LatestPrice      float64 `json:"latestPrice,string"`
	LatestSource     string  `json:"latestSource"`
	LatestUpdate     int64   `json:"latestUpdate"`
	LatestVolume     float64 `json:"latestVolume,string"`
	BidPrice         float64 `json:"bidPrice,string"`
	BidSize          float64 `json:"bidSize,string"`
	AskPrice         float64 `json:"askPrice,string"`
	AskSize          float64 `json:"askSize,string"`
	High             float64 `json:"high,string"`
	Low              float64 `json:"low,string"`
	PreviousClose    float64 `json:"previousClose,string"`
}

CryptoQuote struct

type Cryptocurrency

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

Cryptocurrency struct to interface with / endpoints

func NewCryptocurrency

func NewCryptocurrency(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *Cryptocurrency

NewCryptocurrency returns new Cryptocurrency

func (*Cryptocurrency) APIURL

func (c *Cryptocurrency) APIURL() *url.URL

APIURL return APIURL

func (*Cryptocurrency) Client

func (c *Cryptocurrency) Client() *http.Client

Client return HTTP client

func (*Cryptocurrency) CryptoBook

func (c *Cryptocurrency) CryptoBook(symbol string) (cb *CryptoBook, err error)

CryptoBook GET /crypto/{symbol}/book

func (*Cryptocurrency) CryptoPrice

func (c *Cryptocurrency) CryptoPrice(symbol string) (cp *CryptoPrice, err error)

CryptoPrice GET /crypto/{symbol}/price

func (*Cryptocurrency) CryptoQuote

func (c *Cryptocurrency) CryptoQuote(symbol string) (cq *CryptoQuote, err error)

CryptoQuote GET /crypto/{symbol}/quote

func (*Cryptocurrency) Retry

func (c *Cryptocurrency) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*Cryptocurrency) Token

func (c *Cryptocurrency) Token() string

Token return token string

func (*Cryptocurrency) URL

func (c *Cryptocurrency) URL() *url.URL

URL return URL base

func (*Cryptocurrency) Version

func (c *Cryptocurrency) Version() string

Version return version string

type CurrencyConversion

type CurrencyConversion []struct {
	Symbol    string  `json:"symbol"`
	Rate      float64 `json:"rate"`
	Timestamp int64   `json:"timestamp"`
	Amount    float64 `json:"amount"`
}

CurrencyConversion struct

type CurrencyConversionParams

type CurrencyConversionParams struct {
	Symbols string `url:"symbols"`
	Amount  int    `url:"amount"`
}

CurrencyConversionParams required/optional query parameters

type DEEP

type DEEP struct {
	Symbol        string  `json:"symbol"`
	MarketPercent float64 `json:"marketPercent"`
	Volume        int     `json:"volume"`
	LastSalePrice float64 `json:"lastSalePrice"`
	LastSaleSize  int     `json:"lastSaleSize"`
	LastSaleTime  int64   `json:"lastSaleTime"`
	LastUpdated   int64   `json:"lastUpdated"`
	Bids          []struct {
		Price     float64 `json:"price"`
		Size      int     `json:"size"`
		Timestamp int64   `json:"timestamp"`
	} `json:"bids"`
	Asks []struct {
		Price     float64 `json:"price"`
		Size      int     `json:"size"`
		Timestamp int64   `json:"timestamp"`
	} `json:"asks"`
	SystemEvent struct {
		SystemEvent string `json:"systemEvent"`
		Timestamp   int64  `json:"timestamp"`
	} `json:"systemEvent"`
	TradingStatus struct {
		Status    string `json:"status"`
		Reason    string `json:"reason"`
		Timestamp int64  `json:"timestamp"`
	} `json:"tradingStatus"`
	OpHaltStatus struct {
		IsHalted  bool  `json:"isHalted"`
		Timestamp int64 `json:"timestamp"`
	} `json:"opHaltStatus"`
	SsrStatus struct {
		IsSSR     bool   `json:"isSSR"`
		Detail    string `json:"detail"`
		Timestamp int64  `json:"timestamp"`
	} `json:"ssrStatus"`
	SecurityEvent struct {
		SecurityEvent string `json:"securityEvent"`
		Timestamp     int64  `json:"timestamp"`
	} `json:"securityEvent"`
	Trades []struct {
		Price                 float64 `json:"price"`
		Size                  int     `json:"size"`
		TradeID               int     `json:"tradeId"`
		IsISO                 bool    `json:"isISO"`
		IsOddLot              bool    `json:"isOddLot"`
		IsOutsideRegularHours bool    `json:"isOutsideRegularHours"`
		IsSinglePriceCross    bool    `json:"isSinglePriceCross"`
		IsTradeThroughExempt  bool    `json:"isTradeThroughExempt"`
		Timestamp             int64   `json:"timestamp"`
	} `json:"trades"`
	TradeBreaks []struct {
		Price                 float64 `json:"price"`
		Size                  int     `json:"size"`
		TradeID               int     `json:"tradeId"`
		IsISO                 bool    `json:"isISO"`
		IsOddLot              bool    `json:"isOddLot"`
		IsOutsideRegularHours bool    `json:"isOutsideRegularHours"`
		IsSinglePriceCross    bool    `json:"isSinglePriceCross"`
		IsTradeThroughExempt  bool    `json:"isTradeThroughExempt"`
		Timestamp             int64   `json:"timestamp"`
	} `json:"tradeBreaks"`
	Auction struct {
		AuctionType          string  `json:"auctionType"`
		PairedShares         int     `json:"pairedShares"`
		ImbalanceShares      int     `json:"imbalanceShares"`
		ReferencePrice       float64 `json:"referencePrice"`
		IndicativePrice      float64 `json:"indicativePrice"`
		AuctionBookPrice     float64 `json:"auctionBookPrice"`
		CollarReferencePrice float64 `json:"collarReferencePrice"`
		LowerCollarPrice     float64 `json:"lowerCollarPrice"`
		UpperCollarPrice     float64 `json:"upperCollarPrice"`
		ExtensionNumber      int     `json:"extensionNumber"`
		StartTime            string  `json:"startTime"`
		LastUpdate           int64   `json:"lastUpdate"`
	} `json:"auction"`
}

DEEP struct

type DEEPParams

type DEEPParams struct {
	Symbols string `url:"symbols"`
}

DEEPParams required/optional query parameters

type DataAPI

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

DataAPI struct to interface with DataAPI endpoints

func NewDataAPI

func NewDataAPI(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *DataAPI

NewDataAPI return new DataAPI

func (*DataAPI) APIURL

func (d *DataAPI) APIURL() *url.URL

APIURL return APIURL

func (*DataAPI) Client

func (d *DataAPI) Client() *http.Client

Client return HTTP client

func (*DataAPI) DataPoint

func (d *DataAPI) DataPoint(symbol, datapoint string) (ifc interface{}, err error)

DataPoint GET /data-points/{symbol}/{datapoint}

func (*DataAPI) DataPoints

func (d *DataAPI) DataPoints(symbol string) (datapoints []*DataPoint, err error)

DataPoints GET /data-points/{symbol}

func (*DataAPI) Retry

func (d *DataAPI) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*DataAPI) Token

func (d *DataAPI) Token() string

Token return token string

func (*DataAPI) URL

func (d *DataAPI) URL() *url.URL

URL return URL base

func (*DataAPI) Version

func (d *DataAPI) Version() string

Version return version string

type DataPoint

type DataPoint struct {
	Key         string    `json:"key"`
	Weight      int       `json:"weight"`
	Description string    `json:"description"`
	LastUpdated time.Time `json:"lastUpdated"`
}

DataPoint struct

type DelayedQuote

type DelayedQuote struct {
	Symbol           string  `json:"symbol"`
	DelayedPrice     float64 `json:"delayedPrice"`
	DelayedSize      int     `json:"delayedSize"`
	DelayedPriceTime int64   `json:"delayedPriceTime"`
	High             float64 `json:"high"`
	Low              float64 `json:"low"`
	TotalVolume      int     `json:"totalVolume"`
	ProcessedTime    int64   `json:"processedTime"`
}

DelayedQuote struct

type DividendRange

type DividendRange int

DividendRange for Dividend API

const (
	// DividendRangeFiveYear dividend range
	DividendRangeFiveYear DividendRange = iota
	// DividendRangeTwoYear dividend range
	DividendRangeTwoYear
	// DividendRangeOneYear dividend range
	DividendRangeOneYear
	// DividendRangeYearToDate dividend range
	DividendRangeYearToDate
	// DividendRangeSixMonth dividend range
	DividendRangeSixMonth
	// DividendRangeThreeMonth dividend range
	DividendRangeThreeMonth
	// DividendRangeOneMonth dividend range
	DividendRangeOneMonth
	// DividendRangeNext dividend range
	DividendRangeNext
)

func (DividendRange) String

func (dr DividendRange) String() string

type Dividends

type Dividends []struct {
	Symbol       string  `json:"symbol"`
	ExDate       string  `json:"exDate"`
	PaymentDate  string  `json:"paymentDate"`
	RecordDate   string  `json:"recordDate"`
	DeclaredDate string  `json:"declaredDate"`
	Amount       float64 `json:"amount,string"`
	Flag         string  `json:"flag"`
	Currency     string  `json:"currency"`
	Description  string  `json:"description"`
	Frequency    string  `json:"frequency"`
}

Dividends struct {

type Earning

type Earning struct {
	ActualEPS            float64 `json:"actualEPS"`
	ConsensusEPS         float64 `json:"consensusEPS"`
	AnnounceTime         string  `json:"announceTime"`
	NumberOfEstimates    int     `json:"numberOfEstimates"`
	EPSSurpriseDollar    float64 `json:"EPSSurpriseDollar"`
	EPSReportDate        string  `json:"EPSReportDate"`
	FiscalPeriod         string  `json:"fiscalPeriod"`
	FiscalEndDate        string  `json:"fiscalEndDate"`
	YearAgo              float64 `json:"yearAgo"`
	YearAgoChangePercent float64 `json:"yearAgoChangePercent"`
}

Earning DTO for APIs reporting earnings

func (*Earning) UnmarshalJSON

func (e *Earning) UnmarshalJSON(b []byte) error

UnmarshalJSON helper

type Earnings

type Earnings struct {
	Symbol   string    `json:"symbol"`
	Earnings []Earning `json:"earnings"`
}

Earnings struct

type EarningsQueryParams

type EarningsQueryParams struct {
	Last   uint                 `url:"last,omitempty"`
	Period PeriodQueryParameter `url:"period"`
}

EarningsQueryParams required/optional query parameters

type EarningsToday

type EarningsToday struct {
	BTO   []EarningsTodayDTO `json:"bto"`
	AMC   []EarningsTodayDTO `json:"amc"`
	DMT   []EarningsTodayDTO `json:"dmt"`
	Other []EarningsTodayDTO `json:"other"`
}

EarningsToday struct

type EarningsTodayDTO

type EarningsTodayDTO struct {
	ConsensusEPS      float64 `json:"consensusEPS"`
	AnnounceTime      string  `json:"announceTime"`
	NumberOfEstimates int     `json:"numberOfEstimates"`
	FiscalPeriod      string  `json:"fiscalPeriod"`
	FiscalEndDate     string  `json:"fiscalEndDate"`
	Symbol            string  `json:"symbol"`
	Quote             Quote   `json:"quote"`
}

EarningsTodayDTO struct

func (*EarningsTodayDTO) UnmarshalJSON

func (etd *EarningsTodayDTO) UnmarshalJSON(b []byte) error

UnmarshalJSON helper

type EconomicData

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

EconomicData struct to interface with /data-points endpoints

func NewEconomicData

func NewEconomicData(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *EconomicData

NewEconomicData return new EconomicData

func (*EconomicData) APIURL

func (ed *EconomicData) APIURL() *url.URL

APIURL return APIURL

func (*EconomicData) Client

func (ed *EconomicData) Client() *http.Client

Client return HTTP client

func (*EconomicData) EconomicPrices

func (ed *EconomicData) EconomicPrices(symbol string) (value interface{}, err error)

EconomicPrices GET /data-points/market/{symbol}

func (*EconomicData) Retry

func (ed *EconomicData) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*EconomicData) Token

func (ed *EconomicData) Token() string

Token return token string

func (*EconomicData) URL

func (ed *EconomicData) URL() *url.URL

URL return URL base

func (*EconomicData) Version

func (ed *EconomicData) Version() string

Version return version string

type Estimates

type Estimates struct {
	Symbol    string `json:"symbol"`
	Estimates []struct {
		ConsensusEPS      float64 `json:"consensusEPS"`
		NumberOfEstimates int     `json:"numberOfEstimates"`
		FiscalPeriod      string  `json:"fiscalPeriod"`
		FiscalEndDate     string  `json:"fiscalEndDate"`
		ReportDate        string  `json:"reportDate"`
	} `json:"estimates"`
}

Estimates struct

type ExchangeRates

type ExchangeRates struct {
	Date         string  `json:"date"`
	FromCurrency string  `json:"fromCurrency"`
	ToCurrency   string  `json:"toCurrency"`
	Rate         float64 `json:"rate"`
}

ExchangeRates struct

type FXSymbols

type FXSymbols struct {
	Currencies []struct {
		Code string `json:"code"`
		Name string `json:"name"`
	} `json:"currencies"`
	Pairs []struct {
		From string `json:"from"`
		To   string `json:"to"`
	} `json:"pairs"`
}

FXSymbols struct

type Financials

type Financials struct {
	Symbol     string `json:"symbol"`
	Financials []struct {
		ReportDate             string      `json:"reportDate"`
		GrossProfit            int64       `json:"grossProfit"`
		CostOfRevenue          int64       `json:"costOfRevenue"`
		OperatingRevenue       int64       `json:"operatingRevenue"`
		TotalRevenue           int64       `json:"totalRevenue"`
		OperatingIncome        int64       `json:"operatingIncome"`
		NetIncome              int64       `json:"netIncome"`
		ResearchAndDevelopment int64       `json:"researchAndDevelopment"`
		OperatingExpense       int64       `json:"operatingExpense"`
		CurrentAssets          int64       `json:"currentAssets"`
		TotalAssets            int64       `json:"totalAssets"`
		TotalLiabilities       int64       `json:"totalLiabilities"`
		CurrentCash            int64       `json:"currentCash"`
		CurrentDebt            int64       `json:"currentDebt"`
		TotalCash              int64       `json:"totalCash"`
		TotalDebt              int64       `json:"totalDebt"`
		ShareholderEquity      int64       `json:"shareholderEquity"`
		CashChange             int         `json:"cashChange"`
		CashFlow               int64       `json:"cashFlow"`
		OperatingGainsLosses   interface{} `json:"operatingGainsLosses"`
	} `json:"financials"`
}

Financials struct

type FinancialsQueryParams

type FinancialsQueryParams struct {
	Period PeriodQueryParameter `url:"period"`
}

FinancialsQueryParams required/optional query params

type Forex

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

Forex struct to interface with Forex / Currencies endpoints

func NewForex

func NewForex(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *Forex

NewForex return new Forex

func (*Forex) APIURL

func (f *Forex) APIURL() *url.URL

APIURL return APIURL

func (*Forex) Client

func (f *Forex) Client() *http.Client

Client return HTTP client

func (*Forex) CurrencyConversion

func (f *Forex) CurrencyConversion(params *CurrencyConversionParams) (cc CurrencyConversion, err error)

CurrencyConversion GET /fx/convert?{params}

func (*Forex) ExchangeRates

func (f *Forex) ExchangeRates(from, to string) (er *ExchangeRates, err error)

ExchangeRates GET /fx/rate/{from}/{to}

func (*Forex) HistoricalDaily

func (f *Forex) HistoricalDaily(params *HistoricalDailyParams) (hd HistoricalDaily, err error)

HistoricalDaily GET /fx/historical?{params}

func (*Forex) LatestCurrencyRates

func (f *Forex) LatestCurrencyRates(params *LatestCurrencyRatesParams) (lcr LatestCurrencyRates, err error)

LatestCurrencyRates GET /fx/latest?{params}

func (*Forex) Retry

func (f *Forex) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*Forex) Token

func (f *Forex) Token() string

Token return token string

func (*Forex) URL

func (f *Forex) URL() *url.URL

URL return URL base

func (*Forex) Version

func (f *Forex) Version() string

Version return version string

type FundOwnership

type FundOwnership []struct {
	AdjHolding       int    `json:"adjHolding"`
	AdjMv            int    `json:"adjMv"`
	EntityProperName string `json:"entityProperName"`
	ReportDate       int64  `json:"reportDate"`
	ReportedHolding  int    `json:"reportedHolding"`
	ReportedMv       int    `json:"reportedMv"`
}

FundOwnership struct

type HistoricalDaily

type HistoricalDaily [][]struct {
	Date      string  `json:"date"`
	Symbol    string  `json:"symbol"`
	Timestamp int64   `json:"timestamp"`
	Rate      float64 `json:"rate"`
}

HistoricalDaily struct

type HistoricalDailyParams

type HistoricalDailyParams struct {
	Symbols string `url:"symbols"`
	From    string `url:"from"`
	To      string `url:"to"`
	Last    int    `url:"last"`
}

HistoricalDailyParams required/optional query parameters

type IEXOption

type IEXOption func(*iex) error

IEXOption is a func that operates on *iex

func SetRetry

func SetRetry(retry *Retry) IEXOption

SetRetry assigns the

type IEXSymbols

type IEXSymbols []struct {
	Symbol    string `json:"symbol"`
	Date      string `json:"date"`
	IsEnabled bool   `json:"isEnabled"`
}

IEXSymbols struct

type IPOCalendar

type IPOCalendar struct {
	RawData []struct {
		Symbol                 string      `json:"symbol"`
		CompanyName            string      `json:"companyName"`
		ExpectedDate           string      `json:"expectedDate"`
		LeadUnderwriters       []string    `json:"leadUnderwriters"`
		Underwriters           []string    `json:"underwriters"`
		CompanyCounsel         []string    `json:"companyCounsel"`
		UnderwriterCounsel     []string    `json:"underwriterCounsel"`
		Auditor                string      `json:"auditor"`
		Market                 string      `json:"market"`
		Cik                    string      `json:"cik"`
		Address                string      `json:"address"`
		City                   string      `json:"city"`
		State                  string      `json:"state"`
		Zip                    string      `json:"zip"`
		Phone                  string      `json:"phone"`
		Ceo                    string      `json:"ceo"`
		Employees              int         `json:"employees"`
		URL                    string      `json:"url"`
		Status                 string      `json:"status"`
		SharesOffered          int         `json:"sharesOffered"`
		PriceLow               float64     `json:"priceLow"`
		PriceHigh              float64     `json:"priceHigh"`
		OfferAmount            interface{} `json:"offerAmount"`
		TotalExpenses          float64     `json:"totalExpenses"`
		SharesOverAlloted      int         `json:"sharesOverAlloted"`
		ShareholderShares      interface{} `json:"shareholderShares"`
		SharesOutstanding      int         `json:"sharesOutstanding"`
		LockupPeriodExpiration string      `json:"lockupPeriodExpiration"`
		QuietPeriodExpiration  string      `json:"quietPeriodExpiration"`
		Revenue                int         `json:"revenue"`
		NetIncome              int         `json:"netIncome"`
		TotalAssets            int         `json:"totalAssets"`
		TotalLiabilities       int         `json:"totalLiabilities"`
		StockholderEquity      int         `json:"stockholderEquity"`
		CompanyDescription     string      `json:"companyDescription"`
		BusinessDescription    string      `json:"businessDescription"`
		UseOfProceeds          string      `json:"useOfProceeds"`
		Competition            string      `json:"competition"`
		Amount                 int         `json:"amount"`
		PercentOffered         string      `json:"percentOffered"`
	} `json:"rawData"`
	ViewData []struct {
		Company  string `json:"Company"`
		Symbol   string `json:"Symbol"`
		Price    string `json:"Price"`
		Shares   string `json:"Shares"`
		Amount   string `json:"Amount"`
		Float    string `json:"Float"`
		Percent  string `json:"Percent"`
		Market   string `json:"Market"`
		Expected string `json:"Expected"`
	} `json:"viewData"`
}

IPOCalendar struct

type IncomeStatement

type IncomeStatement struct {
	Symbol string `json:"symbol"`
	Income []struct {
		ReportDate             string `json:"reportDate"`
		TotalRevenue           int64  `json:"totalRevenue"`
		CostOfRevenue          int64  `json:"costOfRevenue"`
		GrossProfit            int64  `json:"grossProfit"`
		ResearchAndDevelopment int64  `json:"researchAndDevelopment"`
		SellingGeneralAndAdmin int64  `json:"sellingGeneralAndAdmin"`
		OperatingExpense       int64  `json:"operatingExpense"`
		OperatingIncome        int64  `json:"operatingIncome"`
		OtherIncomeExpenseNet  int    `json:"otherIncomeExpenseNet"`
		Ebit                   int64  `json:"ebit"`
		InterestIncome         int    `json:"interestIncome"`
		PretaxIncome           int64  `json:"pretaxIncome"`
		IncomeTax              int64  `json:"incomeTax"`
		MinorityInterest       int    `json:"minorityInterest"`
		NetIncome              int64  `json:"netIncome"`
		NetIncomeBasic         int64  `json:"netIncomeBasic"`
	} `json:"income"`
}

IncomeStatement struct

type IncomeStatementQueryParams

type IncomeStatementQueryParams struct {
	Period PeriodQueryParameter `url:"period"`
	Last   uint                 `url:"last,omitempty"`
}

IncomeStatementQueryParams required/optional query parameters

type IndicatorName

type IndicatorName int

IndicatorName for TechnicalIndicator API

const (
	// ABS Vector Absolute Value
	ABS IndicatorName = iota
	// ACOS Vector Arccosine
	ACOS
	AD
	// ADD Vector Addition
	ADD
	// ADOSC Accumulation/Distribution Oscillator
	ADOSC
	// ADX Average Directional Movement Index
	ADX
	// ADXR Average Directional Movement Rating
	ADXR
	// AO Awesome Oscillator
	AO
	// APO Absolute Price Oscillator
	APO
	// AROON Aroon
	AROON
	// AROONOSC Aroon Oscillator
	AROONOSC
	// ASIN Vector Arcsine
	ASIN
	// ATAN Vector Arctangent
	ATAN
	// ATR Average True Range
	ATR
	// AVGPRICE Average Price
	AVGPRICE
	// BBANDS Bollinger Bands
	BBANDS
	// BOP Balance of Power
	BOP
	// CCI Commodity Channel Index
	CCI
	// CEIL Vector Ceiling
	CEIL
	// CMO Change Momentum Oscillator
	CMO
	// COS Vector Cosine
	COS
	// COSH Vector Hyperbolic Cosine
	COSH
	// CROSSANY Crossany
	CROSSANY
	// CROSSOVER Crossover
	CROSSOVER
	// CVI Chaikins Volatility
	CVI
	// DECAY Linear Decay
	DECAY
	// DEMA Double Exponential Moving Average
	DEMA
	// DI Directional Indicator
	DI
	// DIV Vector Division
	DIV
	// DM Directional Movement
	DM
	// DPO Detrended Price Oscillator
	DPO
	// DX Directional Movement Index
	DX
	// EDECAY Exponential Decay
	EDECAY
	// EMA Exponential Moving Average
	EMA
	// EMV Ease of Movement
	EMV
	// EXP Vector Exponential
	EXP
	// FISHER Fisher Transform
	FISHER
	// FLOOR Vector Floor
	FLOOR
	// FOSC Forecast Oscillator
	FOSC
	// HMA Hull Moving Average
	HMA
	// KAMA Kaufman Adaptive Moving Average
	KAMA
	// KVO Klinger Volume Oscillator
	KVO
	// LAG Lag
	LAG
	// LINREG Linear Regression
	LINREG
	// LINREGINTERCEPT Linear Regression Intercept
	LINREGINTERCEPT
	// LINREGSLOPE Linear Regression Slope
	LINREGSLOPE
	// LN Vector Natural Log
	LN
	// LOG10 Vector Base-10 Log
	LOG10
	// MACD Moving Average Convergence/Divergence
	MACD
	// MARKETFI Market Facilitation Index
	MARKETFI
	// MASS Mass Index
	MASS
	// MAX Maximum In Period
	MAX
	// MD Mean Deviation Over Period
	MD
	// MEDPRICE Median Price
	MEDPRICE
	// MFI Money Flow Index
	MFI
	// MIN Minimum In Period
	MIN
	// MOM Momentum
	MOM
	// MSW Mesa Sine Wave
	MSW
	// MUL Vector Multiplication
	MUL
	// NATR Normalized Average True Range
	NATR
	// NVI Negative Volume Index
	NVI
	// OBV On Balance Volume
	OBV
	// PPO Percentage Price Oscillator
	PPO
	// PSAR Parabolic SAR
	PSAR
	// PVI Positive Volume Index
	PVI
	// QSTICK Qstick
	QSTICK
	// ROC Rate of Change
	ROC
	// ROCR Rate of Change Ratio
	ROCR
	// ROUND Vector Round
	ROUND
	// RSI Relative Strength Index
	RSI
	// SIN Vector Sine
	SIN
	// SINH Vector Hyperbolic Sine
	SINH
	// SMA Simple Moving Average
	SMA
	// SQRT Vector Square Root
	SQRT
	// STDDEV Standard Deviation Over Period
	STDDEV
	// STOCH Stochastic Oscillator
	STOCH
	// STOCHRSI Stochastic RSI
	STOCHRSI
	// SUB Vector Subtraction
	SUB
	// SUM Sum Over Period
	SUM
	// TAN Vector Tangent
	TAN
	// TANH Vector Hyperbolic Tangent
	TANH
	// TEMA Triple Exponential Moving Average
	TEMA
	// TODEG Vector Degree Conversion
	TODEG
	// TORAD Vector Radian Conversion
	TORAD
	// TR True Range
	TR
	// TRIMA Triangular Moving Average
	TRIMA
	// TRIX Trix
	TRIX
	// TRUNC Vector Truncate
	TRUNC
	// TSF Time Series Forecast
	TSF
	// TYPPRICE Typical Price
	TYPPRICE
	// ULTOSC Ultimate Oscillator
	ULTOSC
	// VAR Variance Over Period
	VAR
	// VHF Vertical Horizontal Filter
	VHF
	// VIDYA Variable Index Dynamic Average
	VIDYA
	// VOLATILITY Annualized Historical Volatility
	VOLATILITY
	// VOSC Volume Oscillator
	VOSC
	// VWMA Volume Weighted Moving Average
	VWMA
	// WAD Williams Accumulation/Distribution
	WAD
	// WCPRICE Weight Close Price
	WCPRICE
	// WILDERS Wilders Smoothing
	WILDERS
	// WILLR Williams %R
	WILLR
	// WMA Weighted Moving Average
	WMA
	// ZLEMA Zero-Lag Exponential Moving Average
	ZLEMA
)

func (IndicatorName) String

func (in IndicatorName) String() string

type InsiderRoster

type InsiderRoster []struct {
	EntityName string `json:"entityName'"`
	Position   int    `json:"position"`
	ReportDate int64  `json:"reportDate"`
}

InsiderRoster struct

type InsiderSummary

type InsiderSummary []struct {
	FullName      string `json:"fullName"`
	NetTransacted int    `json:"netTransacted"`
	ReportedTitle string `json:"reportedTitle"`
	TotalBought   int    `json:"totalBought"`
	TotalSold     int    `json:"totalSold"`
}

InsiderSummary struct

type InsiderTransactions

type InsiderTransactions []struct {
	EffectiveDate int64   `json:"effectiveDate"`
	FullName      string  `json:"fullName"`
	ReportedTitle string  `json:"reportedTitle"`
	TranPrice     float64 `json:"tranPrice"`
	TranShares    float64 `json:"tranShares"`
	TranValue     float64 `json:"tranValue"`
}

InsiderTransactions struct

type InstitutionalOwnership

type InstitutionalOwnership []struct {
	AdjHolding       int    `json:"adjHolding"`
	AdjMv            int    `json:"adjMv"`
	EntityProperName string `json:"entityProperName"`
	ReportDate       int64  `json:"reportDate"`
	ReportedHolding  int    `json:"reportedHolding"`
}

InstitutionalOwnership struct

type InternationalExchanges

type InternationalExchanges []struct {
	Exchange       string `json:"exchange"`
	Region         string `json:"region"`
	Description    string `json:"description"`
	Mic            string `json:"mic"`
	ExchangeSuffix string `json:"exchangeSuffix"`
}

InternationalExchanges struct

type InternationalSymbols

type InternationalSymbols []struct {
	Symbol    string `json:"symbol"`
	Exchange  string `json:"exchange"`
	Name      string `json:"name"`
	Date      string `json:"date"`
	Type      string `json:"type"`
	IexID     string `json:"iexId"`
	Region    string `json:"region"`
	Currency  string `json:"currency"`
	IsEnabled bool   `json:"isEnabled"`
}

InternationalSymbols struct

type IntradayPrices

type IntradayPrices []struct {
	Date                 string  `json:"date"`
	Minute               string  `json:"minute"`
	Label                string  `json:"label"`
	MarketOpen           float64 `json:"marketOpen"`
	MarketClose          float64 `json:"marketClose"`
	MarketHigh           float64 `json:"marketHigh"`
	MarketLow            float64 `json:"marketLow"`
	MarketAverage        float64 `json:"marketAverage"`
	MarketVolume         int     `json:"marketVolume"`
	MarketNotional       float64 `json:"marketNotional"`
	MarketNumberOfTrades int     `json:"marketNumberOfTrades"`
	MarketChangeOverTime float64 `json:"marketChangeOverTime"`
	High                 float64 `json:"high"`
	Low                  float64 `json:"low"`
	Open                 float64 `json:"open"`
	Close                float64 `json:"close"`
	Average              float64 `json:"average"`
	Volume               int     `json:"volume"`
	Notional             float64 `json:"notional"`
	NumberOfTrades       int     `json:"numberOfTrades"`
	ChangeOverTime       float64 `json:"changeOverTime"`
}

IntradayPrices struct

type IntradayPricesQueryParams

type IntradayPricesQueryParams struct {
	// ChartIEXOnly true limits to IEX only data
	ChartIEXOnly bool `url:"chartIEXOnly,omitempty"`
	// ChartReset true resets chart at midnight instead of 9:30 AM ET
	ChartReset      bool `url:"chartReset,omitempty"`
	ChartSimplify   bool `url:"chartSimplify,omitempty"`
	ChartInterval   uint `url:"chartInterval,omitempty"`
	ChangeFromClose bool `url:"changeFromClose,omitempty"`
	ChartLast       uint `url:"chartLast,omitempty"`
	// ExactDate date formatted as YYYYMMDD
	ExactDate        string `url:"exactDate,omitempty"`
	ChartIEXWhenNull bool   `url:"chartIEXWhenNull,omitempty"`
}

IntradayPricesQueryParams required/optional query parameters

type InvestorsExchangeData

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

InvestorsExchangeData struct to interface with InvestorsExchangeData endpoints

func NewInvestorsExchangeData

func NewInvestorsExchangeData(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *InvestorsExchangeData

NewInvestorsExchangeData return new InvestorsExchangeData

func (*InvestorsExchangeData) APIURL

func (ied *InvestorsExchangeData) APIURL() *url.URL

APIURL return APIURL

func (*InvestorsExchangeData) Client

func (ied *InvestorsExchangeData) Client() *http.Client

Client return HTTP client

func (*InvestorsExchangeData) DEEP

func (ied *InvestorsExchangeData) DEEP(params *DEEPParams) (d *DEEP, err error)

DEEP GET /deep?symbols={params}

func (*InvestorsExchangeData) Last

func (ied *InvestorsExchangeData) Last(params *LastParams) (l Last, err error)

Last GET /tops/last?{params}

func (*InvestorsExchangeData) Retry

func (ied *InvestorsExchangeData) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*InvestorsExchangeData) TOPS

func (ied *InvestorsExchangeData) TOPS(params *TOPSParams) (tops TOPS, err error)

TOPS GET /tops?{params}

func (*InvestorsExchangeData) Token

func (ied *InvestorsExchangeData) Token() string

Token return token string

func (*InvestorsExchangeData) URL

func (ied *InvestorsExchangeData) URL() *url.URL

URL return URL base

func (*InvestorsExchangeData) Version

func (ied *InvestorsExchangeData) Version() string

Version return version string

type KeyStat

type KeyStat struct {
	CompanyName         string  `json:"companyName"`
	Marketcap           int64   `json:"marketcap"`
	Week52High          float64 `json:"week52high"`
	Week52Low           float64 `json:"week52low"`
	Week52Change        float64 `json:"week52change"`
	SharesOutstanding   int64   `json:"sharesOutstanding"`
	Float               float64 `json:"float"`
	Symbol              string  `json:"symbol"`
	Avg10Volume         float64 `json:"avg10Volume"`
	Avg30Volume         float64 `json:"avg30Volume"`
	Day200MovingAvg     float64 `json:"day200MovingAvg"`
	Day50MovingAvg      float64 `json:"day50MovingAvg"`
	Employees           int     `json:"employees"`
	TtmEPS              float64 `json:"ttmEPS"`
	TtmDividendRate     float64 `json:"ttmDividendRate"`
	DividendYield       float64 `json:"dividendYield"`
	NextDividendDate    string  `json:"nextDividendDate"`
	ExDividendDate      string  `json:"exDividendDate"`
	NextEarningsDate    string  `json:"nextEarningsDate"`
	PeRatio             float64 `json:"peRatio"`
	Beta                float64 `json:"beta"`
	MaxChangePercent    float64 `json:"maxChangePercent"`
	Year5ChangePercent  float64 `json:"year5ChangePercent"`
	Year2ChangePercent  float64 `json:"year2ChangePercent"`
	Year1ChangePercent  float64 `json:"year1ChangePercent"`
	YtdChangePercent    float64 `json:"ytdChangePercent"`
	Month6ChangePercent float64 `json:"month6ChangePercent"`
	Month3ChangePercent float64 `json:"month3ChangePercent"`
	Month1ChangePercent float64 `json:"month1ChangePercent"`
	Day30ChangePercent  float64 `json:"day30ChangePercent"`
	Day5ChangePercent   float64 `json:"day5ChangePercent"`
}

KeyStat struct

type LargestTrades

type LargestTrades []struct {
	Price     float64 `json:"price"`
	Size      int     `json:"size"`
	Time      int64   `json:"time"`
	TimeLabel string  `json:"timeLabel"`
	Venue     string  `json:"venue"`
	VenueName string  `json:"venueName"`
}

LargestTrades struct

type Last

type Last []struct {
	Symbol string  `json:"symbol"`
	Price  float64 `json:"price"`
	Size   int     `json:"size"`
	Time   int64   `json:"time"`
}

Last struct

type LastParams

type LastParams struct {
	Symbols string `url:"symbols"`
}

LastParams required/optional query parameters

type LatestCurrencyRates

type LatestCurrencyRates []struct {
	Symbol    string  `json:"symbol"`
	Rate      float64 `json:"rate"`
	Timestamp int64   `json:"timestamp"`
}

LatestCurrencyRates struct

type LatestCurrencyRatesParams

type LatestCurrencyRatesParams struct {
	Symbols string `url:"symbols"`
}

LatestCurrencyRatesParams required/optional query parameters

type ListQueryParams

type ListQueryParams struct {
	DisplayPercent bool `url:"displayPercent,omitempty"`
	ListLimit      uint `url:"listLimit,omitempty"`
}

ListQueryParams required/optional query parameters

type Logo struct {
	URL string `json:"url"`
}

Logo struct

type MarketVolume

type MarketVolume []struct {
	Mic           string  `json:"mic"`
	TapeID        string  `json:"tapeId"`
	VenueName     string  `json:"venueName"`
	Volume        int     `json:"volume"`
	TapeA         int     `json:"tapeA"`
	TapeB         int     `json:"tapeB"`
	TapeC         int     `json:"tapeC"`
	MarketPercent float64 `json:"marketPercent"`
	LastUpdated   int64   `json:"lastUpdated"`
}

MarketVolume struct

type Metadata

type Metadata struct {
	PayAsYouGoEnabled    bool   `json:"payAsYouGoEnabled"`
	EffectiveDate        int64  `json:"effectiveDate"`
	EndDateEffective     int64  `json:"endDateEffective"`
	SubscriptionTermType string `json:"subscriptionTermType"`
	TierName             string `json:"tierName"`
	MessageLimit         int    `json:"messageLimit"`
	MessagesUsed         int    `json:"messagesUsed"`
}

Metadata struct

type MutualFundSymbols

type MutualFundSymbols []struct {
	Symbol    string `json:"symbol"`
	Name      string `json:"name"`
	Date      string `json:"date"`
	Type      string `json:"type"`
	IexID     string `json:"iexId"`
	Region    string `json:"region"`
	Currency  string `json:"currency"`
	IsEnabled bool   `json:"isEnabled"`
}

MutualFundSymbols struct

type News

type News []struct {
	Datetime   int64  `json:"datetime"`
	Headline   string `json:"headline"`
	Source     string `json:"source"`
	URL        string `json:"url"`
	Summary    string `json:"summary"`
	Related    string `json:"related"`
	Image      string `json:"image"`
	Lang       string `json:"lang"`
	HasPaywall bool   `json:"hasPaywall"`
}

News struct

type OHLC

type OHLC struct {
	Open struct {
		Price float64 `json:"price"`
		Time  int64   `json:"time"`
	} `json:"open"`
	Close struct {
		Price float64 `json:"price"`
		Time  int64   `json:"time"`
	} `json:"close"`
	High float64 `json:"high"`
	Low  float64 `json:"low"`
}

OHLC struct

type OTCSymbols

type OTCSymbols []struct {
	Symbol string `json:"symbol"`
	Name   string `json:"name"`
	Date   string `json:"date"`
	Type   string `json:"type"`
	IexID  string `json:"iexId"`
}

OTCSymbols struct

type Option

type Option struct {
	Symbol         string  `json:"symbol"`
	ID             string  `json:"id"`
	ExpirationDate string  `json:"expirationDate"`
	ContractSize   int     `json:"contractSize"`
	StrikePrice    float64 `json:"strikePrice"`
	ClosingPrice   float64 `json:"closingPrice"`
	Side           string  `json:"side"`
	Type           string  `json:"type"`
	Volume         int     `json:"volume"`
	OpenInterest   int     `json:"openInterest"`
	Bid            float64 `json:"bid"`
	Ask            float64 `json:"ask"`
	LastUpdated    string  `json:"lastUpdated"`
}

Option struct

type OptionsSymbols

type OptionsSymbols struct {
}

OptionsSymbols struct

type PeriodQueryParameter

type PeriodQueryParameter int

PeriodQueryParameter accepted values for query parameter `period`

const (
	// PeriodAnnual annual period
	PeriodAnnual PeriodQueryParameter = iota
	// PeriodQuarter quarter period
	PeriodQuarter
)

func (PeriodQueryParameter) String

func (pqp PeriodQueryParameter) String() string

type PreviousDayPrice

type PreviousDayPrice struct {
	Date           string  `json:"date"`
	Open           float64 `json:"open"`
	Close          float64 `json:"close"`
	High           float64 `json:"high"`
	Low            float64 `json:"low"`
	Volume         float64 `json:"volume"`
	UOpen          float64 `json:"uOpen"`
	UClose         float64 `json:"uClose"`
	UHigh          float64 `json:"uHigh"`
	ULow           float64 `json:"uLow"`
	UVolume        float64 `json:"uVolume"`
	Change         float64 `json:"change"`
	ChangePercent  float64 `json:"changePercent"`
	ChangeOverTime float64 `json:"changeOverTime"`
	Symbol         string  `json:"symbol"`
}

PreviousDayPrice struct

type PriceTarget

type PriceTarget struct {
	Symbol             string  `json:"symbol"`
	UpdatedDate        string  `json:"updatedDate"`
	PriceTargetAverage float64 `json:"priceTargetAverage"`
	PriceTargetHigh    float64 `json:"priceTargetHigh"`
	PriceTargetLow     float64 `json:"priceTargetLow"`
	NumberOfAnalysts   int     `json:"numberOfAnalysts"`
}

PriceTarget struct

type Quote

type Quote struct {
	Symbol                string  `json:"symbol"`
	CompanyName           string  `json:"companyName"`
	CalculationPrice      string  `json:"calculationPrice"`
	Open                  float64 `json:"open"`
	OpenTime              int64   `json:"openTime"`
	Close                 float64 `json:"close"`
	CloseTime             int64   `json:"closeTime"`
	High                  float64 `json:"high"`
	Low                   float64 `json:"low"`
	LatestPrice           float64 `json:"latestPrice"`
	LatestSource          string  `json:"latestSource"`
	LatestTime            string  `json:"latestTime"`
	LatestUpdate          int64   `json:"latestUpdate"`
	LatestVolume          int     `json:"latestVolume"`
	IexRealtimePrice      float64 `json:"iexRealtimePrice"`
	IexRealtimeSize       int     `json:"iexRealtimeSize"`
	IexLastUpdated        int64   `json:"iexLastUpdated"`
	DelayedPrice          float64 `json:"delayedPrice"`
	DelayedPriceTime      int64   `json:"delayedPriceTime"`
	ExtendedPrice         float64 `json:"extendedPrice"`
	ExtendedChange        float64 `json:"extendedChange"`
	ExtendedChangePercent float64 `json:"extendedChangePercent"`
	ExtendedPriceTime     int64   `json:"extendedPriceTime"`
	PreviousClose         float64 `json:"previousClose"`
	Change                float64 `json:"change"`
	ChangePercent         float64 `json:"changePercent"`
	IexMarketPercent      float64 `json:"iexMarketPercent"`
	IexVolume             int     `json:"iexVolume"`
	AvgTotalVolume        int     `json:"avgTotalVolume"`
	IexBidPrice           float64 `json:"iexBidPrice"`
	IexBidSize            int     `json:"iexBidSize"`
	IexAskPrice           float64 `json:"iexAskPrice"`
	IexAskSize            int     `json:"iexAskSize"`
	MarketCap             int64   `json:"marketCap"`
	Week52High            float64 `json:"week52High"`
	Week52Low             float64 `json:"week52Low"`
	YtdChange             float64 `json:"ytdChange"`
}

Quote struct

type QuoteQueryParams

type QuoteQueryParams struct {
	DisplayPercent bool `url:"displayPercent,omitempty"`
}

QuoteQueryParams required/optional query parameters

type RecommendationTrends

type RecommendationTrends []struct {
	ConsensusEndDate            int64   `json:"consensusEndDate"`
	ConsensusStartDate          int64   `json:"consensusStartDate"`
	CorporateActionsAppliedDate int64   `json:"corporateActionsAppliedDate"`
	RatingBuy                   int     `json:"ratingBuy"`
	RatingHold                  int     `json:"ratingHold"`
	RatingNone                  int     `json:"ratingNone"`
	RatingOverweight            int     `json:"ratingOverweight"`
	RatingScaleMark             float64 `json:"ratingScaleMark"`
	RatingSell                  int     `json:"ratingSell"`
	RatingUnderweight           int     `json:"ratingUnderweight"`
}

RecommendationTrends struct

type ReferenceData

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

ReferenceData struct to interface with /ref-data endpoints

func NewReferenceData

func NewReferenceData(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *ReferenceData

NewReferenceData return new ReferenceData

func (*ReferenceData) APIURL

func (rd *ReferenceData) APIURL() *url.URL

APIURL return APIURL

func (*ReferenceData) Client

func (rd *ReferenceData) Client() *http.Client

Client return HTTP client

func (*ReferenceData) ExchangeSymbols

func (rd *ReferenceData) ExchangeSymbols(exchange string) (is InternationalSymbols, err error)

ExchangeSymbols GET /ref-data/exchange/{exchange}/symbogTls

func (*ReferenceData) FXSymbols

func (rd *ReferenceData) FXSymbols() (fx FXSymbols, err error)

FXSymbols GET /ref-data/fx/symbols

func (*ReferenceData) IEXSymbols

func (rd *ReferenceData) IEXSymbols() (is IEXSymbols, err error)

IEXSymbols GET /ref-data/iex/symbols

func (*ReferenceData) InternationalExchanges

func (rd *ReferenceData) InternationalExchanges() (ie InternationalExchanges, err error)

InternationalExchanges GET /ref-data/exchanges

func (*ReferenceData) MutualFundSymbols

func (rd *ReferenceData) MutualFundSymbols() (mfs MutualFundSymbols, err error)

MutualFundSymbols GET /ref-data/mutual-funds/symbols

func (*ReferenceData) OTCSymbols

func (rd *ReferenceData) OTCSymbols() (otc OTCSymbols, err error)

OTCSymbols GET /ref-data/otc/symbols

func (*ReferenceData) RegionSymbols

func (rd *ReferenceData) RegionSymbols(region string) (is InternationalSymbols, err error)

RegionSymbols GET /ref-data/region/{region}/symbols

func (*ReferenceData) Retry

func (rd *ReferenceData) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*ReferenceData) Sectors

func (rd *ReferenceData) Sectors() (s Sectors, err error)

Sectors GET /ref-data/sectors

func (*ReferenceData) Symbols

func (rd *ReferenceData) Symbols() (s Symbols, err error)

Symbols GET /ref-data/symbols

func (*ReferenceData) Tags

func (rd *ReferenceData) Tags() (t Tags, err error)

Tags GET /ref-data/tags

func (*ReferenceData) Token

func (rd *ReferenceData) Token() string

Token return token string

func (*ReferenceData) URL

func (rd *ReferenceData) URL() *url.URL

URL return URL base

func (*ReferenceData) USExchanges

func (rd *ReferenceData) USExchanges() (ue USExchanges, err error)

USExchanges GET /ref-data/market/us/exchanges

func (*ReferenceData) USHolidaysAndTradingDates

func (rd *ReferenceData) USHolidaysAndTradingDates(dateType, direction string, opt ...interface{}) (u USHolidaysAndTradingDates, err error)

USHolidaysAndTradingDates GET /ref-data/us/dates/{type}/{direction}/{last?}/{startDate?}

func (*ReferenceData) Version

func (rd *ReferenceData) Version() string

Version return version string

type Request

type Request struct {
	*http.Request
	// contains filtered or unexported fields
}

Request wraps a *http.Request

func NewRequest

func NewRequest(method, url string, body io.ReadSeeker) (*Request, error)

NewRequest constructor to build *Request

type Retry

type Retry struct {
	*http.Client
	RetryWaitMin  time.Duration // Minimum time to wait on HTTP request retry
	RetryWaitMax  time.Duration // Maximum time to wait on HTTP request retry
	RetryAttempts int           // Maximum number of HTTP request retries
	RetryPolicy   RetryPolicy   // Defines when to retry a HTTP request
	Backoff       Backoff       // Defines wait time between HTTP request retries
}

Retry implements Retryer

func NewRetry

func NewRetry(httpClient *http.Client, options ...RetryOption) (*Retry, error)

NewRetry returns a struct that can retry a HTTP request defined by the RetryPolicy and Backoff.

func (*Retry) Do

func (r *Retry) Do(req *Request) (*http.Response, error)

Do will perform the Request and attempt it again if the RetryPolicy passes

type RetryOption

type RetryOption func(*Retry) error

RetryOption is a func that operations on *Retry.

func SetBackoff

func SetBackoff(b Backoff) RetryOption

SetBackoff sets the Backoff that defines how long to wait between HTTP request retries.

func SetRetryAttempts

func SetRetryAttempts(attempts int) RetryOption

SetRetryAttempts sets the max number of retry attempts.

func SetRetryPolicy

func SetRetryPolicy(rp RetryPolicy) RetryOption

SetRetryPolicy sets the RetryPolicy that defines when to retry a HTTP request.

func SetRetryWaitMinMax

func SetRetryWaitMinMax(min, max time.Duration) RetryOption

SetRetryWaitMinMax sets the min and max time.Duration that a retry request is bounded by.

type RetryPolicy

type RetryPolicy func(resp *http.Response, err error) (bool, error)

RetryPolicy is a func type that defines when to retry a http request

type RetryPolicyer

type RetryPolicyer interface {
	RetryPolicy(resp *http.Response, err error) (bool, error)
}

RetryPolicyer interface defines methods for when to retry

type Retryer

type Retryer interface {
	Backoffer
	RetryPolicyer
	Do(*Request) (*http.Response, error)
}

Retryer is the interface that defines methods to retry a HTTP request.

type SectorPerformance

type SectorPerformance []struct {
	Type        string  `json:"type"`
	Name        string  `json:"name"`
	Performance float64 `json:"performance"`
	LastUpdated int64   `json:"lastUpdated"`
}

SectorPerformance struct

type Sectors

type Sectors []struct {
	Name string `json:"name"`
}

Sectors struct

type SplitRange

type SplitRange int

SplitRange for Split API

const (
	// SplitRangeFiveYear split range
	SplitRangeFiveYear SplitRange = iota
	// SplitRangeTwoYear split range
	SplitRangeTwoYear
	// SplitRangeOneYear split range
	SplitRangeOneYear
	// SplitRangeYearToDate split range
	SplitRangeYearToDate
	// SplitRangeSixMonth split range
	SplitRangeSixMonth
	// SplitRangeThreeMonth split range
	SplitRangeThreeMonth
	// SplitRangeOneMonth split range
	SplitRangeOneMonth
	// SplitRangeNext split range
	SplitRangeNext
)

func (SplitRange) String

func (sr SplitRange) String() string

type Splits

type Splits []struct {
	ExDate       string  `json:"exDate"`
	DeclaredDate string  `json:"declaredDate"`
	Ratio        float64 `json:"ratio"`
	ToFactor     float64 `json:"toFactor"`
	FromFactor   float64 `json:"fromFactor"`
	Description  string  `json:"description"`
}

Splits struct

type Status

type Status struct {
	Status  string `json:"status"`
	Version string `json:"version"`
	Time    int64  `json:"time"`
}

Status struct

type Stock

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

Stock struct to interface with /stock endpoints

func NewStock

func NewStock(
	token, version string,
	base *url.URL,
	httpClient *http.Client,
	options ...IEXOption,
) *Stock

NewStock return new Stock

func (*Stock) APIURL

func (s *Stock) APIURL() *url.URL

APIURL return APIURL

func (*Stock) AdvancedStats

func (s *Stock) AdvancedStats(symbol string) (advstat *AdvancedStat, err error)

AdvancedStats GET /stock/{symbol}/advanced-stats

func (*Stock) BalanceSheet

func (s *Stock) BalanceSheet(symbol string, params *BalanceSheetParams) (balsheet *BalanceSheet, err error)

BalanceSheet GET /stock/{symbol}/balance-sheet

func (*Stock) Batch

func (s *Stock) Batch(symbol string, params interface{}) (batch *Batch, err error)

Batch GET /stock/{symbol}/batch?types=quote,news,chart&range=1m&last=1

func (*Stock) Book

func (s *Stock) Book(symbol string) (book *Book, err error)

Book GET /stock/{symbol}/book

func (*Stock) CashFlow

func (s *Stock) CashFlow(symbol string, params *CashFlowQueryParams) (cashflow *CashFlow, err error)

CashFlow GET /stock/{symbol}/cash-flow

func (*Stock) Chart

func (s *Stock) Chart(symbol string, chartRange ChartRange, params *ChartQueryParams) (chart []Chart, err error)

Chart GET /stock/{symbol}/chart/{range}

func (*Stock) Client

func (s *Stock) Client() *http.Client

Client return HTTP client

func (*Stock) Collection

func (s *Stock) Collection(collectionType CollectionType, params *CollectionQueryParams) (col Collection, err error)

Collection GET /stock/market/collection/{collectionType}?collectionName=

func (*Stock) Company

func (s *Stock) Company(symbol string) (com Company, err error)

Company GET /stock/{symbol}/company

func (*Stock) DelayedQuote

func (s *Stock) DelayedQuote(symbol string) (dq *DelayedQuote, err error)

DelayedQuote GET /stock/{symbol}/delayed-quote

func (*Stock) Dividends

func (s *Stock) Dividends(symbol string, dividendRange DividendRange) (div Dividends, err error)

Dividends GET /stock/{symbol}/dividends/{range}

func (*Stock) Earnings

func (s *Stock) Earnings(symbol string, params *EarningsQueryParams) (er *Earnings, err error)

Earnings GET /stock/{symbol}/earnings/{last}/{field}

func (*Stock) EarningsToday

func (s *Stock) EarningsToday() (et *EarningsToday, err error)

EarningsToday GET /stock/market/today-earnings

func (*Stock) Estimates

func (s *Stock) Estimates(symbol string, opt ...interface{}) (est *Estimates, err error)

Estimates GET /stock/{symbol}/estimates/{last}/{field}

func (*Stock) Financials

func (s *Stock) Financials(symbol string, params *FinancialsQueryParams) (fin *Financials, err error)

Financials GET /stock/{symbol}/financials/{last}/{field}

func (*Stock) FundOwnership

func (s *Stock) FundOwnership(symbol string) (fo FundOwnership, err error)

FundOwnership GET /stock/{symbol}/fund-ownership

func (*Stock) HistoricalPrices

func (s *Stock) HistoricalPrices(symbol string, chartRange ChartRange, params *ChartQueryParams) ([]Chart, error)

HistoricalPrices GET /stock/{symbol}/chart/{range}/{date}

func (*Stock) IncomeStatement

func (s *Stock) IncomeStatement(symbol string, params *IncomeStatementQueryParams) (incstmt *IncomeStatement, err error)

IncomeStatement GET /stock/{symbol}/income?{params}

func (*Stock) InsiderRoster

func (s *Stock) InsiderRoster(symbol string) (ir InsiderRoster, err error)

InsiderRoster GET /stock/{symbol}/insider-roster

func (*Stock) InsiderSummary

func (s *Stock) InsiderSummary(symbol string) (is InsiderSummary, err error)

InsiderSummary GET /stock/{symbol}/insider-summary

func (*Stock) InsiderTransactions

func (s *Stock) InsiderTransactions(symbol string) (it InsiderTransactions, err error)

InsiderTransactions GET /stock/{symbol}/insider-transactions

func (*Stock) InstitutionalOwnership

func (s *Stock) InstitutionalOwnership(symbol string) (iop InstitutionalOwnership, err error)

InstitutionalOwnership GET /stock/{symbol}/institutional-ownership

func (*Stock) IntradayPrices

func (s *Stock) IntradayPrices(symbol string, params *IntradayPricesQueryParams) (ip IntradayPrices, err error)

IntradayPrices GET /stock/{symbol}/intraday-prices

func (*Stock) KeyStats

func (s *Stock) KeyStats(symbol string) (ks *KeyStat, err error)

KeyStats GET /stock/{symbol}/stats

func (*Stock) LargestTrades

func (s *Stock) LargestTrades(symbol string) (lt LargestTrades, err error)

LargestTrades GET /stock/{symbol}/largest-trades

func (*Stock) List

func (s *Stock) List(listType string, params *ListQueryParams) (list []*Quote, err error)

List GET /stock/market/list/{list-type}

func (s *Stock) Logo(symbol string) (logo *Logo, err error)

Logo GET /stock/{symbol}/logo

func (*Stock) MarketVolume

func (s *Stock) MarketVolume() (mkt MarketVolume, err error)

MarketVolume GET /market ??? why did IEX make this endpoint here? doesn't have relative endpoint `stock`...

func (*Stock) News

func (s *Stock) News(symbol string, opt ...interface{}) (news News, err error)

News GET /stock/{symbol}/news/last/{last}

func (*Stock) OHLC

func (s *Stock) OHLC(symbol string) (ohlc *OHLC, err error)

OHLC GET /stock/{symbol}/ohlc

func (*Stock) OpenClosePrice

func (s *Stock) OpenClosePrice(symbol string) (ohlc *OHLC, err error)

OpenClosePrice Refer to ohlc

func (*Stock) OptionDates

func (s *Stock) OptionDates(symbol string) (dates []string, err error)

OptionDates GET /stock/{symbol}/options return available dates as string slice

func (*Stock) Options

func (s *Stock) Options(symbol, expiration string, opt ...interface{}) (options []*Option, err error)

Options GET /stock/{symbol}/options/{expiration}/{optionSide?}

func (*Stock) Peers

func (s *Stock) Peers(symbol string) (peers []string, err error)

Peers GET /stock/{symbol}/peers

func (*Stock) PreviousDayPrice

func (s *Stock) PreviousDayPrice(symbol string) (prev *PreviousDayPrice, err error)

PreviousDayPrice GET /stock/{symbol}/previous

func (*Stock) Price

func (s *Stock) Price(symbol string) (price float64, err error)

Price GET /stock/{symbol}/price

func (*Stock) PriceTarget

func (s *Stock) PriceTarget(symbol string) (tgt *PriceTarget, err error)

PriceTarget GET /stock/{symbol}/price-target

func (*Stock) Quote

func (s *Stock) Quote(symbol string, params *QuoteQueryParams) (quote *Quote, err error)

Quote GET /stock/{symbol}/quote

func (*Stock) RecommendationTrends

func (s *Stock) RecommendationTrends(symbol string) (rt RecommendationTrends, err error)

RecommendationTrends GET /stock/{symbol}/recommendation-trends

func (*Stock) Retry

func (s *Stock) Retry() *Retry

Retry return Retry struct that implements Retryer

func (*Stock) SectorPerformance

func (s *Stock) SectorPerformance() (sp SectorPerformance, err error)

SectorPerformance GET /stock/market/sector-performance

func (*Stock) Splits

func (s *Stock) Splits(symbol string, splitRange SplitRange) (sp Splits, err error)

Splits GET /stock/{symbol}/splits/{range}

func (*Stock) TechnicalIndicator

func (s *Stock) TechnicalIndicator(symbol string, indicatorName IndicatorName, params *TechnicalIndicatorParams) (ti *TechnicalIndicator, err error)

TechnicalIndicator GET /stock/{symbol}/indicator/{indicatorName}?{range}

func (*Stock) TodayIPOS

func (s *Stock) TodayIPOS() (ipo *IPOCalendar, err error)

TodayIPOS GET /stock/market/today-ipos

func (*Stock) Token

func (s *Stock) Token() string

Token return token string

func (*Stock) URL

func (s *Stock) URL() *url.URL

URL return URL base

func (*Stock) UpcomingDividends

func (s *Stock) UpcomingDividends(symbol string, params interface{}) (d Dividends, err error)

UpcomingDividends GET /stock/{symbol}/upcoming-dividends

func (*Stock) UpcomingEarnings

func (s *Stock) UpcomingEarnings(symbol string, params *UpcomingEarningsQueryParams) (ue UpcomingEarnings, err error)

UpcomingEarnings GET /stock/{symbol}/upcoming-earnings

func (*Stock) UpcomingEvents

func (s *Stock) UpcomingEvents(symbol string, params *UpcomingEventsQueryParams) (ue *UpcomingEvents, err error)

UpcomingEvents GET /stock/{symbol}/upcoming-events

func (*Stock) UpcomingIPOS

func (s *Stock) UpcomingIPOS(symbol string, params interface{}) (ipo *IPOCalendar, err error)

UpcomingIPOS GET /stock/market/upcoming-ipos

func (*Stock) UpcomingSplits

func (s *Stock) UpcomingSplits(symbol string, params interface{}) (spl Splits, err error)

UpcomingSplits GET /stock/{symbol}/upcoming-splits

func (*Stock) Version

func (s *Stock) Version() string

Version return version string

func (*Stock) VolumeByVenue

func (s *Stock) VolumeByVenue(symbol string) (vbv VolumeByVenue, err error)

VolumeByVenue GET /stock/{symbol}/volume-by-venue

type Symbols

type Symbols []struct {
	Symbol    string `json:"symbol"`
	Name      string `json:"name"`
	Date      string `json:"date"`
	Type      string `json:"type"`
	IexID     string `json:"iexId"`
	Region    string `json:"region"`
	Currency  string `json:"currency"`
	IsEnabled bool   `json:"isEnabled"`
}

Symbols struct

type SystemEvent

type SystemEvent struct {
	SystemEvent string `json:"systemEvent"`
	Timestamp   int64  `json:"timestamp"`
}

SystemEvent struct

type TOPS

type TOPS []struct {
	Symbol        string  `json:"symbol"`
	BidSize       int     `json:"bidSize"`
	BidPrice      float64 `json:"bidPrice"`
	AskSize       int     `json:"askSize"`
	AskPrice      float64 `json:"askPrice"`
	Volume        int     `json:"volume"`
	LastSalePrice float64 `json:"lastSalePrice"`
	LastSaleSize  int     `json:"lastSaleSize"`
	LastSaleTime  int64   `json:"lastSaleTime"`
	LastUpdated   int64   `json:"lastUpdated"`
	Sector        string  `json:"sector"`
	SecurityType  string  `json:"securityType"`
}

TOPS struct

type TOPSParams

type TOPSParams struct {
	Symbols string `url:"symbols"`
}

TOPSParams required/optional query parameters

type Tags

type Tags []struct {
	Name string `json:"name"`
}

Tags struct

type TechnicalIndicator

type TechnicalIndicator struct {
	Indicator [][]float64 `json:"indicator"`
	Charts    []Chart     `json:"chart"`
}

TechnicalIndicator struct

type TechnicalIndicatorParams

type TechnicalIndicatorParams struct {
	// Range should match allowed ranges in historical prices
	Range  TechnicalIndicatorRange `url:"range"`
	Input1 int                     `url:"input1,omitempty"`
	Input2 int                     `url:"input2,omitempty"`
	Input3 int                     `url:"input3,omitempty"`
	Input4 int                     `url:"input4,omitempty"`
}

TechnicalIndicatorParams struct

type TechnicalIndicatorRange added in v4.2.0

type TechnicalIndicatorRange int

TechnicalIndicatorRange for TechnicalIndicator API

const (
	// TechnicalIndicatorRangeMax chart range
	TechnicalIndicatorRangeMax TechnicalIndicatorRange = iota
	// TechnicalIndicatorRangeFiveYear chart range
	TechnicalIndicatorRangeFiveYear
	// TechnicalIndicatorRangeTwoYear chart range
	TechnicalIndicatorRangeTwoYear
	// TechnicalIndicatorRangeOneYear chart range
	TechnicalIndicatorRangeOneYear
	// TechnicalIndicatorRangeYearToDate chart range
	TechnicalIndicatorRangeYearToDate
	// TechnicalIndicatorRangeSixMonth chart range
	TechnicalIndicatorRangeSixMonth
	// TechnicalIndicatorRangeThreeMonth chart range
	TechnicalIndicatorRangeThreeMonth
	// TechnicalIndicatorRangeOneMonth chart range
	TechnicalIndicatorRangeOneMonth
	// TechnicalIndicatorRangeOneDay chart range
	TechnicalIndicatorRangeOneDay
)

func (TechnicalIndicatorRange) String added in v4.2.0

func (tir TechnicalIndicatorRange) String() string

type Trades

type Trades []struct {
	Price                 float64 `json:"price"`
	Size                  int     `json:"size"`
	TradeID               int     `json:"tradeId"`
	IsISO                 bool    `json:"isISO"`
	IsOddLot              bool    `json:"isOddLot"`
	IsOutsideRegularHours bool    `json:"isOutsideRegularHours"`
	IsSinglePriceCross    bool    `json:"isSinglePriceCross"`
	IsTradeThroughExempt  bool    `json:"isTradeThroughExempt"`
	Timestamp             int64   `json:"timestamp"`
}

Trades struct

type USExchanges

type USExchanges []struct {
	Name   string `json:"name"`
	Mic    string `json:"mic"`
	TapeID string `json:"tapeId"`
	OatsID string `json:"oatsId"`
	Type   string `json:"type"`
}

USExchanges struct

type USHolidaysAndTradingDates

type USHolidaysAndTradingDates []struct {
	Date           string `json:"date"`
	SettlementDate string `json:"settlementDate"`
}

USHolidaysAndTradingDates struct

type UpcomingEarnings

type UpcomingEarnings []struct {
	Symbol     string `json:"symbol"`
	ReportDate string `json:"reportDate"`
}

UpcomingEarnings struct

type UpcomingEarningsQueryParams

type UpcomingEarningsQueryParams struct {
	// FullUpcomingEarnings true will return the full estimate object.
	// This could cause the to hit your message limit in the millions.
	FullUpcomingEarnings bool `url:"fullUpcomingEarnings,omitempty"`
}

UpcomingEarningsQueryParams required/optional query parameters

type UpcomingEvents

type UpcomingEvents struct {
	IPOS      IPOCalendar `json:"ipos,omitempty"`
	Earnings  []Earning   `json:"earnings"`
	Dividends Dividends   `json:"dividends"`
	Splits    Splits      `json:"splits"`
}

UpcomingEvents struct

type UpcomingEventsQueryParams

type UpcomingEventsQueryParams struct {
	// FullUpcomingEarnings true will return the full estimate object.
	// This could cause the to hit your message limit in the millions.
	FullUpcomingEarnings bool `url:"fullUpcomingEarnings,omitempty"`
}

UpcomingEventsQueryParams required/optional query parameters

type Usage

type Usage struct {
	Messages struct {
		MonthlyUsage      int         `json:"monthlyUsage"`
		MonthlyPayAsYouGo int         `json:"monthlyPayAsYouGo"`
		DailyUsage        interface{} `json:"dailyUsage"`
		TokenUsage        interface{} `json:"tokenUsage"`
		KeyUsage          interface{} `json:"keyUsage"`
	} `json:"messages"`
}

Usage struct

type VolumeByVenue

type VolumeByVenue []struct {
	Volume           int     `json:"volume"`
	Venue            string  `json:"venue"`
	VenueName        string  `json:"venueName"`
	MarketPercent    float64 `json:"marketPercent"`
	AvgMarketPercent float64 `json:"avgMarketPercent"`
	Date             string  `json:"date"`
}

VolumeByVenue struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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