A Java CLI for getting stock information. This is a Command Line Interface application which generates up-to-date stock information The application utilized eodhd.com finance API.
A command line interface for easily getting the latest stock price. This application also enables you to get the change in stock price and percentage between two dates.
Usage: stock-cli [-hp] [-ed=<end_date>] -s=<symbol> [-sd=<start_date>]
Option arguments:
-h, --help Show help message
-s=<symbol> Stock symbol/ticker (Required)
-sd=<start_date> Stock price start date. Format: yyyy-mm-dd
-ed=<end_date> Stock price end date. Format: yyyy-mm-dd
-p Use if you want to see a percentage change$ C\Users\stock-cli> stock-cli -s NVDA$ C\Users\stock-cli> stock-cli -s MSFT -sd 2024-02-10 -ed 2024-02-19$ C\Users\stock-cli> stock-cli -s MSFT -sd 2024-02-10 -ed 2024-02-19 -p4. Sample Command 4 - Display the change in price and percentage from a starting date to current date
$ C\Users\stock-cli> stock-cli -s AAPL -sd 2024-02-10 -p$ C\Users\stock-cli> stock-cli -hThe following instructions will get you the copy of the project set up in your local machine to start running the command line interface stock-cli and getting stock prices quickly!
You will need to have Java >= 11 installed in your local machine.
The stock-cli project requires you to have a Finance API from eodhd.com. Below are the steps to get a free API.
- Navigate to https://eodhd.com/
- On the top bar, go to Documentation > End of Day API
- Click on Register and Get Data to sign up
- You will receive a free API key. See below instructions on how to configure the API Key in the project file
- The free API key has a limit of 20 API calls per day. Each call will consume 1 API limit. See your eodhd.com dashboard for more information.
This section goes through configuring your API key, and building the project.
Clone the repository from github to your local machine.
To successfully make the API call for the stock-cli application, we need to set up a configuration file that can use your free API key you received from eodhd.com.
Using the IDE of your choice, navigate to src/main/java/config folder. Create a new file config.properties (please make sure the file name is called exactly this).
Open the config.properties file and add an entry:
API_KEY = <your_free_API_Key>where your replace the <your_free_API_key> with the API key you received. Please make sure you do not add any qoutations around the API key.
Example:
API_KEY = A123bCD45EF6Now you are ready to run the application.
Go to your command prompt and run the following:
$ C\Users> stock-cli -hThe project is licensed under the MIT license. View the License File for details.

