getLtpData not working


  • Hi,
    String exchange = "NSE";
    String tradingSymbol = "NIFTY";
    String symboltoken = "26000";
    JSONObject ltpData = smartConnect.getLTP(exchange, tradingSymbol, symboltoken);
    logger.info(ltpData.toString());

    2023-12-04 13:06:47,865 ERROR [main] com.angelbroking.smartapi.SmartConnect: JSONObject["data"] is not a JSONObject (class org.json.JSONObject$Null : null).


  • Hi @saikumarg

    Apologies for delayed response.
    Index token has to be passed with "999" prefix(99926000). Please try passing the same and if the issue has not resolved, Kindly share us the curl of the API request.

    Thanks & Regards,
    SmartAPI team