iex

package module
v0.0.0-...-46f3d6a Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 14 Imported by: 0

README

iexcloud

Go library for accessing the IEX Cloud API.

GoDoc Go Report Card License Badge

Overview

iexcloud provides a Go interface to the IEX Cloud API. To access the IEX Cloud API an account and token are required. The goal is for iexcloud to be compatible with the v1 version of the IEX Cloud API. There were some changes from the beta version to v1 of the API, so things may still be in flux for this library.

Installation

$ go get github.com/woodstock-tokyo/iexcloud
Testing

Prior to submitting a pull request, please run:

$ make check

To update and view the test coverage report:

$ make cover

License

iexcloud is released under the MIT license. Please see the LICENSE file for more information.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnnounceTimeJSON = map[AnnounceTime]string{
	// contains filtered or unexported fields
}

AnnounceTimeJSON maps an AnnounceTime to the string used in the JSON.

View Source
var AnnounceTimes = map[string]AnnounceTime{
	"BTO": bto,
	"DMT": dmt,
	"AMC": amc,
}

AnnounceTimes maps the string keys from the JSON to the AnnounceType constant values.

View Source
var IssueTypeJSON = map[IssueType]string{
	// contains filtered or unexported fields
}

IssueTypeJSON maps an IssueType to the string used in the JSON.

View Source
var IssueTypes = map[string]IssueType{
	"ad":   ad,
	"re":   re,
	"ce":   ce,
	"cef":  ce,
	"si":   si,
	"lp":   lp,
	"cs":   cs,
	"et":   et,
	"wt":   wt,
	"rt":   rt,
	"ut":   ut,
	"temp": temp,
	"":     blank,
}

IssueTypes maps the string keys from the JSON to the IssueType constant values.

View Source
var PathRangeJSON = map[PathRange]string{
	Mo1:  "1m",
	Mo3:  "3m",
	Mo6:  "6m",
	Yr1:  "1y",
	Yr2:  "2y",
	Yr5:  "5y",
	YTD:  "ytd",
	Next: "next",
}

PathRangeJSON maps a PathRange to the string used in the JSON.

View Source
var PathRanges = map[string]PathRange{
	"next": Next,
	"1m":   Mo1,
	"3m":   Mo3,
	"6m":   Mo6,
	"5y":   Yr5,
	"2y":   Yr2,
	"1y":   Yr1,
	"ytd":  YTD,
}

PathRanges maps the string keys from the JSON to the PathRange constant values.

Functions

This section is empty.

Types

type AccountMetadata

type AccountMetadata struct {
	PayAsYouGo       bool       `json:"overagesEnabled"`
	EffectiveDate    EpochTime  `json:"effectiveDate"`
	EndDateEffective *EpochTime `json:"endDateEffective"`
	SubscriptionTerm string     `json:"subscriptionTermType"`
	TierName         string     `json:"tierName"`
	MessageLimit     int        `json:"messageLimit"`
	MessagesUsed     int        `json:"messagesUsed"`
	CreditLimit      int        `json:"creditLimit"`
	CreditUsed       int        `json:"creditsUsed"`
}

AccountMetadata provides details about an IEX Cloud account.

type AdvancedStats

type AdvancedStats struct {
	KeyStats
	Beta                     float64 `json:"beta"`
	TotalCash                float64 `json:"totalCash"`
	CurrentDebt              float64 `json:"currentDebt"`
	Revenue                  float64 `json:"revenue"`
	GrossProfit              float64 `json:"grossProfit"`
	TotalRevenue             float64 `json:"totalRevenue"`
	EBITDA                   float64 `json:"EBITDA"`
	RevenuePerShare          float64 `json:"revenuePerShare"`
	RevenuePerEmployee       float64 `json:"revenuePerEmployee"`
	DebtToEquity             float64 `json:"debtToEquity"`
	ProfitMargin             float64 `json:"profitMargin"`
	EnterpriseValue          float64 `json:"enterpriseValue"`
	EnterpriseValueToRevenue float64 `json:"enterpriseValueToRevenue"`
	PriceToSales             float64 `json:"priceToSales"`
	PriceToBook              float64 `json:"priceToBook"`
	ForwardPERatio           float64 `json:"forwardPERatio"`
	PEGRatio                 float64 `json:"pegRatio"`
	PEHigh                   float64 `json:"peHigh"`
	PELow                    float64 `json:"peLow"`
	Week52HighDate           Date    `json:"week52highDate"`
	Week52LowDate            Date    `json:"week52lowDate"`
	PutCallRatio             float64 `json:"putCallRatio"`
}

AdvancedStats provides everything in key stats plus additional advanced stats such as EBITDA, ratios, key financial data, and more.

type AnnounceTime

type AnnounceTime int

AnnounceTime refers to the time of earnings announcement.

func (*AnnounceTime) MarshalJSON

func (a *AnnounceTime) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface for AnnounceTime.

func (*AnnounceTime) Set

func (a *AnnounceTime) Set(s string) error

Set sets the issue type using a string.

func (AnnounceTime) String

func (a AnnounceTime) String() string

String implements the Stringer interface for AnnounceTime.

func (*AnnounceTime) UnmarshalJSON

func (a *AnnounceTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for AnnounceTime.

type Auction

type 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            EpochTime `json:"startTime"`
	LastUpdate           EpochTime `json:"lastUpdate"`
}

Auction models auction data for a security

type BalanceSheet

type BalanceSheet struct {
	ReportDate              Date    `json:"reportDate"`
	FilingType              string  `json:"filingType"`
	FiscalDate              Date    `json:"fiscalDate"`
	FiscalQuarter           int     `json:"fiscalQuarter"`
	FiscalYear              int     `json:"fiscalYear"`
	Currency                string  `json:"currency"`
	CurrentCash             float64 `json:"currentCash"`
	ShortTermInvestments    float64 `json:"shortTermInvestments"`
	Receivables             float64 `json:"receivables"`
	Inventory               float64 `json:"inventory"`
	OtherCurrentAssets      float64 `json:"otherCurrentAssets"`
	CurrentAssets           float64 `json:"currentAssets"`
	LongTermInvestments     float64 `json:"longTermInvestments"`
	PropertyPlantEquipment  float64 `json:"propertyPlantEquipment"`
	Goodwill                float64 `json:"goodwill"`
	IntangibleAssets        float64 `json:"intangibleAssets"`
	OtherAssets             float64 `json:"otherAssets"`
	TotalAssets             float64 `json:"totalAssets"`
	AccountsPayable         float64 `json:"accountsPayable"`
	CurrentLongTermDebt     float64 `json:"currentLongTermDebt"`
	OtherCurrentLiabilities float64 `json:"otherCurrentLiabilities"`
	TotalCurrentLiabilities float64 `json:"totalCurrentLiabilities"`
	LongTermDebt            float64 `json:"longTermDebt"`
	OtherLiablities         float64 `json:"otherLiabilities"`
	MinorityInterest        float64 `json:"minorityInterest"`
	TotalLiabilities        float64 `json:"totalLiabilities"`
	CommonStock             float64 `json:"commonStock"`
	RetainedEarnings        float64 `json:"retainedEarnings"`
	TreasuryStock           float64 `json:"treasuryStock"`
	CapitalSurplus          float64 `json:"capitalSurplus"`
	ShareholderEquity       float64 `json:"shareholderEquity"`
	NetTangibleAssets       float64 `json:"netTangibleAssets"`
}

BalanceSheet models one balance sheet statement. Normally the amounts returned are integers, although the currentCash for UBNT returned is a float; therefore, these are all floats.

type BalanceSheets

type BalanceSheets struct {
	Symbol     string         `json:"symbol"`
	Statements []BalanceSheet `json:"balancesheet"`
}

BalanceSheets pulls balance sheet data. Available quarterly (4 quarters) and annually (4 years).

type BidAsk

type BidAsk struct {
	Price     float64   `json:"price"`
	Size      int       `json:"size"`
	Timestamp EpochTime `json:"timestamp"`
}

BidAsk models a bid or an ask for a quote.

type Book

type Book struct {
	Quote       Quote       `json:"quote"`
	Bids        []BidAsk    `json:"bids"`
	Asks        []BidAsk    `json:"asks"`
	Trades      []Trade     `json:"trades"`
	SystemEvent SystemEvent `json:"systemEvent"`
}

Book models the data returned from the /book endpoint.

type Books

type Books struct {
	Bids []CryptoCurrencyBid `json:"bids"`
	Asks []CryptoCurrencyAsk `json:"asks"`
}

Books models cryptocurrency bids and asks (price)

type CDRateType

type CDRateType string

CDRateType indicates the type of CD Rate.

const (
	NonJumboCD CDRateType = "MMNRNJ"
	JumboCD    CDRateType = "MMNRJD"
)

Available CD Rates.

func (CDRateType) String

func (cd CDRateType) String() string

String provides the Stringer interface for CDRateType.

type CEOCompensation

type CEOCompensation struct {
	Symbol              string `json:"symbol"`
	Name                string `json:"name"`
	Company             string `json:"companyName"`
	Location            string `json:"location"`
	Salary              int    `json:"salary"`
	Bonus               int    `json:"bonus"`
	StockAwards         int    `json:"stockAwards"`
	OptionAwards        int    `json:"optionAwards"`
	NonEquityIncentives int    `json:"nonEquityIncentives"`
	PensionAndDeferred  int    `json:"pensionAndDeferred"`
	OtherCompensation   int    `json:"otherComp"`
	Total               int    `json:"total"`
	Year                int    `json:"year"`
}

CEOCompensation models the compensation for a company's CEO.

type CashFlow

