Hi Axist,
Unfortunately, a detailed answer is too long. It's a bit like asking “How do you build a car?”…
For data live feeds, the best is to use the websockets' channels. For instance, for stocks:
https://polygon.io/docs/stocks/ws_getting-started
For Python, also check out the client-python, https://github.com/polygon-io/client-python.
For integration into LEAN, the principle is that you need to use Custom Data to code the glue between LEAN and your websockets. You can look at https://www.quantconnect.com/docs/v2/writing-algorithms/importing-data/key-concepts to get the basic principles but the explanations are for backtesting, live trading.
For high-level coding in Python on websockets, I recommend using websockets, https://websockets.readthedocs.io/en/stable/.
You can also interface LEAN with REST endpoints. But then each data request is an HTTP request. With websockets, it's a long-lived connection spitting data. More appropriate for live trading.
Fred