Navigation

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

    Historical API for Nifty and Bank Nifty

    General Discussion
    0
    3
    18
    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
      Gunjit last edited by

      @admin When will we get the historical API for indices? Please update.

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

        Hi @Gunjit

        Apologies for delayed response.
        We have started providing historical data for index. Kindly check.

        Thanks & Regards,
        SmartAPI team

        O 1 Reply Last reply Reply Quote 0
        • O
          opt_trader @Moderator_2 last edited by

          @Moderator_2 Thank you for your kind and prompt responses.

          Kindly help how do we fetch open interest for historical data of options. I am using the below line of code but it is showing an error as

          Historic Api failed: 'Series' object has no attribute 'open_interest' BANKNIFTY20DEC2346000CE

          Code is as below:
          historicParam = {
          "exchange" : symbolInfo.exch_seg,
          "symboltoken": symbolInfo.token,
          "interval": "ONE_MINUTE",
          "fromdate": "2023-12-15 09:15",
          "todate": "2023-12-15 15:30",
          }
          res_json = obj.getCandleData(historicParam)
          columns = ["timestamp", "open", "high", "low", "close", "volume"]
          df = pd.DataFrame(res_json["data"], columns= columns )
          df["open_interest"] = symbolInfo.open_interest

          Without Open interest the code works fine. Thanks in advance

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