Group Details Private

administrators

  • A

    @p187170 Pass (4 digits) MPIN as string in the password field.

    password = "MPIN"

    read more
  • P

    Hello SmartAPI Team,

    I am trying to authenticate using the SmartAPI Python SDK with TOTP enabled.

    However, the login request consistently returns the following error:

    Error Code: AB1050
    Message: Invalid totp

    Details of my setup:

    • Python version: 3.13
    • Library: smartapi-python
    • TOTP generated using: pyotp
    • Authentication method: client_id + password + totp

    My login code:

    from SmartApi import SmartConnect
    import pyotp

    api_key = "API_KEY"
    client_id = "CLIENT_ID"
    password = "PASSWORD"
    totp_secret = "SECRET_KEY"

    totp = pyotp.TOTP(totp_secret).now()

    obj = SmartConnect(api_key)

    data = obj.generateSession(client_id, password, totp)

    print(data)

    Troubleshooting steps already performed:

    Verified that TOTP generated using pyotp matches the TOTP generated using online generator:
    https://totp.danhersam.com

    Verified that the same secret key produces identical OTP in multiple generators.

    System time synchronized with internet time server.

    Despite this, SmartAPI login still returns:

    {
    "status": False,
    "message": "Invalid totp",
    "errorcode": "AB1050"
    }

    Could you please clarify:

    Is there a specific method required to generate TOTP for SmartAPI? Does SmartAPI require TOTP generated from the SmartAPI TOTP enable page specifically? Are there any restrictions on authenticator apps (Google Authenticator / Microsoft Authenticator)?

    Any guidance would be greatly appreciated.

    Thank you.

    read more
  • A

    @parthiban89 Currently API does not provide historical data for expired instruments.

    read more
  • P

    Hi everyone,
    I am new here is there any way I can retrieve the expired commodity option chart? Ex. Last year expired crude option chart for specific CE/PE options?

    Appreciate your help.

    read more