Philx94
Philx94

Reputation: 1295

GET historical stock information with IEX API

I've been trying to find an API that gives me the stock price on a certain day. I am testing with IEX but no matter what {date} param I use I always get the information of yesterday.

stock/{symbol}/chart/{date}

https://cloud.iexapis.com/stable/stock/aapl/chart/20150101?token=MY_TOKEN

The given JSON:

[
  {
    "close": 121.42,
    ...,
    "date": "2021-03-05",
    ...
  }
]

Anyone has experience with the IEX API ? In the docs it says that this should work with the non-paid solution.

Upvotes: 0

Views: 868

Answers (1)

Ezra Katz
Ezra Katz

Reputation: 136

Yes, the IEX API provides an endpoint to retrieve stock prices on a specific day. However, as stated in the documentation, any date more than 5 years from today requires a paid subscription.

See the documentation link here:
https://iexcloud.io/docs/api/#historical-prices

For dates less than 5 years (or if you have a paid subscription), the following example worked for me (notice the date path parameter after chart):
https://cloud.iexapis.com/stable/stock/aapl/chart/date/20210104?token=MY_TOKEN

Upvotes: 1

Related Questions