npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eodhistoricaldata-api

v1.0.8

Published

eodhistoricaldata.com API

Downloads

37

Readme

eodhistoricaldata.com API (React, Vue, Angular, Node.js)

eodhistoricaldata.com API wrapper.

Supports client-side (React, Vue, Angular, etc.) and server-side (Node.js).

Getting Started

  • npm install eodhistoricaldata-api
  • No API token required

Examples

Node.js

const api = require('eodhistoricaldata-api');

// get historical end-of-day stock price of Apple
const options = {
  symbol: 'AAPL', // ticker
  from: '2018-02-01', // YYYY-MM-DD [optional]
  to: '2018-10-10', // YYYY-MM-DD [optional]
  period: 'd', // d = day, w = week, m = month [optional]
  order: 'd' // d = descending, a = ascending [optional]
  // filter: 'last_close' // last_close, last_volume [optional]
};
api.getHistoricalEodData(options).then(prices => console.log(prices));

// get fundamentals of Tesla (symbol: TSLA)
api.getFundamentals('TSLA').then(result => console.log(result));

// list supported ETFs
api.listSupportedEtfs().then(etfs => console.log(etfs));

React

Live Demo: https://codesandbox.io/s/znoo29zp74

import api from 'eodhistoricaldata-api';

class Eodhistoricaldata extends React.Component {
  componentDidMount() {
    api.getFundamentals('VGT').then(data => this.setState({ data }));
  }

  render() {
    // ...
    return <pre>{JSON.stringify(this.state.data, null, 1)}</pre>;
  }
}

Documentation

getHistoricalEodData(options)

Returns historical stock price data.

Accepts an object as input:

  • symbol (string, required) - any symbol of a company, ETF, or Mutual Fund
  • from (string, optional) - YYYY-MM-DD format, e.g. 2018-02-01
  • to (string, optional) - YYYY-MM-DD format, e.g. 2018-10-01
  • period (string, optional) - use d for daily, w for weekly and m for monthly prices. By default daily prices will be shown.
  • order (string, optional): use a for ascending dates (from old to new) and d for descending dates (from new to old). By default dates are shown in ascending order.
  • filter (string, optional) - use last_close to get only the last value, or last_volume

getFundamentals(symbol)

  • symbol - any symbol of a company, ETF, or Mutual Fund
api.getFundamentals('AAPL').then(data => ... )

Returns company, ETF, and Mutual Fund fundamentals.

Company Fundamentals

  • Code and name of the company.
  • Exchange, currency, and country information.
  • Sector/industry and company description.
  • ISIN and CUSIP of the asset.
  • General Information:
    • Market Capitalization
    • EBITDA, PE ratio, PEG ratio.
    • Earnings per share (EPS), book value, dividend share, dividend yield.
    • Profit margin, operating margin, return on assets and return on equity.
    • Revenue, revenue per share, gross profit, diluted EPS and quarterly earnings growth (year-over-year).
  • Numbers for Valuation
    • Trailing PE, Forward PE
    • Price/Sales
    • Price/Book Ratio
    • Enterprise Value/Revenue
    • Enterprise Value Ebitda
  • Technical Indicators
    • Beta
    • 52 Week high/low
    • 50/200 day moving average
    • Shares short, short ratio, short ratio percentage.
  • Splits and Dividends
    • The forward annual dividend rate and yield
    • Payout ratio.
    • Dividend date, ex-dividend date.
    • Last split factor and split date.
  • Outstanding Shares (only US companies):
    • Date.
    • Amount of outstanding shares on the date in Millions.
  • Earnings:
    • History and Trend.
    • Quarterly and Annual.
  • Financials
    • Balance Sheet
    • Cash Flow
    • Income Statements.
    • Quarterly and Annual.

ETF Fundamentals

  • ETF general data.
    • ISIN, Company Name, and URL.
    • Current Yield, Dividend Payments information.
    • Ongoing charge, Average Market Capitalization (in Millions).
    • Net expense ratio and annual holdings turnover.
  • Technicals
    • Beta
    • 52 week high/lows
    • 50/200 day moving average
  • Breakdowns
    • Market Capitalization.
    • Asset Allocation.
    • World Regions.
    • Sector Weights.
    • Top 10 Holdings.
    • Valuation and Growth Rates for portfolio and compare to the ETF category.
    • Morning Star Data: Ratio, Category_Benchmark, Sustainability Ratio.
    • Performance: Volatility, Expected Returns, Sharp Ratio, Returns YTD/3 years/5 years/10 years.

listSupportedEtfs()

api.listSupportedEtfs().then(etfs => ... )

Returns a list of supported ETFs.

Example:

[
 { 'ETF Code': '3BLR',
    'Exchange': 'LSE',
    'Country': 'UK',
    'ISIN': 'IE00BYTYHS72',
    'ETF Name': 'Boost Brent Oil 3X Leverage Daily ETP' },
  { 'ETF Code': '3BRL',
    'Exchange': 'LSE',
    'Country': 'UK',
    'ISIN': 'IE00BYTYHS72',
    'ETF Name': 'Boost Brent Oil 3X Leverage Daily ETP' },
  ...
]