Tick not working. Getting only tick data of morning


  • Hi @admin
    from SmartApi import SmartConnect
    import getpass

    Ask user input securely

    api_key = input("API Key: ").strip()
    client_code = input("Client Code: ").strip()
    password = getpass.getpass("Password: ")
    totp = getpass.getpass("TOTP (6 digits): ").strip()

    Create SmartConnect object

    obj = SmartConnect(api_key=api_key)

    Attempt to generate session

    resp = obj.generateSession(client_code, password, totp)

    Display full response

    print("\nLogin Response:", resp)

    Check and print the Bearer token if login is successful

    if resp.get("status") and resp.get("data") and "jwtToken" in resp["data"]:
    bearer_token = resp["data"]["jwtToken"]
    print("\n✅ Your Bearer Token:")
    print(f"Authorization: Bearer {bearer_token}")
    else:
    print("\n❌ Login failed:", resp.get("message"))
    I have generated the Bearer token using this code but while using it to get historical data it is showing following error
    Candle Data Response:
    {'success': False, 'message': 'Invalid Token', 'errorCode': 'AG8001', 'data': ''}
    OI Data Response:
    {'success': False, 'message': 'Invalid Token', 'errorCode': 'AG8001', 'data': ''}


  • Hi @vishant,

    Apologies for delayed response.
    Kindly let us know if the request initiated during market hours.
    If the problem still occurs, Please share us the API request params, headers along with error log if you have any.

    Thanks & Regards,
    SmartAPI team


  • Hi @Moderator_2

    I am also facing same problem. Is tick only gets updated during market hours.

    Could you please confirm behaviour during Market time and during off Time