iex

package module
v0.0.0-...-2740cd5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 10 Imported by: 2

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.

Installation

$ go get github.com/goinvest/iexcloud

Examples

See the iexcloud CLI example README.

Implementation Status

Below is a list of the APIs that have and have not been implemented. If you want a particular API to be developed next, please open an issue.

Account
  • Metadata
  • Usage
  • Pay as you go
Stocks
  • Advanced Stats
  • Balance Sheet
  • Batch Requests
  • Book
  • Cash Flow
  • Collections
  • Company
  • Delayed Quote
  • Dividends
  • Earnings
  • Earnings Today
  • Effective Spread (@FIXME: Has been removed from API.)
  • Estimates
  • Financials
  • Financials As Reported
  • Fund Ownership
  • Nondynamic Historical Prices
  • Dynamic Historical Prices
  • Income Statement
  • Insider Roster
  • Insider Summary
  • Insider Transactions
  • Institutional Ownership
  • IPO Calendar
  • Key Stats
  • Largest Trades
  • List
  • Logo
  • Market Volume (U.S.)
  • News
  • OHLC
  • Open / Close Price
  • Peers
  • Previous Day Prices
  • Price
  • Price Target
  • Quote
  • Recommendation Trends
  • Relevant Stocks
  • Sector Performance
  • Splits
  • Volume by Venue
Alternative Data
  • Crypto
  • Social Sentiment
  • CEO Compensation
Reference Data
  • Symbols
  • IEX Symbols
  • U.S. Exchanges
  • U.S. Holidays and Trading Days
  • Stock Tags
  • Stock Collections
  • Mutual Fund Symbols
  • OTC Symbols
  • FX Symbols
  • Options Symbols
  • Commodities Symbols
  • Bonds Symbols
  • Crypto Symbols
Forex / Currencies
  • Exchange Rates
Investors Exchange Data
  • TOPS
  • Last
  • DEEP
  • DEEP Auction
  • DEEP Book
  • DEEP Operational Halt Status
  • DEEP Official Price
  • DEEP Security Event
  • DEEP Short Sale Price Tst Status
  • DEEP System Event
  • DEEP Trades
  • DEEP Trade Break
  • DEEP Trading Status
  • Listed Regulation SHO Threshold Securities List
  • Listed Short Interest List
  • Stats Historical Daily
  • Stats Historical Summary
  • Stats Intraday
  • Stats Recent
  • Stats Records
API System Metadata
  • Status

Contributing

Contributions are welcome! To contribute please:

  1. Fork the repository
  2. Create a feature branch
  3. Code
  4. Submit a pull request
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

Overview

Copyright (c) 2019 The iexcloud developers. All rights reserved. Project site: https://github.com/goinvest/iexcloud Use of this source code is governed by a MIT-style license that can be found in the LICENSE file for the project.

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,
	"":    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

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) func(*Client)

WithHTTPClient sets the http.Client for a new IEX Client

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"`
}

AccountMetadata provides details about an IEX Cloud account.

type AdvancedStats

type AdvancedStats struct {
	KeyStats
	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"`
	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"`
	Beta                     float64 `json:"beta"`
}

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"`
	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"`
	PropertyPlanetEquipment 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 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"`
	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, baseURL string, options ...func(*Client)) *Client

NewClient creates a client with the given authorization toke.

func (Client) AccountMetadata

