This is a complex C++ program that is used as an interface to the client, we only need to execute the main thread and it will automatically update stock market data and store it using the JSON format.
We have used IEX API which is free and has more than 10 indices. It obtains information in real time and it is updated whenever you execute it.
Link
The code it for free on a GitHub repository: StockMarketData Repository