Skip to main content

Posts

Showing posts from July, 2020

Evergreen Financial Research Report - Nvidia Corporation ($NVDA) 2H2020

Querying Live Stock Prices in Python Without an API

When I first got into Python, I had a clear goal from the very start: I wanted to make a stock ticker that I could choose a company, and it would show me the price in real time. Due to the beautiful simplicity of Python, I found myself getting closer to achieving this goal in less time than I thought I would need. Once I got the basics of Python down, I started searching for how to query a live stock price. There are plenty  of APIs that are happy to give you live stock data... for a handsome fee. Google Finance had a promising API, though it seems to have since been abandoned. Most of the decent free APIs I came across had a dishearteningly low daily query limit. In the end, I decided on a less respectable method: web scraping.  Through much trial and error, I have simplified the code quite a bit. I have also sorted through dozens of websites to see who does and does not monitor/throttle excessive requesting. I have come to the conclusion that Yahoo Finance is best for scraping stock