Quick Start

To get historical stock price data with use the following URL

https://eodhistoricaldata.com/api/eod/AAPL.US?api_token={your_api_key}

  • AAPL.US consists of two parts: {SYMBOL_NAME}.{EXCHANGE_ID}, then you can use, for example, AAPL.MX for Mexican Stock Exchange. or AAPL.US for NASDAQ. Check the list of supported exchanges to get more information about stock markets we do support.
  • api_token – your own API KEY, which you will get after you subscribing to our services.
  • period – use ‘d’ for daily, ‘w’ for weekly and ‘m’ for monthly prices. By default daily prices will be shown.
  • order – 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.

For testing purposes you can try the following API Key (works only for AAPL.US ticker):  OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX:

https://eodhistoricaldata.com/api/eod/AAPL.US?api_token=OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX&period=d.

As a result you will get the following data in CSV format:

DateOpenHighLowCloseAdjusted_closeVolume
2017-05-16155.94156.06154.72155.47155.4719956800
2017-05-17153.60154.57149.71150.25150.2550622900
2017-05-18151.27153.34151.13152.54152.5433429900
2017-05-19153.38153.98152.63153.06153.0626828100
2017-05-22154.00154.58152.91153.99153.9922647900

Stock Prices Data API with Dates Support

We support two formats for historical data dates.

EOD Historical Data

Here you can use ‘from’ and ‘to’ parameters with format ‘Y-m-d’. For example, if you need to get data only from Jan 5, 2017 to Feb 10 2017, you need to use from_date=2017-01-05 and to_date=2017-02-10. Then the final URL will be:

https://eodhistoricaldata.com/api/eod/AAPL.US?from=2017-01-05&to=2017-02-10&api_token=OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX&period=d

Yahoo Finance API Support

To support clients who used Yahoo Finance non-official API which doesn’t work now (URL: ichart.finance.yahoo.com), we also support yahoo-style for dates. Here there will be 6 parameters.

  • First of all, for yahoo-style you need to use another endpoint: https://eodhistoricaldata.com/api/table.csv.
  • For symbol you should use s, then for AAPL it will be: s=AAPL.US.
  • For ‘from date’ you should use a, b, c for month, day, year. Then 2017-01-05 will be: a=01, b=05, c=2017.
  • For ‘to date’ you should use d, e, f for month, day, year. Then 2017-02-10 will be: d=02, e=10, f=2017.
  • For ‘period’ you should use g. Possible values are d for daily, w for weekly and m for montly.

BE CAREFUL, date used here in American notation: MONTH, DAY, YEAR.

And the final URL will be:

https://eodhistoricaldata.com/api/table.csv?s=AAPL.US&api_token=OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX&a=05&b=01&c=2017&d=10&e=02&f=2017&g=d

We hope it will be very useful for you.

JSON Output Support

We support JSON output as well if you need it for your PHP, Python, Java or Perl applications. All you need is to add a special parameter: “fmt=json” to your query, then the final query will be:

https://eodhistoricaldata.com/api/eod/AAPL.US?from=2017-01-05&to=2017-02-10&api_token=OeAFFmMliFG5orCUuwAKQ8l4WWFQ67YX&period=d&fmt=json

EOD Historical Data JSON Output

JSON output doesn’t work for Yahoo-like style.

Comments

  1. Pingback: List of Symbols for Exchange — API Documentation for EOD Historical Data

  2. Pingback: Excel VBA Bulk Example — API Documentation for EOD Historical Data

Leave a Reply