type CashFlow struct {
	ReportDate              Date    `json:"reportDate"`
	FiscalDate              Date    `json:"fiscalDate"`
	Currency                string  `json:"currency"`
	NetIncome               float64 `json:"netIncome"`
	Depreciation            float64 `json:"depreciation"`
	ChangesInReceivables    float64 `json:"changesInReceivables"`
	ChangesInInventories    float64 `json:"changesInInventories"`
	CashChange              float64 `json:"cashChange"`
	CashFlow                float64 `json:"cashFlow"`
	CapitalExpenditures     float64 `json:"capitalExpenditures"`
	Investments             float64 `json:"investments"`
	InvestingActivityOther  float64 `json:"investingActivityOther"`
	TotalInvestingCashFlows float64 `json:"totalInvestingCashFlows"`
	DividendsPaid           float64 `json:"dividendsPaid"`
	NetBorrowings           float64 `json:"netBorrowings"`
	OtherFinancingCashFlows float64 `json:"otherFinancingCashFlows"`
	CashFlowFinancing       float64 `json:"cashFlowFinancing"`
	ExchangeRateEffect      float64 `json:"exchangeRateEffect"`
}

CashFlow models one cash flow statement.

type CashFlows

type CashFlows struct {
	Symbol     string     `json:"symbol"`
	Statements []CashFlow `json:"cashflow"`
}

CashFlows pulls cash flow data. Available quarterly (4 quarters) or annually (4 years).

type Client

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

Client models a client to consume the IEX Cloud API.

func NewClient

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

NewClient creates a client with the given authorization token.

func (Client) AccountMetadata

func (c Client) AccountMetadata(ctx context.Context) (AccountMetadata, error)

AccountMetadata returns information about an IEX Cloud account, such as current tier, payment status, message quote usage, etc. An SK token is required to access.

func (Client) AdvancedStats

func (c Client) AdvancedStats(ctx context.Context, symbol string) (AdvancedStats, error)

AdvancedStats returns the everything in key stats plus additional advanced stats such as EBITDA, ratios, key financial data, and more.

func (Client) AnalystRecommendations

func (c Client) AnalystRecommendations(ctx context.Context, symbol string) ([]Recommendation, error)

AnalystRecommendations pulls data from the last four months using premium data from Refinitiv.

func (Client) AnalystRecommendationsAndTargets

func (c Client) AnalystRecommendationsAndTargets(ctx context.Context, symbol string) (CoreEstimate, error)

AnalystRecommendationsAndTargets provides current and historical consensus analyst recommendations and price targets.

func (Client) AnnualBalanceSheets

func (c Client) AnnualBalanceSheets(ctx context.Context, symbol string, num int) (BalanceSheets, error)

AnnualBalanceSheets returns the specified number of most recent annual balance sheets from the IEX Cloud endpoint for the given stock symbol.

func (Client) AnnualCashFlows

func (c Client) AnnualCashFlows(ctx context.Context, symbol string, num int) (CashFlows, error)

AnnualCashFlows returns the specified number of most recent annual cash flow statements from the IEX Cloud endpoint for the given stock symbol.

func (Client) AnnualFinancials

func (c Client) AnnualFinancials(ctx context.Context, symbol string, num int) (Financials, error)

AnnualFinancials returns the specified number of most recent annual financials for the given stock symbol. This endpoint is carried over from the IEX 1.0 API and may be deprecated in the future.

func (Client) AnnualIncomeStatements

func (c Client) AnnualIncomeStatements(ctx context.Context, symbol string, num int) (IncomeStatements, error)

AnnualIncomeStatements returns the specified number of most recent annual income statements from the IEX Cloud endpoint for the given stock symbol.

func (Client) AvailableDataPoints

func (c Client) AvailableDataPoints(ctx context.Context, symbol string) ([]DataPoint, error)

AvailableDataPoints returns a list of the available data points for a given symbol and the weight of each data point.

func (Client) BalanceSheets

func (c Client) BalanceSheets(ctx context.Context, symbol, period string, num int) (BalanceSheets, error)

BalanceSheets returns the specified number of most recent balance sheets with the given period (either "annual" or "quarter").

func (Client) BatchPrevious

func (c Client) BatchPrevious(ctx context.Context, symbols []string) (map[string]PreviousDay, error)

BatchPrevious returns the previous day price for up to 100 stock symbols.

func (Client) BatchQuote

func (c Client) BatchQuote(ctx context.Context, symbols []string) (map[string]Quote, error)

BatchQuote returns the quote data for up to 100 stock symbols.

func (Client) Book

func (c Client) Book(ctx context.Context, symbol string) (Book, error)

Book returns the quote, bids, asks, and trades for a given stock symbol.

func (Client) CDRate

func (c Client) CDRate(ctx context.Context, cd CDRateType) (float64, error)

CDRate returns the price for the given commodity not seasonally adjusted.

func (Client) CEOCompensation

func (c Client) CEOCompensation(ctx context.Context, symbol string) (CEOCompensation, error)

CEOCompensation provides CEO compensation for the given stock symbol.

func (Client) CPI

func (c Client) CPI(ctx context.Context) (float64, error)

CPI returns the consumer price index for all urban consumers.

func (Client) CollectionBySector

func (c Client) CollectionBySector(ctx context.Context, sector Sector) ([]Quote, error)

CollectionBySector returns an array of quote objects for all symbols within the specified sector.

func (Client) CollectionByTag

func (c Client) CollectionByTag(ctx context.Context, tag Tag) ([]Quote, error)

CollectionByTag returns an array of quote objects for all symbols within the specified tag collection.

func (Client) CommodityPrice

func (c Client) CommodityPrice(ctx context.Context, ct CommodityType) (float64, error)

CommodityPrice returns the price for the given commodity not seasonally adjusted.

func (Client) Company

func (c Client) Company(ctx context.Context, symbol string) (Company, error)

Company returns the copmany data from the IEX Cloud endpoint for the given stock symbol.

func (Client) CreateRule

func (c Client) CreateRule(ctx context.Context, rule Rule) (result CreatedRuleResponse, err error)

////////////////////////////////////////////////////////////////////////////

Rule Engine Endpoints

//////////////////////////////////////////////////////////////////////////// CreateRule create a rule

func (Client) CreditCardInterestRate

func (c Client) CreditCardInterestRate(ctx context.Context) (float64, error)

CreditCardInterestRate returns the commercial bank credit card interest rate.

func (Client) Crypto

func (c Client) Crypto(ctx context.Context, symbol string) (CryptoQuote, error)

Crypto provides a quote for a given cryptocurrency symbol.

func (Client) CryptoBooks

func (c Client) CryptoBooks(ctx context.Context, symbol string) (Books, error)

CryptoBooks returns a current snapshot of the book for a specified cryptocurrency

func (Client) CryptoPrice

func (c Client) CryptoPrice(ctx context.Context, symbol string) (Price, error)

CryptoPrice returns the price for a given cryptocurrency symbol.

func (Client) CryptoQuote

func (c Client) CryptoQuote(ctx context.Context, symbol string) (CryptoQuote, error)

CryptoQuote provides a quote for a given cryptocurrency symbol.

func (Client) CryptoSymbols

func (c Client) CryptoSymbols(ctx context.Context) ([]CryptoSymbol, error)

CryptoSymbols returns a list of cryptocurrencies that are supported by IEX Cloud.

func (Client) CurrencyRates

func (c Client) CurrencyRates(ctx context.Context, symbols []string) ([]CurrencyRate, error)

CurrencyRates returns real-time foreign currency exchange rates data updated every 250 milliseconds.

func (Client) DEEP

func (c Client) DEEP(ctx context.Context, symbol string) (DEEP, error)

DEEP provides all DEEP data for one stock symbol.

func (Client) DEEPBook

func (c Client) DEEPBook(ctx context.Context, symbols []string) (map[string]DEEPBook, error)

DEEPBook provides DEEP book data for multiple symbols

func (Client) DEEPTrades

func (c Client) DEEPTrades(ctx context.Context, symbols []string) (map[string][]Trade, error)

DEEPTrades provides DEEP trades data for multiple symbols.

func (Client) DataPoint

func (c Client) DataPoint(ctx context.Context, symbol, key string) ([]byte, error)

DataPoint returns the plain text value for the requested data point key for the given symbol.

func (Client) DataPointNumber

func (c Client) DataPointNumber(ctx context.Context, symbol, key string) (float64, error)

DataPointNumber returns the float64 for the requested data point key and the given symbol.

func (Client) DelayedQuote

func (c Client) DelayedQuote(ctx context.Context, symbol string) (DelayedQuote, error)

DelayedQuote returns the 15 minute delayed market quote from the IEX Cloud endpoint for the given stock symbol.

func (Client) DeleteRule

func (c Client) DeleteRule(ctx context.Context, ruleID string) (result bool, err error)

DeleteRule delete a rule

func (Client) Dividends

func (c Client) Dividends(ctx context.Context, symbol string, r PathRange) ([]Dividend, error)

Dividends returns the dividends from the IEX Cloud endpoint for the given stock symbol and the given date range.

func (Client) Earnings

func (c Client) Earnings(ctx context.Context, symbol string, num int) (Earnings, error)

Earnings returns the specified number of most recent earnings data from the IEX Cloud endpoint for the given stock symbol.

func (Client) EarningsToday

func (c Client) EarningsToday(ctx context.Context) (EarningsToday, error)

EarningsToday returns the earnings that will be reported today before the open and after the market closes.

func (Client) Estimates

func (c Client) Estimates(ctx context.Context, symbol string, num int) (Estimates, error)

Estimates returns the latest consensue estimates for the next fiscal period.

func (Client) ExchangeRate deprecated

func (c Client) ExchangeRate(ctx context.Context, from, to string) (ExchangeRate, error)

ExchangeRate returns an end of day exchange rate of a given currency pair.

Deprecated: This endpoint does no longer exist. See https://www.iexcloud.io/docs/api/#forex-currencies

func (Client) FXSymbols

func (c Client) FXSymbols(ctx context.Context) (FXSymbols, error)

FXSymbols returns a list of currencies and a list of foreign exchange currency pairs that are available supported by IEX Cloud.

func (Client) FederalFundsRate

func (c Client) FederalFundsRate(ctx context.Context) (float64, error)

FederalFundsRate returns the effective federal funds rate.

