Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to live stream stock price using python

Tags:

python

stock

At first I want to find some API, but I have searched on the internet and didn't find anything really helpful.

"Real time" I mean live stream the stock price on a webpage without a refresh.

If there is not such API, would my following method be a good way to implement this? 1. Python side, call yahoo finance api to get the most recent price. 2. Browser side, use ajax to constantly call server side to get the price and display the price. More specifically, I am thinking to use setInterval in jquery to achieve this.

How does this approach look?

Actually this is not specific to stock price data, any website that need to constantly retrieve data from server side need to consider this problem. For example google chat, facebook news feed, and so on. Can anybody tell me in general how to achieve live streaming data from server to browser?

like image 579
performanceuser Avatar asked Dec 04 '25 16:12

performanceuser


1 Answers

Another way would be to use a push architecture. You could take a look at APE - Ajax Push Engine.

You could also take a look at Socket.IO, a realtime application framework for Node.JS.

Hope this helps!

like image 171
Thanos Makris Avatar answered Dec 07 '25 06:12

Thanos Makris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!