UNPKG

node-iex-cloud

Version:
126 lines (125 loc) 7.78 kB
import * as iex from "./types"; export default class IEXCloudClient { private fetchFunc; private publishable; private sandbox; private version; private stockSymbol; private stockSymbols; private datatype; constructor(fetchFunc: typeof fetch, { publishable, sandbox, version }: iex.Configuration); /** * Data points are available per symbol and return individual plain text values. Retrieving individual data points is useful for Excel and Google Sheet users, and applications where a single, lightweight value is needed. */ dataPoints: (key?: string) => Promise<any>; /** TOPS provides IEX’s aggregated best quoted bid and offer position in near real time for all securities on IEX’s displayed limit order book. TOPS is ideal for developers needing both quote and trade data. */ tops: (...params: any) => Promise<any>; /** Returns daily stats for a given time frame */ historicalStats: (params: iex.StatType, date?: string | undefined) => Promise<iex.HistoricalStats | iex.IntraDay | iex.Recent[]>; market: (params?: string) => Promise<any>; collection: ({ param, collectionName }: any) => Promise<any>; /** Time series is the most common type of data available, and consists of a collection of data points over a period of time. Time series data is indexed by a single date field, and can be retrieved by any portion of time. To use this endpoint, you’ll first make a free call to get an inventory of available time series data. */ timeSeries: (id: string | undefined, subkey: string) => Promise<any>; /** 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. Non-displayed orders and non-displayed portions of reserve orders are not represented in DEEP. */ deep: (params?: string) => Promise<any>; /** Takes in a stock symbol, a unique series of letters assigned to a security */ symbol: (symbol: string) => IEXCloudClient; /** Takes in multiple stock symbols, and batches them to a single request */ symbols: (...symbols: string[]) => IEXCloudClient; private setToken; private params; private batchParams; private request; /** batch returns multipe data-types for a give stock symbol */ batch: (...params: any) => Promise<any>; /** returns balance sheet data. Available quarterly or annually with the default being the last available quarter * `Data Weight: 3000` */ balanceSheet: (period?: "annual" | "quarterly" | undefined, last?: 1 | 2 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 11 | 12 | undefined) => Promise<iex.BalanceSheet>; /** * returns book value for a given stock * `Data Weight: 1 per quote returned` */ book: () => Promise<iex.Book>; /** * Returns adjusted and unadjusted historical data for up to 15 years. * `Data Weight: 1,000 per symbol per period` */ chart: (range: string, params: iex.ChartParams) => Promise<iex.DynamicChart | iex.Chart[]>; /** * returns cash flow data. Available quarterly or annually, with the default being the last available quarter. * * `Data Weight: 1,000 per symbol per period` */ cashFlow: (period: "annual" | "quarterly" | undefined, { last }: { last?: number | undefined; }) => Promise<iex.CashFlow>; /** returns Ceo Compensation */ ceoCompensation: () => Promise<any>; /** returns data on a given company * `Data Weight: 1 per symbol` */ company: () => Promise<iex.Company>; /** * `Data Weight: 1 per symbol per quote` */ delayedQuote: () => Promise<iex.DelayedQuote>; /** * `Data Weight: 10 per symbol per period returned` */ dividends: (range: string) => Promise<iex.Dividends[]>; /** Returns earnings data for a given company including the actual EPS, consensus, and fiscal period. Earnings are available quarterly (last 4 quarters). * `Data Weight: 1000 per symbol per period` */ earnings: (last?: 1 | 2 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 11 | 12 | undefined, field?: string | undefined) => Promise<iex.Earnings>; /** Provides the latest consensus estimate for the next fiscal period */ estimates: () => Promise<iex.Estimates>; /** Pulls income statement, balance sheet, and cash flow data from the most recent reported quarter. */ financials: (period?: iex.Period) => Promise<iex.Financials>; /** Returns latest news for a give stock symbol */ news: (last?: number) => Promise<iex.News[]>; /** * Returns the top 10 fund holders, meaning any firm not defined as buy-side or sell-side such as mutual funds, pension funds, endowments, investment firms, and other large entities that manage funds on behalf of others. */ fundOwnership: () => Promise<iex.FundOwnership[]>; /** Pulls income statement data. Available quarterly or annually with the default being the last available quarter. */ income: (period: iex.Period, last: iex.Last) => Promise<iex.Income>; /** Returns the top 10 insiders, with the most recent information. */ insiderRoster: () => Promise<iex.InsiderRoster[]>; /** Returns aggregated insiders summary data for the last 6 months. */ insiderSummary: () => Promise<iex.InsiderSummary[]>; /** Returns insider transactions. */ insiderTransactions: () => Promise<iex.InsiderTransactions[]>; /** Returns the top 10 institutional holders, defined as buy-side or sell-side firms. */ institutionalOwnership: () => Promise<iex.InstitutionalOwnership[]>; /** This endpoint will return aggregated intraday prices in one minute buckets */ intradayPrices: () => Promise<iex.IntradayPrices[]>; /** This is a helper function, but the google APIs url is standardized. */ logo: () => Promise<iex.Logo>; /** This returns 15 minute delayed, last sale eligible trades. */ largestTrades: () => Promise<iex.LargestTrades>; /** Returns end of day options data */ options: (expiration?: string, optionSide?: "put" | "call" | undefined) => Promise<any>; /** Returns peer group */ peers: () => Promise<string[]>; /** Returns previous day adjusted price data for one or more stocks. */ previous: () => Promise<iex.Chart>; /** Returns price of a stock */ price: () => Promise<number>; /** Provides the latest avg, high, and low analyst price target for a symbol. */ priceTarget: () => Promise<iex.PriceTarget>; /** Returns the official open and close for a give symbol. The official open is available as soon as 9:45am ET and the official close as soon as 4:15pm ET. Some stocks can report late open or close prices. */ ohlc: () => Promise<iex.OHLC>; /** This endpoint provides social sentiment data from StockTwits. Data can be viewed as a daily value, or by minute for a given date. */ sentiment: (type?: string, date?: null) => Promise<iex.DailySentiment[] | iex.MinuteSentiment[]>; quote: (field?: string) => Promise<iex.Quote>; /** Pulls data from the last four months. */ recommendationTrends: () => Promise<iex.RecommendationTrends>; stats: (stat?: string) => Promise<iex.Stats>; splits: (range?: string) => Promise<iex.Splits[]>; shortInterest: (date?: string) => Promise<iex.ShortInterest[]>; /** This returns 15 minute delayed and 30 day average consolidated volume percentage of a stock, by market. This call will always return 13 values, and will be sorted in ascending order by current day trading volume percentage. */ volumeByVenue: () => Promise<iex.VolumeByVenue[]>; }