Navigation

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

    Historical data api not working

    Python SDK
    2
    6
    5
    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.
    • A
      asif_khan1993 last edited by

      @admin I am able to fetch profile data, session data is also valid and status is true, but when I call candle data api I am getting error invalid token url, plzz help

      my client id is A282484

      A 1 Reply Last reply Reply Quote 0
      • A
        algo_trading_50 @asif_khan1993 last edited by

        @asif_khan1993 Try example code here.

        A 1 Reply Last reply Reply Quote 0
        • A
          asif_khan1993 @algo_trading_50 last edited by

          @algo_trading_50 I tried with this example only but getting
          Error occurred while making a POST request to https://apiconnect.angelone.in/rest/secure/angelbroking/historical/v1/getCandleData. Error: Invalid API Key

          A 1 Reply Last reply Reply Quote 0
          • A
            algo_trading_50 @asif_khan1993 last edited by

            @asif_khan1993 Try creating an API app from here.

            A 1 Reply Last reply Reply Quote 0
            • A
              asif_khan1993 @algo_trading_50 last edited by

              @algo_trading_50 I have already created the app, named asif_api,

              A 1 Reply Last reply Reply Quote 0
              • A
                algo_trading_50 @asif_khan1993 last edited by

                @asif_khan1993

                from SmartApi import SmartConnect
                
                API_KEY = 'API_KEY'
                JWT_TOKEN = 'JWT_TOKEN'
                
                obj = SmartConnect(access_token=JWT_TOKEN, api_key=API_KEY)
                
                historicParam = {
                    "exchange": "NSE",
                    "symboltoken": "1594",
                    "interval": "ONE_MINUTE",
                    "fromdate": "2026-03-19 09:00",
                    "todate": "2026-03-19 09:16"
                }
                
                candles = obj.getCandleData(historicParam)
                
                print(candles)
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post