func (*Client) FetchURLToJSON

func (c *Client) FetchURLToJSON(ctx context.Context, u *url.URL, v any) error

Fetches JSON content from the given URL and unmarshals it into `v`.

func (Client) FundOwnership

func (c Client) FundOwnership(ctx context.Context, symbol string) ([]FundOwner, error)

FundOwnership returns the ten top holders of the given stock.

func (Client) Gainers

func (c Client) Gainers(ctx context.Context, limit int) ([]Quote, error)

Gainers returns a list of quotes for the top 10 stock gainers from the IEX Cloud endpoint updated intraday, 15 minute delayed.

func (*Client) GetBytes

func (c *Client) GetBytes(ctx context.Context, endpoint string) ([]byte, error)

GetBytes gets the data from the given endpoint.

func (*Client) GetFloat64

func (c *Client) GetFloat64(ctx context.Context, endpoint string) (float64, error)

GetFloat64 gets the number from the given endpoint.

func (*Client) GetJSON

func (c *Client) GetJSON(ctx context.Context, endpoint string, v any) error

GetJSON gets the JSON data from the given endpoint.

func (*Client) GetJSONWithQueryParams

func (c *Client) GetJSONWithQueryParams(ctx context.Context, endpoint string, queryParams map[string]string, v any) error

GetJSONWithQueryParams gets the JSON data from the given endpoint with the query parameters attached.

func (*Client) GetJSONWithoutToken

func (c *Client) GetJSONWithoutToken(ctx context.Context, endpoint string, v any) error

GetJSONWithoutToken gets the JSON data from the given endpoint without adding a token to the URL.

func (Client) GetRule

func (c Client) GetRule(ctx context.Context, req RequestRule) (result []RuleInfo, err error)

GetRule get a rule

func (Client) HistoricalPrices

func (c Client) HistoricalPrices(ctx context.Context, symbol string, timeframe HistoricalTimeFrame, options *HistoricalOptions) ([]HistoricalDataPoint, error)

HistoricalPrices retrieves historically adjusted market-wide data

func (Client) HistoricalPricesByDay

func (c Client) HistoricalPricesByDay(ctx context.Context, symbol string, day time.Time, options *HistoricalOptions) ([]HistoricalDataPoint, error)

HistoricalPricesByDay retrieves historically adjusted market-wide data for a given day

func (Client) Holidays

func (c Client) Holidays(ctx context.Context, dir string, last int, startDate time.Time) ([]TradeHolidayDate, error)

Holidays returns the last or next dates of holidays, for the given number of days, from the given start date.

func (Client) IEXPercent

func (c Client) IEXPercent(ctx context.Context, limit int) ([]Quote, error)

IEXPercent returns a list of quotes for the top 10 IEX stocks by percent from the IEX Cloud endpoint updated intraday, 15 minute delayed.

func (Client) IEXSymbols

func (c Client) IEXSymbols(ctx context.Context) ([]TradedSymbol, error)

IEXSymbols returns an array of symbols the Investors Exchange supports for trading. This list is updated daily as of 7:45 a.m. ET. Symbols may be added or removed by the Investors Exchange after the list was produced.

func (Client) IEXVolume

func (c Client) IEXVolume(ctx context.Context, limit int) ([]Quote, error)

IEXVolume returns a list of quotes for the top 10 IEX stocks by volume from the IEX Cloud endpoint updated intraday, 15 minute delayed.

func (Client) IPOsToday

func (c Client) IPOsToday(ctx context.Context) (IPOCalendar, error)

IPOsToday returns the IPOs that are scheduled to occur today.

func (Client) ISINMapping

func (c Client) ISINMapping(ctx context.Context, symbol string) ([]SymbolDetails, error)

ISINMapping convert ISIN to IEX Cloud symbols.

func (Client) InFocus

func (c Client) InFocus(ctx context.Context, limit int) ([]Quote, error)

InFocus returns a list of quotes for the top 10 in focus stocks from the IEX Cloud endpoint updated intraday, 15 minute delayed.

func (Client) InsiderRoster

func (c Client) InsiderRoster(ctx context.Context, symbol string) ([]InsiderRoster, error)

InsiderRoster returns the top 10 insiders with the most recent information for the given stock symbol.

func (Client) InsiderSummary

func (c Client) InsiderSummary(ctx context.Context, symbol string) ([]InsiderSummary, error)

InsiderSummary returns the insiders summary with the most recent information for the given stock symbol.

func (Client) InsiderTransactions

func (c Client) InsiderTransactions(ctx context.Context, symbol string) ([]InsiderTransaction, error)

InsiderTransactions returns a list of insider transactions for the given stock symbol.

func (Client) InstitutionalOwnership

func (c Client) InstitutionalOwnership(ctx context.Context, symbol string) ([]InstitutionalOwner, error)

InstitutionalOwnership returns the top 10 holders with the most recent information.

func (Client) IntradayHistoricalPrices

func (c Client) IntradayHistoricalPrices(ctx context.Context, symbol string, options *IntradayHistoricalOptions) ([]IntradayHistoricalDataPoint, error)

IntradayHistoricalPrices retrieves intraday historical market-wide data

func (Client) IntradayHistoricalPricesByDay

func (c Client) IntradayHistoricalPricesByDay(ctx context.Context, symbol string, day time.Time, options *IntradayHistoricalOptions) ([]IntradayHistoricalDataPoint, error)

IntradayHistoricalPricesByDay retrieves intraday historical market-wide data for a given day

func (Client) IntradayPrices

func (c Client) IntradayPrices(ctx context.Context, symbol string) ([]IntradayPrice, error)

IntradayPrices returns the aggregated intraday prices in one minute buckets.

func (Client) IntradayPricesWithOpts

func (c Client) IntradayPricesWithOpts(ctx context.Context, symbol string, options *IntradayOptions) ([]IntradayPrice, error)

IntradayPricesWithOpts returns the aggregated intraday prices in one minute buckets for the given options.

func (Client) IntradayStats

func (c Client) IntradayStats(ctx context.Context, symbol string) (IntradayStats, error)

IntradayStats retrieves the intraday stats on IEX. Deprecated. Use StatsIntraday instead.

func (Client) KeyStats

func (c Client) KeyStats(ctx context.Context, symbol string) (KeyStats, error)

KeyStats returns the key stats from the IEX Cloud endpoint for the given stock symbol.

func (Client) LargestTrades

func (c Client) LargestTrades(ctx context.Context, symbol string) ([]LargestTrade, error)

LargestTrades returns the 15 minute delayed, last sale eligible trade from the IEX Cloud endpoint for the given stock symbol.

func (Client) Last

func (c Client) Last(ctx context.Context, symbols []string) ([]Last, error)

Last provides trade data for executions on IEX. It is a near real time, intraday API that provides IEX last sale price, size and time. Last is ideal for developers that need a lightweight stock quote.

func (c Client) Logo(ctx context.Context, symbol string) (Logo, error)

Logo returns the logo data from the IEX Cloud endpoint for the given stock symbol.

func (Client) Losers

func (c Client) Losers(ctx context.Context, limit int) ([]Quote, error)

Losers returns a list of quotes for the top 10 stock losers from the IEX Cloud endpoint updated intraday, 15 minute delayed.

func (Client) MarketNews

func (c Client) MarketNews(ctx context.Context, num int) ([]News, error)

MarketNews retrieves the given number of news articles for the market.

func (Client) MarketVolume

func (c Client) MarketVolume(ctx context.Context) ([]Market, error)

MarketVolume returns the real time traded volume on U.S. markets.

func (Client) Markets

func (c Client) Markets(ctx context.Context) ([]Market, error)

Markets returns real time traded volume on U.S. markets. This may be deprecated in the future. Use MarketVolume instead.

func (Client) MostActive

func (c Client) MostActive(ctx context.Context, limit int) ([]Quote, error)

MostActive returns a list of quotes for the top 10 most active stocks from the IEX Cloud endpoint updated intraday, 15 minute delayed.

func (Client) MutualFundSymbols

func (c Client) MutualFundSymbols(ctx context.Context) ([]Symbol, error)

MutualFundSymbols returns an array of mutual funds that IEX Cloud supports for API calls.

func (Client) News

func (c Client) News(ctx context.Context, symbol string, num int) ([]News, error)

News retrieves the given number of news articles for the given stock symbol.

func (Client) NextHoliday

func (c Client) NextHoliday(ctx context.Context) (TradeHolidayDate, error)

NextHoliday returns the date of the next holiday.

func (Client) NextHolidays

func (c Client) NextHolidays(ctx context.Context, numDays int) ([]TradeHolidayDate, error)

NextHolidays returns the dates of the next holidays for the given number of days.

func (Client) NextTradingDay

func (c Client) NextTradingDay(ctx context.Context) (TradeHolidayDate, error)

NextTradingDay returns the date of the next trading day.

func (Client) NextTradingDays

func (c Client) NextTradingDays(ctx context.Context, numDays int) ([]TradeHolidayDate, error)

NextTradingDays returns the dates of the next trading days for the given number of days.

func (Client) OHLC

func (c Client) OHLC(ctx context.Context, symbol string) (OHLC, error)

OHLC returns the OHLC data from the IEX Cloud endpoint for the given stock symbol.

func (Client) OTCSymbols

func (c Client) OTCSymbols(ctx context.Context) ([]Symbol, error)

OTCSymbols returns an array of Over-the-Counter (OTC) stocks that IEX Cloud supports for API calls.

func (Client) OneLast

func (c Client) OneLast(ctx context.Context, symbol string) ([]Last, error)

OneLast provides the last trade data executions for one stock symbol.

func (Client) OneTOPS

func (c Client) OneTOPS(ctx context.Context, symbol string) ([]TOPS, error)

OneTOPS returns TOPS for one stock symbol.

func (Client) OptionsSymbols

func (c Client) OptionsSymbols(ctx context.Context) (map[string][]string, error)

OptionsSymbols returns a map keyed by symbol with the value of each symbol being an slice of available contract dates

