Quoter is a small command line tool to fetch stock quotes. In order to minimize HTML scraping, it retrieves quotes from https://iexcloud.io You can signup for free and get 500k stock quotes per month. Please check their usage agreements prior to signing up and ensure you are allowed to user their service.
After getting an account, log into the dashboard and you can see your API tokens. You'll need the secret token to use this program. The secret key starts with "sk_"
Unfortunately, IEXCloud does not provide index data. Therefore they are scraped from a finance website to get the DOW, NASDAQ, and S&P500 data. I don't really like this, but it seems the only option at this point. It does mean that there is a likelihood that I'll probably have to keep updating the program if the web page format changes.
I live in the US and have no idea how this will perform for stock exchanges. For indexes, it only pulls the DOW, S&P500, and the NASDAQ.
Before you can start to use the tool, you'll need to store your API Secret Key. To do this execute the following:
java -jar quoter.jar -c
This will prompt you for the key which will be stored in the java preferences system. On Windows this is the registry. In Linux it's a hidden directory inside your home directory. Currently it is not encrypted, but I'll need to look into this at some point.
-D Start in Debug Mode which will display additional debugging data. Normally not used
-c Configure the IEXCloud.IO API key
-e Export the results into a CSV file [Not Yet Implemented]
-v Display the version and exit
-k Display the configured IEX secret API key and exit
-h or -? Display the help page
No parameters are required. If none are entered, the program will provide the DOW, NASDAQ, and S&P500 index data.
However, you probably want some quotes. Therefore, provide one or more.
java -jar quote.jar amzn msft acn ibm
This is obviously not meant to be a large financial package. It's just a small utility that I wanted to use to tell me if I'll ever be able to retire :-) If you have suggestions or idea, please let me know.