Navigation

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

    Trading

    Python SDK
    1
    1
    2
    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.
    • B
      B199593 last edited by

      from smartapi import SmartConnect

      Replace with your actual details:

      API_KEY = "nBvKVLPi" # Your actual API key
      CLIENT_ID = "Your AngelOne client ID (e.g. R123456)"
      PASSWORD = "Your login password"
      TOTP = "Your TOTP code if 2FA enabled (optional)"

      obj = SmartConnect(api_key=API_KEY)

      Login session

      data = obj.generateSession(CLIENT_ID, PASSWORD, TOTP)
      refresh_token = data['data']['refreshToken']
      access_token = obj.getAccessToken()

      Check profile (optional)

      profile = obj.getProfile(refresh_token)
      print("Profile:", profile)

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