Navigation

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

    Unable to get history data of commodity stock SILVER23JULFUT

    Python SDK
    0
    1
    12
    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.
    • N
      N51542847 last edited by

      Hi,
      I was using history api to get data of commodity stock from "MCX" exchange but recently i am not getting any data.

      Please help why

      I have collected token and exchange value from https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json
      website.

      token symbol name exch_seg
      244731 SILVER23JULFUT SILVER MCX

      try:
          historicParam = {
              "exchange": "MCX",
              "symboltoken": "244731",
              "interval": "FIVE_MINUTE",
              "fromdate": "2023-06-01 13:30",
              "todate":"2023-06-16 13:30"
          }
          historic_data = obj.getCandleData(historicParam)
      
          # Extract the candle data from the 'data' key
          candle_data = historic_data['data']
      
          # Create a DataFrame from the candle data
          df = pd.DataFrame(candle_data, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
      
      except Exception as e:
          print("Historic Api failed: {}".format(e.message))
      

      I am getting below output after running above code.

      Out put:

      Empty DataFrame
      Columns: [timestamp, open, high, low, close, volume]
      Index: []

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