Instruments symbol traded on Zerodha

Sowmay
Sowmay edited December 2016 in API clients
Where can I get all the overall instruments symbol list traded on Zerodha with their respective exchanges, order types etc?
  • sujith
    Hi @Sowmay,
    You can just call getInstruments().
    If you are using javakiteconnect, checkout examples https://github.com/rainmattertech/javakiteconnect/blob/master/sample/src/Examples.java
  • Sowmay
    I need the whole list in Google Spreadsheet. Is there any link to any webpage from where I can import data using importdata(link) function in excel/spreadsheet.

    Actually, I had integrated Zerodha button on a dynamic web page which is redirected from the spreadsheets. I'm not a pro in coding.
  • Vivek
    @Sowmay You can get instruments in csv format from here - https://api.kite.trade/instruments
  • Sowmay
    Sowmay edited December 2016
    The spreadsheet is showing "could not fetch URL". Maybe because of extreme data as it shows: "Resource at url contents exceeded maximum size."

    Is there any downloadable excel file. Later I'll convert that excel file into Google spreadsheet.
  • sujith
    If you click this link https://api.kite.trade/instruments you get it as csv file just open it in excel.
  • Sowmay
    Yes, a file is downloaded but in an unknown format, not in CSV format.
  • Matti
    Matti edited December 2016
    @Sowmay Open the file with a plain text reader or Excel. Should work just fine.
  • botany02
    botany02 edited December 2016
    @Sowmay

    Add .csv extension to the downloaded file.

    Or

    Just use the below VBA to download.
    This will download the instruments.csv file in Documents Folder or Desktop.

    Sub DownloadInstruments()
    On Error GoTo ErrHandler:
    Dim dUrl As String
    dUrl = "https://api.kite.trade/instruments"

    Dim WinHttpReq As Object
    Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
    WinHttpReq.Open "GET", dUrl, False
    WinHttpReq.send

    dUrl = WinHttpReq.responseBody
    If WinHttpReq.Status = 200 Then
    Set oStream = CreateObject("ADODB.Stream")
    oStream.Open
    oStream.Type = 1
    oStream.Write WinHttpReq.responseBody
    oStream.SaveToFile "instruments.csv", 2 ' 1 = no overwrite, 2 = overwrite
    oStream.Close
    MsgBox "File Downloaded", vbInformation, "Kite"
    Else
    MsgBox "File NOT Downloaded", vbInformation, "Kite"
    End If
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbInformation, "Kite"
    Exit Sub
    End Sub
  • Sowmay
    Thanks @botany02 its worked.
This discussion has been closed.