func (Client) PauseRule

func (c Client) PauseRule(ctx context.Context, rule RequestRule) (result CreatedRuleResponse, err error)

PauseRule pause a rule

func (Client) Peers

func (c Client) Peers(ctx context.Context, symbol string) ([]string, error)

Peers returns a slice of peer stock symbols for the given stock symbol.

func (*Client) PostJsonData

func (c *Client) PostJsonData(ctx context.Context, endpoint string, v any) (data []byte, err error)

PostJsonData POST with json data

func (Client) PreviousDay

func (c Client) PreviousDay(ctx context.Context, symbol string) (PreviousDay, error)

PreviousDay returns the previous day adjusted price data from the IEX Cloud endpoint for the given stock symbol.

func (Client) PreviousHoliday

func (c Client) PreviousHoliday(ctx context.Context) (TradeHolidayDate, error)

PreviousHoliday returns the date of the previous holiday.

func (Client) PreviousTradingDay

func (c Client) PreviousTradingDay(ctx context.Context) (TradeHolidayDate, error)

PreviousTradingDay returns the date of the previous trading day.

func (Client) Price

func (c Client) Price(ctx context.Context, symbol string) (float64, error)

Price returns the current stock price for the given stock symbol.

func (Client) PriceTarget

func (c Client) PriceTarget(ctx context.Context, symbol string) (PriceTarget, error)

PriceTarget returns the latest average, high, and low analyst price target for a given stock symbol.

func (Client) QuarterlyBalanceSheets

func (c Client) QuarterlyBalanceSheets(ctx context.Context, symbol string, num int) (BalanceSheets, error)

QuarterlyBalanceSheets returns the specified number of most recent quarterly balance sheets from the IEX Cloud endpoint for the given stock symbol.

func (Client) QuarterlyCashFlows

func (c Client) QuarterlyCashFlows(ctx context.Context, symbol string, num int) (CashFlows, error)

QuarterlyCashFlows returns the specified number of most recent annual cash flow statements from the IEX Cloud endpoint for the given stock symbol.

func (Client) QuarterlyFinancials

func (c Client) QuarterlyFinancials(ctx context.Context, symbol string, num int) (Financials, error)

QuarterlyFinancials returns the specified number of most recent quarterly financials from the IEX Cloud endpoint for the given stock symbol.

func (Client) QuarterlyFinancialsAsReported

func (c Client) QuarterlyFinancialsAsReported(ctx context.Context, symbol string, num int) (FinancialsAsReported, error)

QuarterlyFinancialsAsReported returns the specified number of most recent quarterly 10-Q filings from the IEX Cloud endpoint for the given stock symbol.

func (Client) QuarterlyIncomeStatements

func (c Client) QuarterlyIncomeStatements(ctx context.Context, symbol string, num int) (IncomeStatements, error)

QuarterlyIncomeStatements returns the specified number of most recent annual income statements from the IEX Cloud endpoint for the given stock symbol.

func (Client) Quote

func (c Client) Quote(ctx context.Context, symbol string) (Quote, error)

Quote returns the quote data from the IEX Cloud endpoint for the given stock symbol.

func (Client) RecommendationTrends

func (c Client) RecommendationTrends(ctx context.Context, symbol string) ([]Recommendation, error)

RecommendationTrends provides a list of recommendations with the start and end date for each rating. Keep to not break API.

func (Client) RelevantStocks

func (c Client) RelevantStocks(ctx context.Context, symbol string) (RelevantStocks, error)

RelevantStocks is similar to the peers endpoint, except this will return most active market symbols when peers are not available. If the symbols returned are not peers, the peers key will be false. This is not intended to represent a definitive or accurate list of peers, and is subject to change at any time.

func (Client) ResumeRule

func (c Client) ResumeRule(ctx context.Context, rule RequestRule) (result CreatedRuleResponse, err error)

ResumeRule resume a rule

func (Client) Search

func (c Client) Search(ctx context.Context, fragment string) ([]SearchResult, error)

Search returns an array of search results for the given symbol fragment.

func (Client) SectorPerformance

func (c Client) SectorPerformance(ctx context.Context) ([]SectorPerformance, error)

SectorPerformance returns the performance of each sector for the current trading day. Performance is based on each sector ETF.

func (Client) Sectors

func (c Client) Sectors(ctx context.Context) ([]Sector, error)

Sectors returns an array of all sectors

func (Client) StatsIntraday

func (c Client) StatsIntraday(ctx context.Context) (IntradayStats, error)

StatsIntraday retrieves the intraday stats on IEX.

func (Client) Status

func (c Client) Status(ctx context.Context) (Status, error)

Status returns the IEX Cloud system status.

func (Client) Symbols

func (c Client) Symbols(ctx context.Context) ([]Symbol, error)

Symbols returns an array of symbols that IEX Cloud supports for API calls.

func (Client) SymbolsByExchange

func (c Client) SymbolsByExchange(ctx context.Context, exchange string) ([]Symbol, error)

SymbolsByExchange returns an array of symbols from the defined market that IEX Cloud supports for API calls.

func (Client) SymbolsByRegion

func (c Client) SymbolsByRegion(ctx context.Context, region string) ([]Symbol, error)

SymbolsByRegion returns an array of symbols from the defined region that IEX Cloud supports for API calls.

func (Client) TOPS

func (c Client) TOPS(ctx context.Context, symbols []string) ([]TOPS, error)

TOPS is used to receive real-time top of book quotations direct from IEX. The quotations received via TOPS provide an aggregated size and do not indicate the size or number of individual orders at the best bid or ask. Non-displayed orders and non-displayed portions of reserve orders are not represented in TOPS. TOPS also provides last trade price and size information. Trades resulting from either displayed or non-displayed orders matching on IEX will be reported. Routed executions will not be reported.

func (Client) Tags

func (c Client) Tags(ctx context.Context) ([]Tag, error)

Tags returns an array of tags. Tags can be found for each on each company.

func (Client) TradingDays

func (c Client) TradingDays(ctx context.Context, dir string, last int, startDate time.Time) ([]TradeHolidayDate, error)

TradingDays returns the last or next dates of trading days, for the given number of days, from the given start date.

func (Client) USExchanges

func (c Client) USExchanges(ctx context.Context) ([]USExchange, error)

USExchanges returns an array of U.S. Exchanges.

func (Client) UpcomingDividends

func (c Client) UpcomingDividends(ctx context.Context, symbol string) ([]Dividend, error)

UpcomingDividends returns all upcoming dividends for a given symbol. If an empty string is passed in for the symbol, data for the entire market is returned.

func (Client) UpcomingEarnings

func (c Client) UpcomingEarnings(ctx context.Context, symbol string, fullUpcomingEarnings bool) ([]UpcomingEarning, error)

UpcomingEarnings returns all upcoming earnings for a given symbol. If an empty string is passed in for the symbol, data for the entire market is returned. If fullUpcomingEarnings is set to true, full estimates objects are returned; otherwise, earnings will only return Symbol and ReportDate.

func (Client) UpcomingEvents

func (c Client) UpcomingEvents(ctx context.Context, symbol string, fullUpcomingEarnings bool) (UpcomingEvents, error)

UpcomingEvents returns all upcoming events for a given symbol. If an empty string is passed in for the symbol, data for the entire market, including IPOs, is returned. If fullUpcomingEarnings is set to true, full estimates objects are returned; otherwise, earnings will only return Symbol and ReportDate.

func (Client) UpcomingIPOs

func (c Client) UpcomingIPOs(ctx context.Context) (IPOCalendar, error)

UpcomingIPOs returns all upcoming IPOs for the entire market.

func (Client) UpcomingSplits

func (c Client) UpcomingSplits(ctx context.Context, symbol string) ([]Split, error)

UpcomingSplits returns all upcoming splits for a given symbol. If an empty string is passed in for the symbol, data for the entire market is returned.

func (Client) Usage

func (c Client) Usage(ctx context.Context) (Usage, error)

Usage retrieves the current month usage for your account.

func (Client) VolumeByVenue

func (c Client) VolumeByVenue(ctx context.Context, symbol string) ([]VenueVolume, error)

VolumeByVenue returns the 15 minute delayed and 30 day average consolidated volume percentage of a stock by market. This will return 13 values sorted in ascending order by current day trading volume percentage.

type ClientOption

type ClientOption func(*Client)

ClientOption applies an option to the client.

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL sets the baseURL for a new IEX Client

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient sets the http.Client for a new IEX Client

func WithSecureHTTPClient

func WithSecureHTTPClient() ClientOption

WithSecureHTTPClient sets a secure http.Client for a new IEX Client

type CommodityPrice

type CommodityPrice struct {
	Value   float64   `json:"value"`
	ID      string    `json:"id"`
	Source  string    `json:"source"`
	Key     string    `json:"key"`
	Subkey  string    `json:"subkey"`
	Date    EpochTime `json:"date"`
	Updated EpochTime `json:"updated"`
}

CommodityPrice models the price for a single commodity when returned using the time series endpoint.

type CommodityType

type CommodityType string

CommodityType indicates the type of commodity.

const (
	WestTexasOil       CommodityType = "DCOILWTICO"
	BrentEuropeOil     CommodityType = "DCOILBRENTEU"
	HenryHubNG         CommodityType = "DHHNGSP"
	NYHeatingOil       CommodityType = "DHOILNYH"
	GulfCoastJetFuel   CommodityType = "DJFUELUSGULF"
	USDiesel           CommodityType = "GASDESW"
	USRegularGas       CommodityType = "GASREGCOVW"
	USMidgradeGas      CommodityType = "GASMIDCOVW"
	USPremiumGas       CommodityType = "GASPRMCOVW"
	MontBelvieuPropane CommodityType = "DPROPANEMBTX"
)

Available commodities.

func (CommodityType) String

func (ct CommodityType) String() string

String provides the Stringer interface for CommodityType.

type Company

