Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Tick not working. Getting only tick data of morning

    General Discussion
    0
    3
    31
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      krunal96 last edited by krunal96

      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': ''}

      M 1 Reply Last reply Reply Quote 0
      • M
        Moderator_2 @krunal96 last edited by

        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

        M 1 Reply Last reply Reply Quote 0
        • M
          mohammadfaiizan @Moderator_2 last edited by

          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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post