Reputation: 1295
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
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