Websockets API returning no data

@Hardik @Dhan @Dhan_Cares

Greeting of the day!

I also faced the exact same issue today as mentioned in this post 'no close frame received or sent' issue - #18 by AmitKAswani

no data was being received, and subsequently no trades were placed as a result.

In my case the connection was successful but, The api websocket returned no data for security id 53079 and 53081 .

When i manually re-tried multiple times then after 9:45 onward data was being received.

These random errors every now and then are costing me a great deal of money and time

Kindly do a proper RCA , this is a recurring issue why no data was being sent from server for roughly 30 minutes from the start of trading session today.

Yes, I struggled in the morning too. The live feed randomly disconnects and I’ve been struggling with these issue for almost 3 weeks now. I keep getting random responses from customer care. I don’t understand how can the API pass the testing phase prior to production launch.

This is another example …def test():
try:
# Update nomenclature for v1.2.4

    response_dictionary_1 = dhan.historical_daily_data('Nifty 50', 'IDX_I', 'INDEX', 0, "2024-10-20", "2024-10-19")
    
    print(response_dictionary_1)
   
    if response_dictionary_1.get('status') == 'success':
        data_list = response_dictionary_1.get("data",{})
        #print(data_list)
        if data_list:
            dataframe = pd.DataFrame(data_list)
            dataframe = commonFunctions.convert_to_date_time(dataframe)

            print(dataframe)
    elif response_dictionary_1.get('status') == 'failure':
         message = response_dictionary_1.get('remarks')
         print(message)        
except Exception as e:
    print(e)     ........Notice the data response is empty.....2024-10-22 10:18:42,171 - INFO - Logging started - common function library

{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: {}}

i have also opened multiple threads in the last few days regarding the stability of API

in your code specifically the data might not be received despite the status being success is because the end date is before the start date

my bad wrong copy paste but even if you change the dates and make it 17/10 to 18/10…it does not work

@Dhan , @Dhan_Cares - Please check and confirm

Hello @AmitKAswani @Tushar11

We are looking into this error of random disconnection being faced by few users on the Live Market Feed. I will update to you on this soon.

Thanks! @Hardik . Please get this API checked too. (historical_daily_data)

Hello @AmitKAswani

What is the issue you are facing on this endpoint?

The response is empty …{‘status’: ‘success’, ‘remarks’: ‘’, ‘data’: {}}

Hello @AmitKAswani

Looks like there is no data present. Can you share the request parameters here for us to check.

dhan.historical_daily_data(‘Nifty 50’, ‘IDX_I’, ‘INDEX’, 0, “2024-10-20”, “2024-10-19”)

Over here, your from_date and to_date are incorrect, wherein from_date > to_date.

Also, since to_date is not inclusive, you have to keep the gap accordingly.

Is there a document defining you SLA, for data API.
It’s a paid API, it should have well-defined SLAs.

@Hardik, @Dhan_Cares - That was a typing mistake, even if u use the correct dates the API just returns blank. Please read the above thread as I’ve already mentioned it.