How to get the historical candle data for Nifty50

raula_kite127
How to get the candle data sets for the Nifty50 because in API for historical data we didn't see any share we passed in the API.
When i trying with the JAVA client i am getting below error,

INFO: {"status":"error","message":"Insufficient permission for that call.","data":null,"error_type":"PermissionException"}
Sep 27, 2018 1:02:17 PM okhttp3.internal.platform.Platform log
INFO: <-- END HTTP (116-byte body)
Insufficient permission for that call. 403 com.zerodhatech.kiteconnect.kitehttp.exceptions.PermissionException
  • sujith
    You need to subscribe for historical data to use it.
    You can go to the app details page on developers console and subscribe for the same.
  • raula_kite127
    How to get a specific share's candle data?
    In case of mine, I need only Nifty50 candle data details how to get the historical data for this?
    Is that we will get the candle data those the user invested or will get any specific share's historical candle data.
  • raula_kite127
    did you understand the query which I wrote?
    In the API documentation,
    # Fetch minute candles off NSE-ACC.
    # This will return several days of minute data ending today.
    # The time of the request is assumed to be to be 01:30 PM, 1 Jan 2016,
    # which is reflected in the latest (last) record.

    # The data has been truncated with ... in the example responses.

    curl "https://api.kite.trade/instruments/historical/5633/minute?from=2015-12-28+09:30:00&to=2016-01-01+10:30:00"
    -H "X-Kite-Version: 3" \
    -H "Authorization: token api_key:access_token" \v

    In the above API where share type mentioned? How we will get a specific share's candle data?
  • rakeshr
    @raula_kite127
    curl "https://api.kite.trade/instruments/historical/5633/minute?from=2015-12-28+09:30:00&to=2016-01-01+10:30:00"

    Here,5633 is instrument token for ACC stock.You need to replace 5633 with instrument token of the scrip you need candle's data.
    Get complete instrument token list here.
    Please go through URI param for required API to know all inputs requirements,it's explained in detail.
  • raula_kite127
    I paid the historical data subscription the service.
    But when i run the examples.getHistoricalData(kiteConnect); i am getting an as well as in the response i found it was 0 candle data.

    Please the console below and let me know the solution as soon as possible.

    INFO: <-- 200 OK https://api.kite.trade/instruments/historical/11946498/30minute?continuous=0&amp;from=2018-09-27 09:00:00&amp;to=2018-09-27 12:59:12 (204ms)
    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO: Date: Fri, 28 Sep 2018 06:34:04 GMT

    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO: Set-Cookie: __cfduid=dfc573886f5a0cbecd1cf9e94a73bbb721538116444; expires=Sat, 28-Sep-19 06:34:04 GMT; path=/; domain=.kite.trade; HttpOnly
    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO: Access-Control-Allow-Origin: *
    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log

    INFO: Strict-Transport-Security: max-age=15552000; includeSubDomains

    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log

    INFO: Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"

    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO: Server: cloudflare
    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO: CF-RAY: 46142ea1497d897b-MAA
    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO:
    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log

    INFO: {"status": "success", "data": {"candles": []}}

    Sep 28, 2018 12:03:55 PM okhttp3.internal.platform.Platform log
    INFO: <-- END HTTP (46-byte body)


    Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at com.zerodhatech.test.Examples.getHistoricalData(Examples.java:330)
    at com.zerodhatech.test.Test.main(Test.java:60)
    0

Sign In or Register to comment.