Navigation

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

    not able to get ltp data using SmartConnect

    Python SDK
    2
    2
    4
    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.
    • S
      sshah last edited by

      unable to get ltp using SmartConnect
      continue to raise objection that
      "LTP API failed: SmartConnect.ltpData() missing 1 required positional argument: 'symboltoken' "
      even when i have done so
      here is code
      try:
      exchange="NSE"
      tradingsymbol = "SBIN-EQ"
      symbolToken = "3045"
      print(symbolToken)
      ltp_data = SmartConnect.ltpData(exchange,tradingsymbol,symbolToken)
      print(ltp_data)

      1 Reply Last reply Reply Quote 0
      • N
        Nimish05Z last edited by

        You are using SmartConnect directly from library. Instead create a login function that logs in with the API key like below

        ANGEL_API_KEY = your_API_key
        smart_api = SmartConnect(api_key=ANGEL_API_KEY)

        and you can use smart_api.ltpData(...)

        it'll work. You're welcome.

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