func (c Client) AccountMetadata() (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(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) AnnualBalanceSheets

func (c Client) AnnualBalanceSheets(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(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(symbol string, num int) (Financials, error)

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

func (Client) AnnualIncomeStatements

func (c Client) AnnualIncomeStatements(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) Book

func (c Client) Book(symbol string) (Book, error)

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

func (Client) CEOCompensation

func (c Client) CEOCompensation(symbol string) (CEOCompensation, error)

CEOCompensation provides CEO compensation for the given stock symbol.

func (Client) CollectionBySector

func (c Client) CollectionBySector(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(tag Tag) ([]Quote, error)

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

func (Client) Company

func (c Client) Company(symbol string) (Company, error)

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

func (Client) Crypto

func (c Client) Crypto(symbol string) (CryptoQuote, error)

Crypto provides a quote for a given cryptocurrency symbol.

func (Client) CryptoSymbols

func (c Client) CryptoSymbols() ([]CryptoSymbol, error)

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

func (Client) DEEP

func (c Client) DEEP(symbol string) (DEEP, error)

DEEP provides all DEEP data for one stock symbol.

func (Client) DEEPBook

func (c Client) DEEPBook(symbols []string) (map[string]DEEPBook, error)

DEEPBook provides DEEP book data for multiple symbols

func (Client) DEEPTrades

func (c Client) DEEPTrades(symbols []string) (map[string][]Trade, error)

DEEPTrades provides DEEP trades data for multiple symbols.

func (Client) DelayedQuote

func (c Client) DelayedQuote(symbol string) (DelayedQuote, error)

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

func (Client) Dividends

func (c Client) Dividends(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(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() (EarningsToday, error)

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

func (Client) EffectiveSpreads

func (c Client) EffectiveSpreads(symbol string) ([]EffectiveSpread, error)

EffectiveSpreads returns the effective spreads from the IEX Cloud endpoint for the given stock symbol.

func (Client) Estimates

func (c Client) Estimates(symbol string, num int) (Estimates, error)

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

func (Client) ExchangeRate

func (c Client) ExchangeRate(from, to string) (ExchangeRate, error)

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

func (Client) FXSymbols

func (c Client) FXSymbols() (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) FundOwnership

func (c Client) FundOwnership(symbol string) ([]FundOwner, error)

FundOwnership returns the ten top holders of the given stock.

func (Client) Gainers

func (c Client) Gainers() ([]Quote, error)

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

func (*Client) GetFloat64

func (c *Client) GetFloat64(endpoint string) (float64, error)

GetFloat64 gets the number from the given endpoint.

func (*Client) GetJSON

func (c *Client) GetJSON(endpoint string, v interface{}) error

GetJSON gets the JSON data from the given endpoint.

func (*Client) GetJSONWithoutToken

func (c *Client) GetJSONWithoutToken(endpoint string, v interface{}) error

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

func (Client) HistoricalPrices

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

HistoricalPrices retrieves historically adjusted market-wide data

func (Client) HistoricalPricesByDay

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

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

func (Client) IEXPercent

func (c Client) IEXPercent() ([]Quote, error)

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

func (Client) IEXSymbols

func (c Client) IEXSymbols() ([]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() ([]Quote, error)

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

func (Client) InFocus

func (c Client) InFocus() ([]Quote, error)

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

func (Client) InsiderRoster

func (c Client) InsiderRoster(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(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(symbol string) ([]InsiderTransaction, error)

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

func (Client) InstitutionalOwnership

func (c Client) InstitutionalOwnership(symbol string) ([]InstitutionalOwner, error)

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

func (Client) IntradayHistoricalPrices

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

IntradayHistoricalPrices retrieves intraday historical market-wide data

func (Client) IntradayHistoricalPricesByDay

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

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

func (Client) IntradayStats

func (c Client) IntradayStats(symbol string) (IntradayStats, error)

IntradayStats retrieves the intraday stats on IEX.

func (Client) KeyStats

func (c Client) KeyStats(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(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(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(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() ([]Quote, error)

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

func (Client) MarketNews

func (c Client) MarketNews(num int) ([]News, error)

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

func (Client) Markets

func (c Client) Markets() ([]Market, error)

Markets returns real time traded volume on U.S. markets.

func (Client) MostActive

func (c Client) MostActive() ([]Quote, error)

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

func (Client) MutualFundSymbols

func (c Client) MutualFundSymbols() ([]Symbol, error)

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

func (Client) News

func (c Client) News(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() (TradeHolidayDate, error)

NextHoliday returns the date of the next holiday.

func (Client) NextHolidays

func (c Client) NextHolidays(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() (TradeHolidayDate, error)

NextTradingDay returns the date of the next trading day.

func (Client) NextTradingDays

func (c Client) NextTradingDays(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(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() ([]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(symbol string) ([]Last, error)

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

func (Client) OneTOPS

func (c Client) OneTOPS(symbol string) ([]TOPS, error)

OneTOPS returns TOPS for one stock symbol.

func (Client) Peers

func (c Client) Peers(symbol string) ([]string, error)

Peers returns a slice of peer stock symbols from the IEX Cloud endpoint for the given stock symbol.

func (Client) PreviousDay

func (c Client) PreviousDay(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() (TradeHolidayDate, error)

PreviousHoliday returns the date of the previous holiday.

func (Client) PreviousTradingDay

func (c Client) PreviousTradingDay() (TradeHolidayDate, error)

PreviousTradingDay returns the date of the previous trading day.

func (Client) Price

func (c Client) Price(symbol string) (float64, error)

Price returns the current stock price from the IEX Cloud endpoint for the given stock symbol.

func (Client) PriceTarget

func (c Client) PriceTarget(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(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(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(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) QuarterlyIncomeStatements

func (c Client) QuarterlyIncomeStatements(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(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(symbol string) ([]Recommendation, error)

RecommendationTrends provides a list of recommendations with the start and end date for each rating.

func (Client) RelevantStocks

func (c Client) RelevantStocks(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) SectorPerformance

func (c Client) SectorPerformance() ([]Sector, 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() ([]Sector, error)

Sectors returns an array of all sectors

func (Client) Status

func (c Client) Status() (Status, error)

Status returns the IEX Cloud system status.

func (Client) Symbols

func (c Client) Symbols() ([]Symbol, error)

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

func (Client) TOPS

func (c Client) TOPS(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() ([]Tag, error)

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

func (Client) USExchanges

func (c Client) USExchanges() ([]USExchange, error)

USExchanges returns an array of U.S. Exchanges.

func (Client) Usage

func (c Client) Usage() (Usage, error)

Usage retrieves the current month usage for your account.

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   IssueType `json:"issueType"`
	Sector      string    `json:"sector"`
	Employees   int       `json:"employees"`
	Tags        []string  `json:"tags"`
}

Company models the company data from the /company endpoint.

type CryptoQuote

type CryptoQuote struct {
	Symbol                string    `json:"symbol"`
	CompanyName           string    `json:"companyName"`
	PrimaryExchange       string    `json:"primaryExchange"`
	Sector                string    `json:"sector"`
	CalculationPrice      string    `json:"calculationPrice"`
	Open                  float64   `json:"open"`
	OpenTime              EpochTime `json:"openTime"`
	Close                 float64   `json:"close"`
	CloseTime             EpochTime `json:"closeTime"`
	High                  float64   `json:"high"`
	Low                   float64   `json:"low"`
	LatestPrice           float64   `json:"latestPrice"`
	LatestSource          string    `json:"latestSource"`
	LatestTime            string    `json:"latestTime"`
	LatestUpdate          EpochTime `json:"latestUpdate"`
	LatestVolume          float64   `json:"latestVolume"`
	IEXRealtimePrice      float64   `json:"iexRealtimePrice"`
	IEXRealtimeSize       int       `json:"iexRealtimeSize"`
	IEXLastUpdated        EpochTime `json:"iexLastUpdated"`
	DelayedPrice          float64   `json:"delayedPrice"`
	DelayedPriceTime      EpochTime `json:"delayedPriceTime"`
	ExtendedPrice         float64   `json:"extendedPrice"`
	ExtendedChange        float64   `json:"extendedChange"`
	ExtendedChangePercent float64   `json:"extendedChangePercent"`
	ExtendedPriceTime     EpochTime `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             int       `json:"marketCap"`
	PERatio               float64   `json:"peRatio"`
	Week52High            float64   `json:"week52High"`
	Week52Low             float64   `json:"week52Low"`
	YTDChange             float64   `json:"ytdChange"`
	BidPrice              float64   `json:"bidPrice"`
	BidSize               float64   `json:"bidSize"`
	AskPrice              float64   `json:"askPrice"`
	AskSize               float64   `json:"askSize"`
}

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 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 Date

type Date time.Time

Date models a report date

func (*Date) MarshalJSON

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

MarshalJSON implements the Marshaler interface for Date.

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 {
	ExDate       Date    `json:"exDate"`
	PaymentDate  Date    `json:"paymentDate"`
	RecordDate   Date    `json:"recordDate"`
	DeclaredDate Date    `json:"declaredDate"`
	Amount       float64 `json:"amount"`
	Flag         string  `json:"flag"`
}

Dividend models one dividend.

type Earning

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

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"`
}

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 EffectiveSpread

type EffectiveSpread struct {
	Volume           int     `json:"volume"`
	Venue            string  `json:"venue"`
	VenueName        string  `json:"venueName"`
	EffectiveSpread  float64 `json:"effectiveSpread"`
	EffectiveQuoted  float64 `json:"effectiveQuoted"`
	PriceImprovement float64 `json:"priceImprovement"`
}

EffectiveSpread models the effective spread, eligible volume, and price improvement of a stock by market.

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 Estimate

type Estimate struct {
	ConsensusEPS      float64 `json:"consensusEPS"`
	NumberOfEstimates int     `json:"numberOfEstimates"`
	FiscalPeriod      string  `json:"fiscalPeriod"`
	FiscalEndDate     Date    `json:"fiscalEndDate"`
	ReportDate        Date    `json:"reportDate"`
}

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"`
	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"`
	OperatingGainsLosses   string  `json:"operatingGainsLosses"`
}

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

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 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 {
	Date           string  `json:"date"`
	Open           float64 `json:"open"`
	Close          float64 `json:"close"`
	High           float64 `json:"high"`
	Low            float64 `json:"low"`
	Volume         int     `json:"volume"`
	UOpen          float64 `json:"uOpen"`
	UClose         float64 `json:"uClose"`
	UHigh          float64 `json:"uHigh"`
	ULow           float64 `json:"uLow"`
	UVolume        int     `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

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"`
}

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 (
	// OneMonthHistorical One month (default) historically adjusted market-wide data
	OneMonthHistorical HistoricalTimeFrame = "1m"
	// 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 IncomeStatement

type IncomeStatement struct {
	ReportDate             Date    `json:"reportDate"`
	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   int    `json:"position"`
	ReportDate Date   `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"`
}

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 {
	EntityName          string    `json:"entityProperName"`
	AdjustedHolding     float64   `json:"adjHolding"`
	AdjustedMarketValue float64   `json:"adjMv"`
	ReportDate          EpochTime `json:"reportDate"`
	ReportedHolding     float64   `json:"reportedHolding"`
}

InstitutionalOwner models an institutional owner of a stock.

type IntradayHistoricalDataPoint

type IntradayHistoricalDataPoint struct {
	Date                 string  `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 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"`
	Avg30Volume         float64 `json:"avg30Volume"`
	Avg10Volume         float64 `json:"avg10Volume"`
	Float               float64 `json:"float"`
	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"`
	Day200MovingAvg     float64 `json:"day200MovingAvg"`
	Day50MovingAvg      float64 `json:"day50MovingAvg"`
	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 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 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"`
}

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

type Quote

type Quote struct {
	Symbol                string    `json:"symbol"`
	CompanyName           string    `json:"companyName"`
	CalculationPrice      string    `json:"calculationPrice"`
	Open                  float64   `json:"open"`
	OpenTime              EpochTime `json:"openTime"`
	Close                 float64   `json:"close"`
	CloseTime             EpochTime `json:"closeTime"`
	High                  float64   `json:"high"`
	Low                   float64   `json:"low"`
	LatestPrice           float64   `json:"latestPrice"`
	LatestSource          string    `json:"latestSource"`
	LatestTime            string    `json:"latestTime"`
	LatestUpdate          EpochTime `json:"latestUpdate"`
	LatestVolume          int       `json:"latestVolume"`
	IEXRealtimePrice      float64   `json:"iexRealtimePrice"`
	IEXRealtimeSize       int       `json:"iexRealtimeSize"`
	IEXLastUpdated        EpochTime `json:"iexLastUpdated"`
	DelayedPrice          float64   `json:"delayedPrice"`
	DelayedPriceTime      EpochTime `json:"delayedPriceTime"`
	ExtendedPrice         float64   `json:"extendedPrice"`
	ExtendedChange        float64   `json:"extendedChange"`
	ExtendedChangePercent float64   `json:"extendedChangePercent"`
	ExtendedPriceTime     EpochTime `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             int       `json:"marketCap"`
	Week52High            float64   `json:"week52High"`
	Week52Low             float64   `json:"week52Low"`
	YTDChange             float64   `json:"ytdChange"`
	PERatio               float64   `json:"peRatio"`
}

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

type Recommendation

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

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 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 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 {
	ExDate       Date    `json:"exDate"`
	DeclaredDate Date    `json:"declaredDate"`
	Ratio        float64 `json:"ratio"`
	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 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 {
	Earning
	EstimatedChangePercent float64 `json:"estimatedChangePercent"`
	SymbolID               int     `json:"symbolId"`
	Symbol                 string  `json:"symbol"`
	Quote                  Quote   `json:"quote"`
	Headline               string  `json:"headline"`
}

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"`
	MarketID int    `json:"mic"`
	TapeID   string `json:"tapeId"`
	OATSID   string `json:"oatsId"`
	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 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 Volume

type Volume 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"`
}

Volume 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.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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