Retrieving the full instrument list

vipinvijayano
I need to retrieve the instrument list api. I have the access token, but I am getting response as method not found. I only subscribed to Kite Connect subscription. I have not subscribed to historical data subscription.

$request_headers = ["Content-type: application/x-www-form-urlencoded",
"Accept-Encoding: gzip, deflate",
"Accept-Charset: UTF-8,*;q=0.5",
"X-Kite-Version: 3",
"Authorization: token api_key: xxx",

];

// $params = [

// "api_key" => 'R044DOKIoLMNGFgM7OnuhYIGJLxEMg4a',

// ];
// $request_headers[] = "Authorization: token " . $this->api_key . ":" . $this->access_token;


$resp = curlexec('https://api.kite.trade/instruments/historical/5633/minute?from=2015-12-28+09:30:00&to=2016-01-01+10:30:00', 'POST', $request_headers, $params);
print_r($resp);


I am getting the following response.

Array ( [headers] => Array ( [date] => Sat, 11 Jan 2020 04:42:29 GMT [content-type] => application/json [content-length] => 101 [connection] => keep-alive [set-cookie] => __cfduid=d6978999153318efa0eab7723062592461578717749; expires=Mon, 10-Feb-20 04:42:29 GMT; path=/; domain=.kite.trade; HttpOnly; SameSite=Lax [allow] => GET, OPTIONS [cf-cache-status] => DYNAMIC [strict-transport-security] => max-age=15552000; includeSubDomains [expect-ct] => max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" [server] => cloudflare [cf-ray] => 5534396c98f9d5af-BOM [status_code] => 405 ) [body] => {"status":"error","message":"Request method not allowed","data":null,"error_type":"GeneralException"} )
  • sujith
    sujith edited January 2020
    You need an active Kite Connect app to use the Kite Connect APIs.
    You seem to have only a Kite Publisher app.
    You will need an add-on subscription to use historical data as well.
  • sujith
    You need to use the instrument token for retrieving data and not the exchange token.
Sign In or Register to comment.