historical data throws error "Insufficient permission for that call.

biren00001
Hi,

I am able to perform below api call.
1. records = kite.holdings()
2 .orders_list = kite.orders()
3. records = kite.place_order(variety=kite.VARIETY_REGULAR,exchange=kite.EXCHANGE_NSE,...)

But i am not able to call historical_data api successfully. I have subscribed to historical_data plan with 2000 Cridit.
Getting Error: "Insufficient permission for that call."

can anyone help me. i can't proceed further.
Tagged:
  • sujith
    You need to create a new access token after subscribing for historical data.
  • biren00001
    I did fresh login using request token.

    Request Token:: HeohOWMiDRvV88N68LX3Nl0VE9Gt4XoW
    ACCESS Token:: cVMO4h8Ivye1XogvlGg1RrGe2LrhJNgH
    i have called kite.invalidate_access_token(ACCESS_TOKEN) and returns as True
    invalidated Results:: True
    --> called : kite.historical_data() api

    Now, i am getting "Token is invalid or has expired." Not getting how token is expired within few seconds. Need help
  • sujith
    If you call invalidate_access_token then it will log you out. You can check out the documentation here.
  • biren00001
    Thanks for above link and kind support.
    But still i am having issue.

    I am using below simple code to work historical_data.
    session = kite.generate_session(request_token=REQUEST_TOKEN, api_secret=API_SECRET_KEY) ## session is created successfully.
    kite.set_access_token(session['access_token'])
    records = kite.historical_data(348929, "2021-12-28", "2021-12-31", '1day')

    could you please take out time to update me where am i wrong or any step i missed out.
  • sujith
    You can refer to this thread.
  • biren00001
    hi @sujith,

    after digging a lot on internet and my connect.py file. I come to a solution and found that i have not actually subscribe Historical_data addOn Instead of that i have just get the subscription.
    I got to know that it actually require 4000 to do algo trading.
    2000 for ordering and all
    2000 for historical data only(require to make some strategy).

    Thanks for all your time and support @sujith
Sign In or Register to comment.