One thing I've taken away from this is vanilla Javascript seems to have come a long way, or I've just never taken the time to fully appreciate all the features<p>For example I didn't even realise JS supported string interpolation<p><a href="https://github.com/toddwschneider/stocks/blob/master/index.html#L111" rel="nofollow">https://github.com/toddwschneider/stocks/blob/master/index.h...</a>
Neat! I used this API to live-code a mini-portfolio-manager SaaS a couple of months ago: <a href="https://anvil.works/blog/live-coding-stock-portfolio" rel="nofollow">https://anvil.works/blog/live-coding-stock-portfolio</a><p>It let you pick the stocks yourself, and showed you historical graphs too. It was a bit more complex than this, but still only took an hour.
There's definitely something I can learn from this. By the way, Robinhood API also gives you quotes for free <a href="https://api.robinhood.com/quotes/?symbols=AMD,TSLA" rel="nofollow">https://api.robinhood.com/quotes/?symbols=AMD,TSLA</a>
This is great. I love the simple, succinct interface — I wish real financial companies like my trading account and my bank had even half this much sense when it comes to pragmatic design.<p>A few notes from taking a look at the code:<p>* I've very much started doing the same thing in my projects of just using modern JavaScript constructs like fetch and arrow functions without a transpiler. IE is never going to support any of them, but I've accepted that. Caniuse.com ranks most of them at 85%+ supported.<p>* It's neat to see that the IEX API supports batch requests (as opposed to having to pull one stock at a time) in its API which makes it possible to implement the project efficiently and in a way that doesn't have to store state.<p>* Nice work building it to support large users as well. A lot of installations probably won't have more than 100 stocks, but it'll break up requests into multiple batches of <= 100 if they do.
I'm not into stocks, but like the way you coded it. We don't see this sort of good examples that combines the old school simplicity and new JS / DOM API features.
hmm, while this is cool i am not sure if it is a full-fledged replacement for the Google Finance "portfolios" feature. That lets you add the number of stocks you own for each symbol and shows you an aggregate gain/loss per day, etc. That was the main reason i was using google finance.<p>I have now transitioned to my own Google Sheet with the "=GOOGLEFINANCE()" function for getting the stock data. Works pretty well.
Very cool!<p>As everything is done client side how about adding some parsing of the URL #hash/?query to encode data of a portfolio? That way you could have a single statically hosted version serving multiple people. Could even have a portfolio builder page that generates the encoded URL.
Looks like it gets an html page from <a href="https://iextrading.com/apps/stocks/#/<stock>" rel="nofollow">https://iextrading.com/apps/stocks/#/<stock></a> then scrapes it. Not really an API. Edit: ok, I'm wrong.