investors-exchange.api
v0.1.17
Published
Unofficial Browser / NodeJS API for https://iextrading.com
Downloads
74
Maintainers
Readme
Investors-Exchange.API
An unaffiliated JavaScript / TypeScript API for the IEX Developer Platform - https://iextrading.com
Installation
# NPM
npm install investors-exchange.api --save
# YARN
yarn add investors-exchange.api
Getting Started
import * as IEX from 'investors-exchange.api'
Miscellaneous Queries
Fetch
// https://iextrading.com/developer/docs/#financials
const endpoint = '/stock/snap/financials'
const params = {period: 'annual'}
const data = IEX.fetch(endpoint, params)
Stock Queries
const AAPL = IEX.stock('aapl') // Apple Inc.
const GOOG = IEX.stock('GOOG') // Alphabet Inc.
const SNAP = IEX.stock('Snap') // Snap Inc.
const book = await AAPL.book()
const chart = {}
chart.default = await AAPL.chart() // 1 Month (default).
chart.dynamic = await GOOG.chart('dynamic') // Dynamic
chart.fiveYear = await GOOG.chart('5y') // 5 year.
chart.specific = await SNAP.chart('20180730') // Specific Date.
const company = await AAPL.company()
const dividends = {}
dividends.default = await SNAP.dividends() // 1 Month (default).
dividends.ytd = await SNAP.dividends('ytd') // Year-To-Date.
dividends.twoYear = await GOOG.dividends('2y') // 2 Year.
const earnings = await GOOG.earnings()
const today_earnings = await SNAP.today_earnings()
const effective_spread = await SNAP.effective_spread()
const financials = {}
financials.quarter = await AAPL.financials()
financials.annual = await AAPL.financials({period: 'annual'})
const historical = {}
historical.default = await AAPL.historical() // 1 Month (default).
historical.dynamic = await GOOG.historical('dynamic') // Dynamic
historical.fiveYear = await GOOG.historical('5y') // 5 year.
historical.specific = await SNAP.historical('20180730') // Specific Date.
const stats = await AAPL.stats()
const largest_trades = await AAPL.largest_trades()
const logo = await SNAP.logo()
const news = {}
news.last_1 = await SNAP.news() // Last Article.
news.last_10 = await SNAP.news(10) // Last 10 Articles.
const ohlc = await AAPL.ohlc()
const peers = await SNAP.peers()
const previous = await AAPL.previous()
const price = await GOOG.price()
const quote = {}
quote.default = SNAP.quote()
quote.percent = SNAP.quote({displayPercent: true}) // Display Percent.
const relevant = await AAPL.relevant()
const splits = {}
splits.default = await AAPL.splits() // 1 Month (default).
splits.fiveYear = await AAPL.splits('5y') // 5 Year.
const time_series = {}
time_series.default = await GOOG.time_series() // 1 Month (default).
time_series.ytd = await GOOG.time_series('ytd') // Year-To-Date.
const volume_by_venue = await AAPL.volume_by_venue()
Market Queries
const market = IEX.market || IEX.stock()
const collections = {}
collections.computer_hardware = await market.collection('tag', 'Computer%20Hardware')
collections.health_care = await market.collection('sector', 'Health%20Care')
const crypto = await market.crypto()
const IPOs = {}
IPOs.upcoming = await market.ipos('upcoming')
IPOs.today = await market.ipos('today')
const list = {}
list.gainers = await market.list('gainers') // Gainers.
list.iex_volume = await market.list('iexvolume') // IEX Volume.
list.iex_percent = await market.list('iexpercent') // IEX Percent.
list.in_focus = await market.list('infocus') // In Focus.
list.losers = await market.list('losers') // Losers.
list.most_active = await market.list('mostactive') // Most Active.
const sector_performance = await market.sector_performance()
const short_interest = {}
short_interest.recent = await market.short_interest()
short_interest.specific = await market.short_interest('20171210')
const threshold_securities = {}
threshold_securities.recent = await market.threshold_securities()
threshold_securities.specific = await market.threshold_securities('20171210')
Reference Queries
const reference = IEX.reference
const corporate_actions = {}
corporate_actions.recent = await reference.corporate_actions() // Recent (default).
corporate_actions.specific = await reference.corporate_actions('20171210') // Specific Date.
const dividends = {}
dividends.recent = await reference.dividends()
dividends.specific = await reference.dividends('20171210')
const next_day_e x_date = {}
next_day_ex_date.recent = await reference.next_day_ex_date() // Recent (default).
next_day_ex_date.recent = await reference.next_day_ex_date('20171210') // Specific Date.
const symbols = {}
symbols.json = await ref.symbols() // JSON Format.
symbols.csv = await ref.symbols({format: 'csv'}) // CSV Format.
const symbol_directory = {}
symbol_directory.recent = await reference.symbol_directory() // Recent (default).
symbol_directory.specific = await reference.symbol_directory('20171210') // Specific Date.