type Company struct {
	Symbol         string   `json:"symbol"`
	Name           string   `json:"companyName"`
	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"`
	Employees      int      `json:"employees"`
	Tags           []string `json:"tags"`
	SecurityName   string   `json:"securityName"`
	PrimarySICCode int      `json:"primarySicCode"`
	Address        string   `json:"address"`
	Address2       string   `json:"address2"`
	State          string   `json:"state"`
	City           string   `json:"city"`
	Zip            string   `json:"zip"`
	Country        string   `json:"country"`
	Phone          string   `json:"phone"`
}

Company models the company data from the /company endpoint.

type Condition

type Condition []any

type CoreEstimate

type CoreEstimate struct {
	ID              string    `json:"CORE_ESTIMATES"`
	Key             string    `json:"key"`
	Subkey          string    `json:"subkey"`
	Symbol          string    `json:"symbol"`
	AnalystCount    int       `json:"analystCount"`
	ConsensusDate   Date      `json:"consensusDate"`
	MarketConsensus float64   `json:"marketConsensus"`
	TargetPrice     float64   `json:"marketConsensusTargetPrice"`
	Date            EpochTime `json:"date"`
	Updated         EpochTime `json:"updated"`
}

CoreEstimate modules a current or historical consensus analyst recommendation and price target.

type CreatedRuleResponse

type CreatedRuleResponse struct {
	ID     string `json:"id"`
	Weight uint   `json:"weight"`
}

type CryptoCurrencyAsk

type CryptoCurrencyAsk struct {
	Price     string    `json:"price"`
	Size      string    `json:"size"`
	Timestamp EpochTime `json:"timestamp"`
}

CryptoCurrencyAsk models a cryptocurrency ask (price)

type CryptoCurrencyBid

type CryptoCurrencyBid struct {
	Price     string    `json:"price"`
	Size      string    `json:"size"`
	Timestamp EpochTime `json:"timestamp"`
}

CryptoCurrencyBid models a cryptocurrency bid (price)

type CryptoQuote

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

CryptoQuote models a quote for a cryptocurrency.

type CryptoSymbol

type CryptoSymbol struct {
	Symbol    string `json:"symbol"`
	Name      string `json:"name"`
	Date      Date   `json:"date"`
	IsEnabled bool   `json:"isEnabled"`
	Type      string `json:"type"`
	IEXID     string `json:"iexId"`
}

CryptoSymbol models cryptocurrency symbol that IEX Cloud supports for API calls.

type Currency

type Currency struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

Currency models the code and name for a currency.

type CurrencyPair

type CurrencyPair struct {
	From string `json:"fromCurrency"`
	To   string `json:"toCurrency"`
}

CurrencyPair models an available currency pair listing both the from currency and the to currency codes.

type CurrencyRate

type CurrencyRate struct {
	Symbol    string    `json:"symbol"`
	Rate      float64   `json:"rate"`
	Timestamp EpochTime `json:"timestamp"`
}

CurrencyRate returns real-time foreign currency exchange rates data.

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  EpochTime     `json:"lastSaleTime"`
	LastUpdated   EpochTime     `json:"lastUpdated"`
	Bids          []BidAsk      `json:"bids"`
	Asks          []BidAsk      `json:"asks"`
	SystemEvent   SystemEvent   `json:"systemEvent"`
	TradingStatus TradingStatus `json:"tradingStatus"`
	OpHaltStatus  OpHaltStatus  `json:"opHaltStatus"`
	SSRStatus     SSRStatus     `json:"ssrStatus"`
	SecurityEvent SecurityEvent `json:"securityEvent"`
	Trades        []Trade       `json:"trades"`
	TradeBreaks   []Trade       `json:"tradeBreaks"`
	Auction       Auction       `json:"auction"`
}

DEEP is used to receive real-time depth of book quotations direct from IEX. The depth of book quotations received via DEEP provide an aggregated size of resting displayed orders at a price and side, and do not indicate the size or number of individual orders at any price level.

type DEEPBook

type DEEPBook struct {
	Bids []BidAsk `json:"bids"`
	Asks []BidAsk `json:"asks"`
}

DEEPBook contains just the bids and asks for a specified symbol

type DataPoint

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

DataPoint models a single data point.

type Date

type Date time.Time

Date models a report date

func (*Date) GobDecode

func (d *Date) GobDecode(data []byte) error

GobDecode implements the gob.GobDecoder interface.

func (*Date) GobEncode

func (d *Date) GobEncode() ([]byte, error)

GobEncode implements the gob.GobEncoder interface.

func (*Date) MarshalJSON

func (d *Date) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface for Date.

func (Date) String

func (d Date) String() string

String implements the stringer interface for the Date type.

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for Date.

type DelayedQuote

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

DelayedQuote returns the 15 minute delayed market quote.

type Dividend

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

Dividend models one dividend (basic) for the stock fundamentals.

type Earning

type Earning struct {
	EPSReportDate            Date         `json:"EPSReportDate"`
	EPSSurpriseDollar        float64      `json:"EPSSurpriseDollar"`
	EPSSurpriseDollarPercent float64      `json:"EPSSurpriseDollarPercent"`
	ActualEPS                float64      `json:"actualEPS"`
	AnnounceTime             AnnounceTime `json:"announceTime"`
	ConsensusEPS             float64      `json:"consensusEPS"`
	Currency                 string       `json:"currency"`
	FiscalEndDate            Date         `json:"fiscalEndDate"`
	FiscalPeriod             string       `json:"fiscalPeriod"`
	NumberOfEstimates        int          `json:"numberOfEstimates"`
	PeriodType               string       `json:"periodType"`
	Symbol                   string       `json:"symbol"`
	YearAgo                  float64      `json:"yearAgo"`
	YearAgoChangePercent     float64      `json:"yearAgoChangePercent"`
	ID                       string       `json:"id"`
	Key                      string       `json:"key"`
	SubKey                   string       `json:"subkey"`
	Date                     uint64       `json:"date"`
	Updated                  uint64       `json:"updated"`
}

Earning models the earnings for one date.

type Earnings

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

Earnings provides earnings data for a given company including the actual EPS, consensus, and fiscal period. Earnings are available quarterly (last 4 quarters) and annually (last 4 years).

type EarningsToday

type EarningsToday struct {
	BeforeOpen    []TodayEarning `json:"bto"`
	AfterClose    []TodayEarning `json:"amc"`
	DuringTrading []TodayEarning `json:"other"`
}

EarningsToday models the earning that will be reported today as two arrays: before the open and after market close. Each array contains an object with all keys from earnings, a quote object, and a headline key.

type EpochTime

type EpochTime time.Time

EpochTime refers to unix timestamps used for some fields in the API

func (EpochTime) MarshalJSON

func (e EpochTime) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface for EpochTime.

func (EpochTime) String

func (e EpochTime) String() string

String implements the Stringer interface for EpochTime.

func (*EpochTime) UnmarshalJSON

func (e *EpochTime) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the Unmarshaler interface for EpochTime.

type Error

type Error struct {
	StatusCode int
	Message    string
}

Error represents an IEX API error

func (Error) Error

func (e Error) Error() string

Error implements the error interface

type Estimate

type Estimate struct {
	AnnounceTime                string  `json:"announceTime"`
	ConsensusEPS                float64 `json:"consensusEPS"`
	BookValuePerShare           float64 `json:"consensusBPS"`
	CashFlowValuePerShare       float64 `json:"consensusCPS"`
	CapitalExpenditures         float64 `json:"consensusCPX"`
	DividendPerShare            float64 `json:"consensusDPS"`
	EBIT                        float64 `json:"consensusEBI"`
	EBITDA                      float64 `json:"consensusEBT"`
	FundsFromOperations         float64 `json:"consensusFFO"`
	EPSFullyReported            float64 `json:"consensusGPS"`
	GrossMargin                 float64 `json:"consensusGRM"`
	NetAssetValue               float64 `json:"consensusNAV"`
	NetIncome                   float64 `json:"consensusNET"`
	OperatingProfit             float64 `json:"consensusOPR"`
	PreTaxProfit                float64 `json:"consensusPRE"`
	ReturnOnAssets              float64 `json:"consensusROA"`
	ReturnOnEquity              float64 `json:"consensusROE"`
	Revenue                     float64 `json:"consensusSAL"`
	Currency                    string  `json:"currency"`
	FiscalEndDate               Date    `json:"fiscalEndDate"`
	FiscalPeriod                string  `json:"fiscalPeriod"`
	NumberOfEstimates           int     `json:"numberOfEstimates"`
	NumEstEPS                   int     `json:"numberOfEstimatesEPS"`
	NumEstBookValuePerShare     int     `json:"numberOfEstimatesBPS"`
	NumEstCashFlowValuePerShare int     `json:"numberOfEstimatesCPS"`
	NumEstCapitalExpenditures   int     `json:"numberOfEstimatesCPX"`
	NumEstDividendPerShare      int     `json:"numberOfEstimatesDPS"`
	NumEstEBIT                  int     `json:"numberOfEstimatesEBI"`
	NumEstEBITDA                int     `json:"numberOfEstimatesEBT"`
	NumEstFundsFronOperations   int     `json:"numberOfEstimatesFFO"`
	NumEstEPSFullyReported      int     `json:"numberOfEstimatesGPS"`
	NumEstGrossMargin           int     `json:"numberOfEstimatesGRM"`
	NumEstNetAssetValue         int     `json:"numberOfEstimatesNAV"`
	NumEstNetIncome             int     `json:"numberOfEstimatesNET"`
	NumEstOperatingProfit       int     `json:"numberOfEstimatesOPR"`
	NumEstPreTaxProfit          int     `json:"numberOfEstimatesPRE"`
	NumEstReturnOnAssets        int     `json:"numberOfEstimatesROA"`
	NumEstReturnOnEquity        int     `json:"numberOfEstimatesROE"`
	NumEstRevenue               int     `json:"numberOfEstimatesSAL"`
	PeriodType                  string  `json:"periodType"`
	ReportDate                  Date    `json:"reportDate"`
	Symbol                      string  `json:"symbol"`
}

