ESPSMS(episode 3) Stock Price

Hello explorers!!!!!
Hope you all must be exploring and making something AMAZING….
If you are regularly exploring ESPSMS, then I think you all have got the idea of how all these assistant works. And how you can add different tricks to this assistants.

This is the episode for brokers,business men, and of course for the Techies. In this episode we will see how ESPSMS will respond towards the stock price asked by the user. But this is now limited to only stocks under BSE brokers. If you know how to embed international stock market in it, let me know at espsms@techiesms.com. Now let’s get started with BSE broker.

Short Story for this trick

Stock price is a thing which some people frequently ask to their assistants or download the app to get notify after any changes in the price.So i thought why can’t ESPSMS respond to this question. So the research for this begins……

Genuinely saying, It didn’t take any effort for me to find free API of this trick. As this API is provided by Google itself. The link in which you need to add the stock name and you’ll get its price and its broker in response. That’s it.

Google Finance

Google finance is the solution for our assistant. Google has provided direct APIs for stock price without any kind of API key or subscription key so that any one can ever use this. Just you need to change the name of the stock in that link you are suppose to request and you will get all the relevant details regarding that stock. And out of that available data, we will filter out and display only certain data on our serial monitor.

The API to get the stock price in response is,

https://www.google.com/finance/info?q=NSE:Stock_Name

The data available from the API contains,(this is the example for stock price of BHEL

 [
{
"id": "15274130"
,"t" : "BHEL"
,"e" : "NSE"
,"l" : "140.75"
,"l_fix" : "140.75"
,"l_cur" : "₹140.75"
,"s": "0"
,"ltt":"3:30PM GMT+5:30"
,"lt" : "Oct 19, 3:30PM GMT+5:30"
,"lt_dts" : "2016-10-19T15:30:00Z"
,"c" : "-0.50"
,"c_fix" : "-0.50"
,"cp" : "-0.35"
,"cp_fix" : "-0.35"
,"ccol" : "chr"
,"pcls_fix" : "141.25"
}
]

Out of this much available data, I just filtered the name of the stock,it’s broker and fix price of it. You can even use all other information available if necessary. Just filter it our inside the library as I did.

So this is how you can get the stock price of NSE brokers. Likewise if you know any API for getting the stock price of International stock market, so let me know at espsms@techiesms.com.

You can update your previous code to add this trick on your personal assistant from my GitHub account.

Subscribe my YouTube channel for regular notifications
and Join the community on my website to give some contribution to the world by sharing your knowledge.

 

Stay excited for the next episode. Till then,

explore | learn | share

#techiesms

One Reply to “ESPSMS(episode 3) Stock Price”

Leave a Reply

Your email address will not be published. Required fields are marked *