🧙📊 Finwiz
Get a company's financials and stock information using a simple and intuitive API.
Installation
Via npm:
npm install finwiz
Usage
The API is very simple and easy to use. The basic finwiz
function takes a string representing a company's stock ticker. It returns a company
object containing a variety of useful methods.
; // get information on Apple, Inc.
Financials
Getting a company's stock performance metrics and other related financial metrics is very easy:
;
Example output of the above code is shown below:
index: 'djia s&p500' // indices where the stock trades in pe: 175 // price to earnings (ttm) 'eps_(ttm)': 1167 // earnings per share (ttm) insider_own: 007 // insider ownership (percentage) shs_outstand: 4640000000 // shares outstanding perf_week: 225 // performance during the week (percentage) market_cap: 948320000000 // market capitalization (USD) forward_pe: 1619 // forward price to earnings (next fiscal year) eps_next_y_estimate: 1226 // earnings per share estimate for next year eps_next_y: 1036 // earnings per share estimate growth for next year (percentage) insider_trans: -402 // insider transactions (6-month change in insider ownership) shs_float: 4600000000 // shares float perf_month: 1188 // performance for the month (percentage) income: 56070000000 // income (ttm) peg: 146 // price to earnings to growth eps_next_q: 21 // earnings per share next quarter estimate inst_own: 609 // institutional ownership short_float: 102 // short interest share (percentage) perf_quarter: 436 // performance for the quarter (percentage) sales: 258490000000 // revenue (ttm) ps: 367 // price-to-sales (ttm) eps_this_y: 326 // earnings per share growth this year (percentage) inst_trans: -289 // institutional transactions (3-month change in institutional ownership) short_ratio: 17 // short interest ratio perf_half_y: 4363 // performance during half year (percentage) booksh: 2265 // book value per share pb: 902 // price to book roa: 16 // return on assets (ttm) target_price: 21203 // average target price perf_year: 1104 // performance for past year (percentage) cashsh: 1725 // cash per share pc: 1184 // price to cash per share eps_next_5y: 12 // long term annual growth estimate (percentage) (5Y) roe: 513 // return on equity (percentage) (ttm) '52w_high_price': 23347 // high price 52 week '52w_low_price': 142 // low price 52 week perf_ytd: 2947 // performance year-to-date (percentage) dividend: 308 // dividend (annual) pfcf: 2078 // price to free cash flow (ttm) eps_past_5y: 165 // annual earnings per share growth past 5Y (percentage) roi: 266 // return on investment (percentage) (ttm) '52w_high': -1252 // percentage difference from 52 week high beta: 124 // beta dividend_percent: 151 // dividend yield (percentage) quick_ratio: 13 // quick ratio sales_past_5y: 92 // annual sales growth past 5 years (percentage) gross_margin: 381 // gross margin (percentage) (ttm) '52w_low': 4382 // percentage difference from 52 week low atr: 354 // average true range employees: 132000 // number of employees current_ratio: 13 // current ratio sales_qq: -51 // quarterly revenue growth (year on year) percentage 'oper._margin': 253 // operating margin (percentage) (ttm) 'rsi_(14)': 6302 // relative strength index volatility_week: 119 // week volatility (percentage) volatility_month: 157 // month volatility (percentage) optionable: 'yes' // whether it is optionable debteq: 106 // debt to equity ratio eps_qq: -98 // quarterly earnings growth year-on-year (percentage) profit_margin: 221 // profit margin (percentage) (ttm) rel_volume: 062 // relative volume prev_close: 20441 // price of previous close shortable: 'yes' // whether it is shortable lt_debteq: 085 // long term debt to equity ratio earnings: 'jul 30 amc' // earnings date (AMC = after market close, BMO = before market open) payout: 244 // dividend payout ratio (percentage) (ttm) avg_volume: 27660000 // average volume price: 20423 // current share price recom: 22 // average recommendation (1 - strong buy, 5 - strong sell) sma20: 387 // distance from 20-day simple moving average sma50: 529 // distance from 50-day simple moving average sma200: 846 // distance from 200-day simple moving average volume: 17203128 // current volume change: -009 // current percentage change since market open
### Ratings It is just as easy to get a company's latest analyst ratings:
;
Example output is shown below:
date: '2019-06-06' action: 'initiated' org: 'Evercore ISI' rating: before: '' after: 'outperform' target: before: '' after: 205 date: '2019-06-04' action: 'reiterated' org: 'Cowen' rating: before: '' after: 'outperform' target: before: 245 after: 220 date: '2019-05-30' action: 'reiterated' org: 'Morgan Stanley' rating: before: '' after: 'overweight' target: before: 240 after: 231 ...
The "before" fields will only exist if data is available for them (e.g. in the event of a downgrade). The "after" fields will always contain a value.
News
It is also possible to get a company's latest news:
;
Example output is shown below:
date: '2019-07-02' news: time: '17:32' headline: 'UPDATE 1-Wall Street looks to earnings after strongest June in decades Reuters' link: 'https://finance.yahoo.com/news/1-wall-street-looks-earnings-213215453.html' time: '16:42' headline: 'Dow Jones Today: More Trade Tiffs, But Its Not China This Time InvestorPlace' link: 'https://finance.yahoo.com/news/dow-jones-today-more-trade-204224788.html' ... ...
Insider
Getting the latest insider transactions is just as easy:
;
Example output is shown below:
name: 'LEVINSON ARTHUR D' relationship: 'Director' date: '2019-08-02' transaction: 'sale' cost: 20658 shares: 20000 value: 4131600 shares_total: 1133283 sec_filing_date: '2019-08-06' sec_filing_link: 'http://www.sec.gov/Archives/edgar/data/320193/000032019318000103/xslF345X03/wf-form4_153359461891019.xml' name: 'WILLIAMS JEFFREY E' relationship: 'COO' date: '2019-07-09' transaction: 'sale' cost: 19018 shares: 15652 value: 2976664 shares_total: 123737 sec_filing_date: '2019-07-11' sec_filing_link: 'http://www.sec.gov/Archives/edgar/data/320193/000032019318000095/xslF345X03/wf-form4_153134826427557.xml' ...
Where does the information come from?
Currently, all the information is sourced from finviz (yes, hence the name). Refer to their site for more information regarding each metric. This means data is not real-time -- it is delayed by around 15 minutes.
Contributing
Contributions are very welcome! To develop locally, all you'll have to do is run npm run build
and get to work in the /src
folder.