Estimate models one estimate.

type Estimates

type Estimates struct {
	Symbol    string     `json:"symbol"`
	Estimates []Estimate `json:"estimates"`
}

Estimates models the latest consensus esimtate for the next fiscal period.

type ExchangeRate

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

ExchangeRate models the exchange rate of a given currency pair.

type FXSymbols

type FXSymbols struct {
	Currencies []Currency     `json:"currencies"`
	Pairs      []CurrencyPair `json:"pairs"`
}

FXSymbols provides a list of the currencies and currency pairs available from IEX Cloud.

type Financial

type Financial struct {
	ReportDate             Date    `json:"reportDate"`
	FiscalDate             Date    `json:"fiscalDate"`
	Currency               string  `json:"currency"`
	GrossProfit            float64 `json:"grossProfit"`
	CostOfRevenue          float64 `json:"costOfRevenue"`
	OperatingRevenue       float64 `json:"operatingRevenue"`
	TotalRevenue           float64 `json:"totalRevenue"`
	OperatingIncome        float64 `json:"operatingIncome"`
	NetIncome              float64 `json:"netIncome"`
	ResearchAndDevelopment float64 `json:"researchAndDevelopment"`
	OperatingExpense       float64 `json:"operatingExpense"`
	CurrentAssets          float64 `json:"currentAssets"`
	TotalAssets            float64 `json:"totalAssets"`
	TotalLiabilities       float64 `json:"totalLiabilities"`
	CurrentCash            float64 `json:"currentCash"`
	CurrentDebt            float64 `json:"currentDebt"`
	ShortTermDebt          float64 `json:"shortTermDebt"`
	LongTermDebt           float64 `json:"LongTermDebt"`
	TotalCash              float64 `json:"totalCash"`
	TotalDebt              float64 `json:"totalDebt"`
	ShareholderEquity      float64 `json:"shareholderEquity"`
	CashChange             float64 `json:"cashChange"`
	CashFlow               float64 `json:"cashFlow"`
}

Financial pulls income statement, balance sheet, and cash flow data from the most recent reported quarter. This endpoint is carried over from the IEX 1.0 API. Use the new cash-flow, income statement, and balance-sheet endpoints for new data.

type FinancialAsReported

type FinancialAsReported struct {
	ID            string    `json:"id"`
	Source        string    `json:"source"`
	Key           string    `json:"key"`
	Subkey        string    `json:"subkey"`
	Date          EpochTime `json:"date"`
	Updated       EpochTime `json:"updated"`
	FiscalYear    int64     `json:"formFiscalYear"`
	Version       string    `json:"version"`
	PeriodStart   EpochTime `json:"periodStart"`
	PeriodEnd     EpochTime `json:"periodEnd"`
	DateFiled     EpochTime `json:"dateFiled"`
	FiscalQuarter int64     `json:"formFiscalQuarter"`
}

FinancialAsReported models an SEC financial filing.

type Financials

type Financials struct {
	Symbol     string      `json:"symbol"`
	Financials []Financial `json:"financials"`
}

Financials models income statement, balance sheet, and cash flow data from the most recent reported quarter.

type FinancialsAsReported

type FinancialsAsReported []FinancialAsReported

FinancialsAsReported models multiple SEC financial 10-K or 10-Q filings.

type FundOwner

type FundOwner struct {
	AdjustedHolding     float64   `json:"adjHolding"`
	AdjustedMarketValue float64   `json:"adjMv"`
	Name                string    `json:"entityProperName"`
	ReportDate          EpochTime `json:"reportDate"`
	ReportedHolding     float64   `json:"reportedHolding"`
	ReportedMarketValue float64   `json:"reportedMv"`
}

FundOwner models a fund owning a stock.

type HistoricalDataPoint

type HistoricalDataPoint struct {
	Close          float64 `json:"close"`
	High           float64 `json:"high"`
	Low            float64 `json:"low"`
	Open           float64 `json:"open"`
	Symbol         string  `json:"symbol"`
	Volume         float64 `json:"volume"`
	ID             string  `json:"id"`
	Key            string  `json:"key"`
	Subkey         string  `json:"subkey"`
	Date           Date    `json:"date"`
	Minute         string  `json:"minute"`
	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"`
	Label          string  `json:"label"`
	ChangeOverTime float64 `json:"changeOverTime"`
}

HistoricalDataPoint Represents a single historical data point for a stock

func (HistoricalDataPoint) Time

func (p HistoricalDataPoint) Time() time.Time

Time merges HistoricalDataPoint's Date and Mintue field and get the exact time. Useful for "5dm" and "1mm" time frames

type HistoricalOptions

type HistoricalOptions struct {
	ChartCloseOnly  bool   `url:"chartCloseOnly,omitempty"`
	ChartSimplify   bool   `url:"chartSimplify,omitempty"`
	ChartInterval   int    `url:"chartInterval,omitempty"`
	ChangeFromClose bool   `url:"changeFromClose,omitempty"`
	ChartLast       int    `url:"chartLast,omitempty"`
	DisplayPercent  bool   `url:"displayPercent,omitempty"`
	Range           string `url:"range,omitempty"`
	ExactDate       string `url:"exactDate,omitempty"`
	Sort            string `url:"sort,omitempty"`
	IncludeToday    bool   `url:"includeToday,omitempty"`
}

HistoricalOptions optional query params to pass to historical endpoint If values are false or 0 they aren't passed.

type HistoricalPrice

type HistoricalPrice struct {
	Date string `json:"date"`
}

HistoricalPrice models the data for a historical stock price.

type HistoricalTimeFrame

type HistoricalTimeFrame string

HistoricalTimeFrame enum for selecting time frame of historical data

const (
	// FiveDayHistorical Five days historically adjusted market-wide data
	FiveDayHistorical HistoricalTimeFrame = "5d"
	// FiveDay10MinuteHistorical Five days historically adjusted market-wide data in 10 minute intervals
	FiveDay10MinuteHistorical HistoricalTimeFrame = "5dm"
	// OneMonthHistorical One month (default) historically adjusted market-wide data
	OneMonthHistorical HistoricalTimeFrame = "1m"
	// OneMonth30MinuteHistorical One month historically adjusted market-wide data in 30 minute intervals
	OneMonth30MinuteHistorical HistoricalTimeFrame = "1mm"
	// ThreeMonthHistorical Three months historically adjusted market-wide data
	ThreeMonthHistorical HistoricalTimeFrame = "3m"
	// SixMonthHistorical Six months historically adjusted market-wide data
	SixMonthHistorical HistoricalTimeFrame = "6m"
	// OneYearHistorical One year historically adjusted market-wide data
	OneYearHistorical HistoricalTimeFrame = "1y"
	// TwoYearHistorical Two year historically adjusted market-wide data
	TwoYearHistorical HistoricalTimeFrame = "2y"
	// FiveYearHistorical Five year historically adjusted market-wide data
	FiveYearHistorical HistoricalTimeFrame = "5y"
	// YearToDateHistorical Year to date historically adjusted market-wide data
	YearToDateHistorical HistoricalTimeFrame = "ytd"
	// MaxHistorical All available historically adjusted market-wide data up to 15 years
	MaxHistorical HistoricalTimeFrame = "max"
)

func (HistoricalTimeFrame) Valid

func (htf HistoricalTimeFrame) Valid() bool

Valid Determines if HistoricalTimeFrame is a defined constant

type HourMinute

type HourMinute time.Duration

HourMinute models a duration of hours and minutes.

func (*HourMinute) UnmarshalJSON

func (hm *HourMinute) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for Date.

type IPO

type IPO struct {
	Symbol                 string   `json:"symbol"`
	CompanyName            string   `json:"companyName"`
	ExpectedDate           Date     `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            int      `json:"offerAmount"`
	TotalExpenses          int      `json:"totalExpenses"`
	SharesOverAlloted      int      `json:"sharesOverAlloted"`
	ShareholderShares      int      `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"`
}

IPO is all available data for an IPO.

type IPOCalendar

type IPOCalendar struct {
	RawData  []IPO     `json:"rawData"`
	ViewData []IPOView `json:"viewData"`
}

IPOCalendar is a list of IPOs.

type IPOView

type IPOView 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 Date   `json:"Expected"`
}

IPOView is IPO data structured for display to a user.

type IncomeStatement

type IncomeStatement struct {
	ReportDate             Date    `json:"reportDate"`
	FiscalDate             Date    `json:"fiscalDate"`
	Currency               string  `json:"currency"`
	TotalRevenue           float64 `json:"totalRevenue"`
	CostOfRevenue          float64 `json:"costOfRevenue"`
	GrossProfit            float64 `json:"grossProfit"`
	ResearchAndDevelopment float64 `json:"researchAndDevelopment"`
	SellingGeneralAndAdmin float64 `json:"sellingGeneralAndAdmin"`
	OperatingExpense       float64 `json:"operatingExpense"`
	OperatingIncome        float64 `json:"operatingIncome"`
	OtherIncomeExpenseNet  float64 `json:"otherIncomeExpenseNet"`
	EBIT                   float64 `json:"ebit"`
	InterestIncome         float64 `json:"interestIncome"`
	PretaxIncome           float64 `json:"pretaxIncome"`
	IncomeTax              float64 `json:"incomeTax"`
	MinorityInterest       float64 `json:"minorityInterest"`
	NetIncome              float64 `json:"netIncome"`
	NetIncomeBasic         float64 `json:"netIncomeBasic"`
}

IncomeStatement models one income statement.

type IncomeStatements

type IncomeStatements struct {
	Symbol     string            `json:"symbol"`
	Statements []IncomeStatement `json:"income"`
}

IncomeStatements pulls income statement data. Available quarterly (4 quarters) and annually (4 years).

type InsiderRoster

type InsiderRoster struct {
	EntityName string    `json:"entityName"`
	Position   float64   `json:"position"`
	ReportDate EpochTime `json:"reportDate"`
}

