Navigation

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

    How to find Stock-EQ Symbol's Token

    Python SDK
    3
    3
    14
    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.
    • G
      Gaurang last edited by Gaurang

      If possible give a Symbol and Token list

      S D 2 Replies Last reply Reply Quote 0
      • S
        sanskar @Gaurang last edited by

        @gaurang https://margincalculator.angelone.in/OpenAPI_File/files/OpenAPIScripMaster.json

        1 Reply Last reply Reply Quote 0
        • D
          darshil611 @Gaurang last edited by

          @gaurang

          instrument_url = 'https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json'

          response = urllib.request.urlopen(instrument_url)
          instrument_list = json.loads(response.read())

          def token_lookup(ticker, exchange='NSE'):
          for i in instrument_list:
          if i['symbol'] == ticker and i['exch_seg'] == exchange:# and i['symbol'].split('-')[-1] == 'EQ':
          return i['token']

          token_lookup('NIFTY50')
          def symbol_lookup(token, exchange='NSE'):
          for i in instrument_list:
          if i['token'] == token and i['exch_seg'] == exchange and i['symbol'].split('-')[-1] == 'EQ':
          return i['name']

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