Historical data api not working
-
@asif_khan1993 Try example code here.
-
@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 -
@asif_khan1993 Try creating an API app from here.
-
@algo_trading_50 I have already created the app, named asif_api,
-
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) -
@algo_trading_50 I am getting the same error
[E 260324 13:26:08 smartConnect:246] Error occurred while making a POST request to https://apiconnect.angelone.in/rest/secure/angelbroking/historical/v1/getCandleData. Error: Invalid Token. URL: -
@algo_trading_50 I have created api type as trading api, how to create another app with type histocical api ?? I am not able to
-
@asif_khan1993 Kindly use "New Login".
-
@algo_trading_50 I am using new login only...
-
@asif_khan1993 You are right, with "New Login" API app it is giving following error:
{'success': False, 'message': 'Invalid API Key', 'errorCode': 'AG8004', 'data': ''}With old API app created using "Login" page seems to be working fine.