Getting live market data aliceblue/nsepython for formulating live strategies

Hi i am trying to get live data from aliceblue which i am able to fetch but am unable to convert them into a pandas dataframe for further analysis.I am in the process of building a strategy where data from nifty 50 stocks is used to calculate nifty fut movement.I have done it successfully in excel but now i want to do it python as in excel connection needs to be refreshed due to disconnection time and again.Any help would be appreciated.

Tell with your patch of code on exact where you’re stuck. Prices to Pandas storing has examples with Zerodha API. You can find in

See if that helps.

Tip: You should use timeseries database instead. It helps a lot. Try InfluxDB

After login in for alice blue and streaming data started i try to get the entire code reflected in excel from where i can generate the required signal…following is the code:
socket_opened = False
def event_handler_quote_update(message):
print(f"quote update {message}")

def open_callback():
global socket_opened
socket_opened = True

alice.subscribe(alice.get_instrument_by_symbol(‘NSE’, ‘SBIN’), LiveFeedType.MARKET_DATA)

#create a excel sheet with same file name in the folder where the program is being run
import xlwings as xw
FILENAME = ‘saveAliceData21.xlsx’
wb = xw.Book(FILENAME)
ws = wb.sheets[‘Sheet1’]

1 Like

Why you are dealing with XLS. Use CSV please. It’s simple data.

CSV to Pandas and vice-versa is one-liner.

hi dexter i am trying to take the data from aliceblue screener withg help of the link provided by you.
but i am not able to convert this into a dataframe.My code is as follows
import requests

Making a GET request

r = requests.get(‘’)

check status code for response received

success code - 200


print content of request


import pandas as pd


r.content returns a byte stream
use r.text or r.json()

1 Like