I’m looking for a trustworthy and free API to get basic stock information. My needs are pretty simple. I want to fetch data for common stocks and market indexes every 5 minutes.
I’ve been using yfinance, but it’s been causing me a lot of headaches. Don’t get me wrong, I know the developer put in a lot of work. But for my purposes, it’s just not cutting it.
Has anyone found a good alternative? I’d really appreciate any suggestions for reliable APIs that won’t break the bank. It would be a huge help for my project.
Thanks in advance for any tips or recommendations!
hey mate, have u checked out Polygon.io? been using it for a while and its pretty solid. free tier’s got some limits but works great for basic stuff. just watch out for the api call limits, gotta be smart about how u use em. also, their docs r pretty good which helps a ton when setting things up
Have you considered using Alpha Vantage? I’ve found it to be a reliable alternative to yfinance for basic stock data. Their free tier offers 5 API calls per minute and 500 per day, which should suffice for fetching data every 5 minutes for a handful of stocks and indexes.
One thing to keep in mind is that you’ll need to implement some error handling and rate limiting in your code to stay within the free tier limits. I’ve found caching frequently accessed data locally helps reduce API calls significantly.
If you need more frequent updates or data for a larger number of securities, you might want to look into Finnhub or IEX Cloud. They offer more generous free tiers, though you’ll still need to manage your usage carefully.
Whichever API you choose, make sure to thoroughly read their documentation and terms of service to ensure it meets your specific needs and usage requirements.
I’ve been in your shoes, Nate. After struggling with yfinance, I switched to Alpha Vantage and haven’t looked back. It’s been rock-solid for my needs, offering real-time and historical data with a decent free tier. The API is straightforward to use, and I’ve found their documentation really helpful.
One tip: if you’re pulling data every 5 minutes, keep an eye on your daily request limit. I had to optimize my code to batch requests and cache some data locally to stay within the free tier. It took some tweaking, but now it runs smoothly.
Also, don’t overlook the Yahoo Finance API. It’s not officially supported, but there are some great community-made wrappers out there that make it easy to use. It’s been surprisingly reliable for me as a backup option.
Whatever you choose, make sure to implement good error handling. These free APIs can sometimes hiccup, and you don’t want your project grinding to a halt because of a temporary outage.