InsiderRoster models the top 10 insiders with the most recent information.

type InsiderSummary

type InsiderSummary struct {
	Name           string    `json:"fullName"`
	NetTransaction int       `json:"netTransaction"`
	ReportedTitle  string    `json:"reportedTitle"`
	TotalBought    int       `json:"totalBought"`
	TotalSold      int       `json:"totalSold"`
	Updated        EpochTime `json:"updated"`
}

InsiderSummary models a summary of insider information.

type InsiderTransaction

type InsiderTransaction struct {
	EffectiveDate EpochTime `json:"effectiveDate"`
	Name          string    `json:"fullName"`
	ReportedTitle string    `json:"reportedTitle"`
	Price         float64   `json:"tranPrice"`
	Shares        int       `json:"tranShares"`
	Value         float64   `json:"tranValue"`
}

InsiderTransaction models a buy or sell transaction made by an insider of a company.

type InstitutionalOwner

type InstitutionalOwner struct {
	AdjustedHolding     float64   `json:"adjHolding"`
	AdjustedMarketValue float64   `json:"adjMv"`
	EntityName          string    `json:"entityProperName"`
	ReportDate          EpochTime `json:"reportDate"`
	ReportedHolding     float64   `json:"reportedHolding"`
}

InstitutionalOwner models an institutional owner of a stock.

type IntradayHistoricalDataPoint

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

IntradayHistoricalDataPoint Represents a single intraday data point for a stock

type IntradayHistoricalOptions

type IntradayHistoricalOptions struct {
	ChartIEXOnly    bool `url:"chartIEXOnly,omitempty"`
	ChartReset      bool `url:"chartReset,omitempty"`
	ChartSimplify   bool `url:"chartSimplify,omitempty"`
	ChartInterval   int  `url:"chartInterval,omitempty"`
	ChangeFromClose bool `url:"changeFromClose,omitempty"`
	ChartLast       int  `url:"chartLast,omitempty"`
}

IntradayHistoricalOptions optional query params to pass to intraday historical endpoint If values are false or 0 they aren't passed.

type IntradayOptions

type IntradayOptions struct {
	ChartIEXOnly     bool   `url:"chartIEXOnly,omitempty"`
	ChartReset       bool   `url:"chartReset,omitempty"`
	ChartSimplify    bool   `url:"chartSimplify,omitempty"`
	ChartInterval    int    `url:"chartInterval,omitempty"`
	ChangeFromClose  bool   `url:"changeFromClose,omitempty"`
	ChartLast        int    `url:"chartLast,omitempty"`
	ExactDate        string `url:"exactDate,omitempty"` // Formatted as YYYYMMDD
	ChartIEXWhenNull bool   `url:"chartIEXWhenNull,omitempty"`
}

IntradayOptions optional query params to pass to intraday endpoint If values are false or 0 they aren't passed.

func (*IntradayOptions) SetExactDate

func (opt *IntradayOptions) SetExactDate(day time.Time)

SetExactDate formats a given date as IEX expects

type IntradayPrice

type IntradayPrice struct {
	Date                 Date       `json:"date"`
	Minute               HourMinute `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"`
	MarketNumTrades      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"`
	NumTrades            int        `json:"numberOfTrades"`
	ChangeOverTime       float64    `json:"changeOverTime"`
}

IntradayPrice models the data for an aggregated intraday price in one minute buckets.

type IntradayStats

type IntradayStats struct {
	Volume        Stat `json:"volume"`
	SymbolsTraded Stat `json:"symbolsTraded"`
	RoutedVolume  Stat `json:"routedVolume"`
	Notional      Stat `json:"notional"`
	MarketShare   Stat `json:"marketShare"`
}

IntradayStats models the intraday stats on IEX.

type IssueType

type IssueType int

IssueType refers to the common issue type of the stock.

func (*IssueType) MarshalJSON

func (i *IssueType) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface for IssueType.

func (*IssueType) Set

func (i *IssueType) Set(s string) error

Set sets the issue type using a string.

func (IssueType) String

func (i IssueType) String() string

String implements the Stringer interface for IssueType.

func (*IssueType) UnmarshalJSON

func (i *IssueType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for IssueType.

type KeyStats

type KeyStats struct {
	Name                string  `json:"companyName"`
	MarketCap           float64 `json:"marketCap"`
	Week52High          float64 `json:"week52High"`
	Week52Low           float64 `json:"week52Low"`
	Week52Change        float64 `json:"week52Change"`
	SharesOutstanding   float64 `json:"sharesOutstanding"`
	Float               float64 `json:"float"`
	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    Date    `json:"nextDividendDate"`
	ExDividendDate      Date    `json:"exDividendDate"`
	NextEarningsDate    Date    `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"`
}

KeyStats models the data returned from IEX Cloud's /stats endpoint.

type LargestTrade

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

LargestTrade models the 15 minute delayed, last sale eligible trades.

type Last

type Last struct {
	Symbol string    `json:"symbol"`
	Price  float64   `json:"Price"`
	Size   int       `json:"Size"`
	Time   EpochTime `json:"time"`
}

Last provides trade data for executions on IEX. It is a near real time, intraday API that provides IEX last sale price, size and time. Last is ideal for developers that need a lightweight stock quote.

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

Logo models the /logo endpoint.

type Market

type Market struct {
	MIC         string    `json:"mic"`
	TapeID      string    `json:"tapeId"`
	Venue       string    `json:"venueName"`
	Volume      int       `json:"volume"`
	TapeA       int       `json:"tapeA"`
	TapeB       int       `json:"tapeB"`
	TapeC       int       `json:"tapeC"`
	Percent     float64   `json:"marketPercent"`
	LastUpdated EpochTime `json:"lastUpdated"`
}

Market models the traded volume on U.S. markets.

type News

type News struct {
	Time       EpochTime `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"`
	Language   string    `json:"lang"`
	HasPaywall bool      `json:"hasPaywall"`
}

News models a news item either for the market or for an individual stock.

type OHLC

type OHLC struct {
	Open  OpenClose `json:"open"`
	Close OpenClose `json:"close"`
	High  float64   `json:"high"`
	Low   float64   `json:"low"`
}

OHLC models the open, high, low, close for a stock.

type OpHaltStatus

type OpHaltStatus struct {
	IsHalted  bool      `json:"isHalted"`
	Timestamp EpochTime `json:"timestamp"`
}

OpHaltStatus models the operational halt status of a security

type OpenClose

type OpenClose struct {
	Price float64 `json:"price"`
	Time  int     `json:"Time"`
}

OpenClose provides the price and time for either the open or close price of a stock.

type Output

type Output struct {
	Frequency float64 `json:"frequency"`
	Method    string  `json:"method"`
	Url       string  `json:"url"`
}

Output webhook case

type PathRange

type PathRange int

PathRange refers to the date range used in the path of an endpoint.

const (
	Mo1 PathRange = iota
	Mo3
	Mo6
	Yr1
	Yr2
	Yr5
	YTD
	Next
)

Enum values for PathRange.

func (*PathRange) MarshalJSON

func (p *PathRange) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaler interface for PathRange.

func (*PathRange) Set

func (p *PathRange) Set(s string) error

Set sets the issue type using a string.

func (PathRange) String

func (p PathRange) String() string

String implements the Stringer interface for PathRange.

func (*PathRange) UnmarshalJSON

func (p *PathRange) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaler interface for PathRange.

type PreviousDay

type PreviousDay struct {
	Symbol           string  `json:"symbol"`
	Date             Date    `json:"date"`
	Open             float64 `json:"open"`
	High             float64 `json:"high"`
	Low              float64 `json:"Low"`
	Close            float64 `json:"close"`
	Volume           int     `json:"volume"`
	UnadjustedVolume int     `json:"unadjustedVolume"`
	Change           float64 `json:"change"`
	ChangePercent    float64 `json:"changePercent"`
}

PreviousDay models the previous day adjusted price data.

type Price

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

Price models a cryptocurrency price

type PriceTarget

type PriceTarget struct {
	Symbol      string  `json:"symbol"`
	UpdatedDate Date    `json:"updatedDate"`
	Average     float64 `json:"priceTargetAverage"`
	High        float64 `json:"priceTargetHigh"`
	Low         float64 `json:"priceTargetLow"`
	NumAnalysts int     `json:"numberOfAnalysts"`
	Currency    string  `json:"currency"`
}

PriceTarget models the latest average, high, and low analyst price target for a symbol.

type Quote

type Quote struct {
	Symbol                string    `json:"symbol,omitempty"`
	CompanyName           string    `json:"companyName,omitempty"`
	PrimaryExchange       string    `json:"primaryExchange,omitempty"`
	CalculationPrice      string    `json:"calculationPrice,omitempty"`
	Open                  float64   `json:"open,omitempty"`
	OpenTime              EpochTime `json:"openTime,omitempty"`
	OpenSource            string    `json:"openSource,omitempty"`
	Close                 float64   `json:"close,omitempty"`
	CloseTime             EpochTime `json:"closeTime,omitempty"`
	CloseSource           string    `json:"closeSource,omitempty"`
	High                  float64   `json:"high,omitempty"`
	HighTime              EpochTime `json:"highTime,omitempty"`
	HighSource            string    `json:"highSource,omitempty"`
	Low                   float64   `json:"low,omitempty"`
	LowTime               EpochTime `json:"lowTime,omitempty"`
	LowSource             string    `json:"lowSource,omitempty"`
	LatestPrice           float64   `json:"latestPrice,omitempty"`
	LatestSource          string    `json:"latestSource,omitempty"`
	LatestTime            string    `json:"latestTime,omitempty"`
	LatestUpdate          EpochTime `json:"latestUpdate,omitempty"`
	LatestVolume          int       `json:"latestVolume,omitempty"`
	IEXRealtimePrice      float64   `json:"iexRealtimePrice,omitempty"`
	IEXRealtimeSize       int       `json:"iexRealtimeSize,omitempty"`
	IEXLastUpdated        EpochTime `json:"iexLastUpdated,omitempty"`
	DelayedPrice          float64   `json:"delayedPrice,omitempty"`
	DelayedPriceTime      EpochTime `json:"delayedPriceTime,omitempty"`
	ExtendedPrice         float64   `json:"extendedPrice,omitempty"`
	ExtendedChange        float64   `json:"extendedChange,omitempty"`
	ExtendedChangePercent float64   `json:"extendedChangePercent,omitempty"`
	ExtendedPriceTime     EpochTime `json:"extendedPriceTime,omitempty"`
	PreviousClose         float64   `json:"previousClose,omitempty"`
	Change                float64   `json:"change,omitempty"`
	ChangePercent         float64   `json:"changePercent,omitempty"`
	IEXMarketPercent      float64   `json:"iexMarketPercent,omitempty"`
	IEXVolume             float64   `json:"iexVolume,omitempty"`
	Volume                float64   `json:"volume,omitempty"`
	AvgTotalVolume        float64   `json:"avgTotalVolume,omitempty"`
	IEXBidPrice           float64   `json:"iexBidPrice,omitempty"`
	IEXBidSize            int       `json:"iexBidSize,omitempty"`
	IEXAskPrice           float64   `json:"iexAskPrice,omitempty"`
	IEXAskSize            int       `json:"iexAskSize,omitempty"`
	MarketCap             int       `json:"marketCap,omitempty"`
	Week52High            float64   `json:"week52High,omitempty"`
	Week52Low             float64   `json:"week52Low,omitempty"`
	YTDChange             float64   `json:"ytdChange,omitempty"`
	PERatio               float64   `json:"peRatio,omitempty"`
	IsUSMarketOpen        bool      `json:"isUSMarketOpen,omitempty"`
}

Quote models the data returned from the IEX Cloud /quote endpoint.

type Recommendation

type Recommendation struct {
	BuyRatings                  int       `json:"ratingBuy"`
	OverweightRatings           int       `json:"ratingOverweight"`
	HoldRatings                 int       `json:"ratingHold"`
	UnderweightRatings          int       `json:"ratingUnderweight"`
	SellRatings                 int       `json:"ratingSell"`
	NoRatings                   int       `json:"ratingNone"`
	ConsensusRating             float64   `json:"ratingScaleMark"`
	ConsensusStartDate          EpochTime `json:"consensusStartDate"`
	CorporateActionsAppliedDate EpochTime `json:"corporateActionsAppliedDate"`
	ConsensusEndDate            EpochTime `json:"consensusEndDate"`
	ConsensusRatingOneToFive    float64   `json:"ratingScaleMarkOneToFive"`
}

Recommendation models the buy, hold, sell recommendations for a stock.

type Records

type Records struct {
	Volume VolumeRecord `json:"volume"`
}

Records models the stats records.

type RelevantStocks

type RelevantStocks struct {
	Peers   bool     `json:"peers"`
	Symbols []string `json:"symbols"`
}

RelevantStocks models a list of relevant stocks that may or may not be peers.

type RequestRule

type RequestRule struct {
	Token  string `json:"token"`
	RuleID string `json:"ruleId"`
}

type Rule

type Rule struct {
	Token      string      `json:"token"`
	ID         string      `json:"id,omitempty"`
	RuleSet    string      `json:"ruleSet"`
	Type       string      `json:"type"`
	RuleName   string      `json:"ruleName"`
	Conditions []Condition `json:"conditions"`
	Outputs    []Output    `json:"outputs"`
}

type RuleInfo

type RuleInfo struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Event       string `json:"event"`
	DateCreated string `json:"dateCreated"`
	DateUpdated string `json:"dateUpdated"`
	IsActive    bool   `json:"isActive"`
	Ran         string `json:"ran"`
}

