How to get Nifty or BankNifty Historical and Intraday data using Tradehull Codebase API?

How to get Nifty or BankNifty Historical and Intraday data using Tradehull Codebase API?

Hi @Krishan_Kant_Sinha

use below code

import pdb
import time
import datetime
import traceback
from Dhan_Tradehull_V2 import Tradehull
import pandas as pd
from pprint import pprint
import talib


client_code = "client_code"
token_id    = "token_id"
tsl = Tradehull(client_code,token_id)



nifty_chart     = tsl.get_historical_data(tradingsymbol = 'BANKNIFTY',exchange = 'INDEX',timeframe="5")
banknifty_chart = tsl.get_historical_data(tradingsymbol = 'NIFTY',exchange = 'INDEX',timeframe="5")


Also do post all your code queries on below link

Sir, how to get data “From date” to “to date”?

Hi @babji3

Can you elaborate the use case for same,
by default, the historical data start data is set to 6 days prior to today.

Sir, i mean to say, I want 5 minutes candle data from 26-11-2024 to till date, like that.

Thanks a Lot Imran Sir