Skip to content
Alan Vinicius Silva edited this page Jun 26, 2020 · 12 revisions

Documentation

1. Getting started
    1.1 Install
    1.2 Example
2. Documentation
    2.1 Setup
    2.2 Financial Data
        2.2.1 Technical Indicator
        2.2.2 Intraday Historical Data
        2.2.3 Options Data
        2.2.4 Live Stock Prices API
        2.2.5 Historical Splits, Dividends and Short Interest
            2.2.5.1 Splits
            2.2.5.2 Dividends
            2.2.5.3 Shorts
        2.2.6 Stock Price Data (End-Of-Day Historical Data)
    2.3. Exchanges (Stock Market)
        2.3.1 Search API for Stocks, ETFs, Mutual Funds and Indices
        2.3.2 ~~Trading Hours and Market Holidays~~
        2.3.3 Bulk API for EOD, Splits and Dividends
        2.3.4 Get Exchange Symbols

$ npm install eodhistoricaldata
const eodAPI = require('eodhistoricaldata').default;
// import eodAPI from "eodhistoricaldata";

eodAPI.setup({apiToken: "OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX"});
(async () => {
	const eodRes = await eodAPI.eod("AAPL.US", {fmt: 'json', from: "2020-01-01"});
 	console.log(eodRes);
})();

// OR...

eodAPI.setup({apiToken: "OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX", exchangeCode: "US"});
(async () => {
	const eodRes = await eodAPI.eod("AAPL", {fmt: 'json', from: "2020-01-01"});
	console.log(eodRes);
})();

As you can see, you must set up the module with your api token (Get yours here) and (optionally) an exchange code (List of Codes). Once you completed the setup, you can use any function available bellow.


eodAPI.setup(options)

  • options
    • apiToken required
    • exchangeCode

Sets up the module with the API token and an exchange code

eodAPI.technical(symbols, options)

  • symbols required
  • options
    • from
    • to
    • function
    • period
    • order
    • fmt

eodAPI.intraday(symbols, options)

  • symbols required
  • options
    • from
    • to
    • interval
    • fmt

eodAPI.options(symbols, options)

  • symbols required
  • options
    • from
    • to
    • trade_date_from
    • trade_date_to
    • contract_name

eodAPI.real-time(symbols, options)

  • symbols required
  • options
    • fmt

eodAPI.splits(symbols, options)

  • symbols required
  • options
    • from
    • to

eodAPI.div(symbols, options)

  • symbols required
  • options
    • from
    • to

eodAPI.shorts(symbols, options)

  • symbols required
  • options
    • from
    • to

eodAPI.eod(symbols, options)

  • symbols required
  • options
    • from
    • to
    • period
    • order
    • filter
    • fmt

Sets up the module with the API token and an exchange code