0

i'm relatively new to python, hence the perhaps low level of my question. Anyway, i am trying to create a basic program for just displaying a couple of key statistics for different stocks (beta-value, 30-day high/low, p/e, p/s etc...). I have the GUI finished, but i'm not sure how to proceed with my project. Have been researching for a few hours but can't seem to decide which way to go.

Would you recommend HTML-scraping or yahoo/google finance API or anything else for downloading the data? After i have it downloaded i am pretty much just going to print it on the GUI.

ghostfkrcb
  • 11
  • 3

2 Answers2

0

It's always best to use the provided API if you get all the information you need from it. If the API doesn't exist or is not good enough, then you go on the scraping path and it usually is more work than using API.

So I would definitely use try using APIs first.

Rok Povsic
  • 4,626
  • 5
  • 37
  • 53
0

I've used the googlefinance API to create the same program you are writing. It is easy to use and dumps the data for a specific stock to JSON. All I did was output the data into a file and then display the file's contents in the GUI. Yahoo also provides an API, but their quotes are delayed by 15 minutes, while Google provides real time quotes.

Boris
  • 1
  • 1
  • 2
  • Okay well then that sounds interesting! Is it possible to fetch data from the summary as well as financials page with the API? Meaning how is the flexibility on the different data i choose? – ghostfkrcb Nov 12 '16 at 20:00
  • The Python module for Google Finance looks like it only has two methods, getQuotes and getNews. The [GitHub page for it] (https://github.com/hongtaocai/googlefinance/blob/master/googlefinance/__init__.py) shows the two functions. You can always add to that project to include the financials tab. I haven't tried Yahoo Finance, but it might have more features. – Boris Nov 12 '16 at 20:56