Historical data Api - JSONObject["data"] not found.

avinashsringeri
JSONObject["data"] not found. is getting thrown. Yesterday evening some permission related error was getting thrown. Am I the only one using historical api?

org.json.JSONException: JSONObject["data"] not found.
at org.json.JSONObject.get(JSONObject.java:471)
at org.json.JSONObject.getJSONObject(JSONObject.java:636)
at com.rainmatter.models.HistoricalData.parseResponse(HistoricalData.java:24)
at com.rainmatter.kiteconnect.KiteConnect.getHistoricalData(KiteConnect.java:452)
at MultipleInstruments.loadZerodhaHistoricalData(MultipleInstruments.java:306)
at MultipleInstruments.run(MultipleInstruments.java:153)
at java.lang.Thread.run(Thread.java:745)
at MultipleInstruments.main(MultipleInstruments.java:129)
org.json.JSONException: JSONObject["data"] not found.
at org.json.JSONObject.get(JSONObject.java:471)
at org.json.JSONObject.getJSONObject(JSONObject.java:636)
at com.rainmatter.models.HistoricalData.parseResponse(HistoricalData.java:24)
at com.rainmatter.kiteconnect.KiteConnect.getHistoricalData(KiteConnect.java:452)
at MultipleInstruments.loadZerodhaHistoricalData(MultipleInstruments.java:306)
at MultipleInstruments.run(MultipleInstruments.java:153)
at java.lang.Thread.run(Thread.java:745)
at MultipleInstruments.main(MultipleInstruments.java:129)
  • sujith
    Hi @avinashsringeri,
    Are you using the Kite Connect 3?
    Can you paste the exact error message?
  • avinashsringeri
    Not Kite 3. Older version.
  • sujith
    Can you paste complete stack trace and code?
  • avinashsringeri
    org.json.JSONException: JSONObject["data"] not found.
    at org.json.JSONObject.get(JSONObject.java:471)
    at org.json.JSONObject.getJSONObject(JSONObject.java:636)
    at com.rainmatter.models.HistoricalData.parseResponse(HistoricalData.java:24)
    at com.rainmatter.kiteconnect.KiteConnect.getHistoricalData(KiteConnect.java:452)
    at MultipleInstruments.loadZerodhaHistoricalData(MultipleInstruments.java:306)
    at MultipleInstruments.run(MultipleInstruments.java:153)
    at java.lang.Thread.run(Thread.java:745)
    at MultipleInstruments.main(MultipleInstruments.java:129)
  • avinashsringeri
    avinashsringeri edited February 2018
    public static HistoricalData loadZerodhaHistoricalData(String fromDate,
    String toDate, String instrumentToken, String name, String period,
    String tradingSymbol, KiteConnect connect, boolean first)
    throws KiteException, InterruptedException {

    Map<String, Object> dateCriteria = new HashMap<String, Object>();
    dateCriteria.put("from", fromDate);
    dateCriteria.put("to", toDate);
    HistoricalData historicalData = null;
    try {
    historicalData = connect.getHistoricalData(dateCriteria,
    instrumentToken, period);
    } catch (KiteException e) {
    throw e;
    }
  • sujith
    @avinashsringeri,
    Is this consistent?
    Can you post example params to reproduce this error?
Sign In or Register to comment.