Json Data

jayanta
I want to get all instruments as a jnon data not csv file. if it is possible then tell me how?
  • Kailash
    If you use the Kite Connect Python or PHP client libraries, the instruments() call returns an array of objects which you can just encode to JSON. Otherwise, you'll have to parse the CSV and encode it to JSON yourself in whatever language you're using.
  • jayanta
    I have use Kite Connect PHP client libraries but given error like this
    Request: https://api.kite.trade/session/token array(3) { ["request_token"]=> NULL ["checksum"]=> string(64) "77124d6443b6c0cfbcd6172e911ad09142ce7a493960f2dba456903edb2d5dfc" ["api_key"]=> string(16) "nq1qwhadd7o4pk24" } Response :{"status": "error", "message": "Missing request_token", "error_type": "InputException"} Authentication failed: Missing request_token
  • Kailash
    The error is Authentication failed: Missing request_token

    And the parameter you are sending ["request_token"]=> NULL

    Clearly, the error is because you are not sending the request_token that you'd receive after the login flow.
  • jayanta
    I want to get all instruments as a jnon data using curl how?
  • Kailash
    You cannot. It's a CSV API. You have to parse it into JSON yourself.
  • anilbhatt
    Is there compulsory to login? I want to setup a cron to fetch latest quotes will it possible?
  • Vivek
    @anilbhatt please don't post duplicate posts or comments. Your question is answered here - https://kite.trade/forum/discussion/503/cron-setup#latest
  • Johnpawal
    I found this script useful http://www.kodingmadesimple.com/2016/04/convert-csv-to-json-using-php.html
    It easily converts csv data to json. Also uses the column headers as keys for json.
Sign In or Register to comment.