type SSRStatus

type SSRStatus struct {
	IsSSR     bool      `json:"isSSR"`
	Detail    string    `json:"detail"`
	Timestamp EpochTime `json:"timestamp"`
}

SSRStatus models the short sale price test status for a security

type SearchResult

type SearchResult struct {
	Symbol       string `json:"symbol"`
	SecurityName string `json:"securityName"`
	SecurityType string `json:"securityType"`
	Region       string `json:"region"`
	Exchange     string `json:"exchange"`
	Sector       string `json:"sector"`
	CIK          string `json:"cik"`
}

SearchResult models the data for a single search result.

type Sector

type Sector struct {
	Name string `json:"name"`
}

Sector models an industry sector, as defined by IEX. i.e. "Technology", "Consumer Cyclical"

type SectorPerformance

type SectorPerformance struct {
	Type        string    `json:"sector"`
	Name        string    `json:"name"`
	Performance float64   `json:"performance"`
	LastUpdated EpochTime `json:"lastUpdated"`
}

SectorPerformance models the performance based on each sector ETF.

type SecurityEvent

type SecurityEvent struct {
	SecurityEvent string    `json:"securityEvent"`
	Timestamp     EpochTime `json:"timestamp"`
}

SecurityEvent models events which apply to a specific security

type Split

type Split struct {
	Symbol       string  `json:"symbol"`
	ExDate       Date    `json:"exDate"`
	DeclaredDate Date    `json:"declaredDate"`
	Ratio        float64 `json:"ratio"`
	ToFactor     float64 `json:"toFactor"`
	FromFactor   float64 `json:"fromFactor"`
	Description  string  `json:"description"`
}

Split models the a stock split.

type Stat

type Stat struct {
	Value       float64   `json:"value"`
	LastUpdated EpochTime `json:"lastUpdated"`
}

Stat models a single stat.

type Status

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

Status models the IEX Cloud API system status

type Symbol

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

Symbol models the data for one stock, mutual fund, or OTC symbol that IEX Cloud supports for API calls.

type SymbolDetails

type SymbolDetails struct {
	Symbol   string `json:"symbol"`
	Region   string `json:"region"`
	Exchange string `json:"exchange"`
	IEXId    string `json:"iexid"`
}

SymbolDetails models the details of a symbol.

type SystemEvent

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

SystemEvent models a system event for a quote.

type TOPS

type TOPS struct {
	Symbol        string    `json:"symbol"`
	MarketPercent float64   `json:"marketPercent"`
	BidSize       int       `json:"bidSize"`
	BidPrice      float64   `json:"bidPrice"`
	AskSize       int       `json:"AskSize"`
	AskPrice      float64   `json:"AskPrice"`
	Volume        int       `json:"volume"`
	LastSalePrice float64   `json:"lastSalePrice"`
	LastSaleTime  EpochTime `json:"lastSaleTime"`
	LastUpdated   EpochTime `json:"lastUpdated"`
	Sector        string    `json:"sector"`
	SecurityType  string    `json:"securityType"`
}

TOPS contains IEX's aggregated best quoted bid and offer position in near real time for all securities on IEX's displayed limit order book.

type Tag

type Tag struct {
	Name string `json:"name"`
}

Tag models the tag field specified for each symbol i.e. "Financial Services", "Industrials"

type TodayEarning

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

TodayEarning models a single earning being reported today containing all keys from earnings, a quote object, and a headline.

type Trade

type Trade 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             EpochTime `json:"timestamp"`
}

Trade models a trade for a quote.

type TradeHolidayDate

type TradeHolidayDate struct {
	Date           Date `json:"date"`
	SettlementDate Date `json:"settlementDate"`
}

TradeHolidayDate models either a trade date or a holiday.

type TradedSymbol

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

TradedSymbol models a stock symbol the Investors Exchange supports for trading.

type TradingStatus

type TradingStatus struct {
	Status    string    `json:"status"`
	Reason    string    `json:"reason"`
	Timestamp EpochTime `json:"timestamp"`
}

TradingStatus models the current trading status of a security

type USExchange

type USExchange struct {
	Name     string `json:"name"`
	LongName string `json:"longName"`
	MarketID string `json:"mic"`
	TapeID   string `json:"tapeId"`
	OATSID   string `json:"oatsId"`
	RefID    string `json:"refId"`
	Type     string `json:"type"`
}

USExchange provides information about one U.S. exchange including the name, the Market identifier code, the ID used to identify the exchange on the consolidated tape, the FINRA OATS exchange participant ID, and the type of securities traded by the exchange.

type UpcomingEarning

type UpcomingEarning struct {
	Estimate
	Symbol   string `json:"symbol"`
	SymbolID string `json:"symbolId"`
}

UpcomingEarning is an upcoming earnings event.

type UpcomingEvents

type UpcomingEvents struct {
	IPOs      IPOCalendar       `json:"ipos"`
	Earnings  []UpcomingEarning `json:"earnings"`
	Dividends []Dividend        `json:"dividends"`
	Splits    []Split           `json:"splits"`
}

UpcomingEvents is all of the upcoming events.

type Usage

type Usage struct {
	MonthlyUsage      int            `json:"monthlyUsage"`
	MonthlyPayAsYouGo int            `json:"monthlyPayAsYouGo"`
	DailyUsage        map[string]int `json:"dailyUsage"`
	TokenUsage        map[string]int `json:"tokenUsage"`
	KeyUsage          map[string]int `json:"keyUsage"`
}

Usage provides current month usage for your account.

type VenueVolume

type VenueVolume struct {
	Volume               int     `json:"volume"`
	Venue                string  `json:"venue"`
	VenueName            string  `json:"venueName"`
	Date                 Date    `json:"date"`
	MarketPercent        float64 `json:"marketPercent"`
	AverageMarketPercent float64 `json:"avgMarketPercent"`
}

VenueVolume models the 15 minute delayed and 30 day average consolidated volume percentage of a stock by market.

type VolumeRecord

type VolumeRecord struct {
	Value            float64 `json:"recordValue"`
	Date             Date    `json:"recordDate"`
	PreviousDayValue float64 `json:"previousDayValue"`
	Avg30Value       float64 `json:"avg30Value"`
}

VolumeRecord models the record volume.

Jump to

Keyboard shortcuts

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