Python – Reading Financial Data From Internet

Reading financial data from the internet is sometimes challenging. In this short article with two python snippets, I will show how to read it from Wikipedia and from and from API, delivering in JSON format:

This is how the financial json data from the api looks like.

Reading the data from the API is actually not tough, if you have experience reading JSON, with nested lists. If not, simply try with trial and error and eventually you will succeed:

With the reading from wikipedia, it is actually even easier – the site works flawlessly with pandas, and if you count the tables correctly, you would get what you want:

You might want to combine both sources, just in case:

The YouTube video for this article is here:

The GitHub code is there – GitHub

Enjoy it! 🙂

Tagged with: , , ,