Hello Team,
I am facing issue in getting the Historical Candle Data API for Nifty and Banknifty instrument key
- BankNifty:
NSE_INDEX|Nifty Bank
- Nifty50:
NSE_INDEX|Nifty 50
My curl request is
$interval = ‘1minute’;
$url3 = ‘https://api.upstox.com/v2/historical-candle/’ . $instrumentKey . ‘/’ . $interval . ‘/’ . $todaysDate .‘/’. $fromDate;
curl_setopt_array(
$curl3,
array(
CURLOPT_URL => $url3,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => ‘’,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => ‘GET’,
CURLOPT_HTTPHEADER => array(
‘Accept: application/json’,
'Authorization: Bearer ’ . $bearerToken // Add bearer token to headers
),
)
);
when executing the $response3 = curl_exec($curl3);
I am getting response as False & null.
When i integrated this at first time then it was working properly at my Local(localhist) and Development server(https://tradercircuit.betadelivery.com/)
Now i have uploaded the code on another server (https://staging.traderscircuit.com/)there its not working ,
its only working on tradercircuit.betadelivery.com/, not on local and the new server.
Please Assist on this.
Thanks,
Hritik