Jump to content

Zerodha Web Socket API


john1992

Recommended Posts

Hi, guys

 

Has anyone tried the free web socket of Zerodha Kite API?

I have got an open source program to access Web Kite API without any cost. Here is the link -

 

https://github.com/instruritesh/ZStreamingQuote

 

Is there anyone who can help to make the program useful to integrate it with NT or Amibroker!

 

Your efforts will be highly appreciated.

 

Thank you.

Link to comment
Share on other sites

Hi, guys

 

Has anyone tried the free web socket of Zerodha Kite API?

I have got an open source program to access Web Kite API without any cost. Here is the link -

 

https://github.com/instruritesh/ZStreamingQuote

 

Is there anyone who can help to make the program useful to integrate it with NT or Amibroker!

 

Your efforts will be highly appreciated.

 

Thank you.

 

 

The software is free but still you have to subscribe to the kite.trade services. Rs 2000 per month for real time data and Rs 2000 for historical data. When you subscribe they give api key and access token. This software requires that api key and access token. Zerodha itself gives sdk for different languages like c#, go, rust, java, python etc. https://github.com/zerodhatech. Everything is open source

Link to comment
Share on other sites

Hi John1992,

 

Hi, guys

 

Has anyone tried the free web socket of Zerodha Kite API?

I have got an open source program to access Web Kite API without any cost. Here is the link -

 

https://github.com/instruritesh/ZStreamingQuote

 

Is there anyone who can help to make the program useful to integrate it with NT or Amibroker!

 

Your efforts will be highly appreciated.

 

Thank you.

 

You can use windows ole to connect to amibroker. I've been using python to import data into amibroker using Windows OLE. If you need help with anything specific then do let me know.

 

--

Regards,

Ike

Link to comment
Share on other sites

Can you please share the python script?

 

If you don't mind can you share the exact point on which you need more information. My python script is super nested. Pasting the short snippet for your reference.

 

import win32com.client
import pythoncom

class charting(object):
   def __init__(self, import_q, num_threads=1, db=None, auto_import=False):
       self.import_q = import_q
       self.num_threads = num_threads
       self.db = db
       self.auto_import = auto_import
       self.t_list = []

   def enqueue(self, f):
       if self.auto_import:
           self.import_q.put(f)

   def import_i(self, f):
   	pass

   def import_h(self, f):
   	pass

   def do_save(self):
       pass

class charting_ab(charting):
   def __init__(self, import_q, num_threads=1, db=None, auto_import=False):
       super(charting_ab, self).__init__(import_q, num_threads, db, auto_import)
       for cnt in xrange(0, self.num_threads):
    t = threading.Thread(target=self.entry, args=(self.import_q, self.db, self.auto_import))
    t.daemon = True
    self.t_list.append(t)
           t.start()

   def entry(self, import_q, db, auto_import):
       pythoncom.CoInitialize()

       ab_obj = win32com.client.Dispatch("Broker.Application")

       if db is not None:
   	    ab_obj.LoadDatabase(db)

   	while (True):
   	    f = import_q.get()
           print "Importing: " + os.path.basename(f)
           ab_obj.Import(0, f.replace('\\', r'\\'), "aqi.format")
           import_q.task_done()

       ab_obj.RefreshAll()
       ab_obj.SaveDatabase()

   def import_i(self):
       if self.auto_import:
           while not self.import_q.empty():
               f = self.import_q.get()
               print "Importing " + f.replace('\\', r'`\\')
               self.ab_obj.Import(0, f.replace('\\', r'\\'), "aqi.format")
               self.import_q.task_done()

   def do_save(self):
       if self.auto_import:
           self.ab_obj.RefreshAll()
           self.ab_obj.SaveDatabase()

 

Please note this is not the entire code but surely contains part which you would like to use to interact with amibroker.

 

Hope this helps.

Link to comment
Share on other sites

If you don't mind can you share the exact point on which you need more information. My python script is super nested. Pasting the short snippet for your reference.

 

import win32com.client
import pythoncom

class charting(object):
   def __init__(self, import_q, num_threads=1, db=None, auto_import=False):
       self.import_q = import_q
       self.num_threads = num_threads
       self.db = db
       self.auto_import = auto_import
       self.t_list = []

   def enqueue(self, f):
       if self.auto_import:
           self.import_q.put(f)

   def import_i(self, f):
   	pass

   def import_h(self, f):
   	pass

   def do_save(self):
       pass

class charting_ab(charting):
   def __init__(self, import_q, num_threads=1, db=None, auto_import=False):
       super(charting_ab, self).__init__(import_q, num_threads, db, auto_import)
       for cnt in xrange(0, self.num_threads):
    t = threading.Thread(target=self.entry, args=(self.import_q, self.db, self.auto_import))
    t.daemon = True
    self.t_list.append(t)
           t.start()

   def entry(self, import_q, db, auto_import):
       pythoncom.CoInitialize()

       ab_obj = win32com.client.Dispatch("Broker.Application")

       if db is not None:
   	    ab_obj.LoadDatabase(db)

   	while (True):
   	    f = import_q.get()
           print "Importing: " + os.path.basename(f)
           ab_obj.Import(0, f.replace('\\', r'\\'), "aqi.format")
           import_q.task_done()

       ab_obj.RefreshAll()
       ab_obj.SaveDatabase()

   def import_i(self):
       if self.auto_import:
           while not self.import_q.empty():
               f = self.import_q.get()
               print "Importing " + f.replace('\\', r'`\\')
               self.ab_obj.Import(0, f.replace('\\', r'\\'), "aqi.format")
               self.import_q.task_done()

   def do_save(self):
       if self.auto_import:
           self.ab_obj.RefreshAll()
           self.ab_obj.SaveDatabase()

 

Please note this is not the entire code but surely contains part which you would like to use to interact with amibroker.

 

Hope this helps.

 

I really appreciate your efforts to make the python program. As I'm not a programer so, I don't know what to do with the code. I use a simple DDE connection for the data feeding in my Amibroker from Zerodha Kite. But has many limitation thats why I'm looking for some alternatives. But don't get anything. Anyway hope your code might help some people in this forum.

 

Thank you

Link to comment
Share on other sites

scorpio without getting api key we can do i guess. sometime i posted some codes of that product and its in java code. its using cookies of browser to get key. since am not a coder i lost interest.

 

there is group of people from cz tried develope open source code to pull realtime data from websockets . it was banned in github because all exchanges will loose business if all started that code . but a person from stock developer .com developed the data streaming using those as base.

 

the reason people always interested is broker supplied data is very accurate and fast then vendor supplied realtime data when it comes to tick.

Link to comment
Share on other sites

Hi,

 

@john1992, The code I've posted is partial code. I pasted the parts which are specific to importing data into Amibroker. This code will not work on a standalone basis. The parts to be noted are the ones where win32com calls are made to interact with Amibroker instance.

 

@mike83, Yeah this code is a part of the script I used to use to create an offline copy of the data for future use.

 

If someone is having ideas to implement and need some help don't hesitate to ping me.

 

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
I had used a web-based application named AutoTrader(hxxp://st*cksdev*loper.com/autotrader/) for amibroker & Zerodha Kite. This specific application is actually connected Kite web socket with Amibroker. But it was only for trial. I tried to reset the trial but not able to. Though figure out that the application actually determine the first install date & based on that the trial version is detected, so there is no web based verification. As the application is based on java & I don't know the language so its difficult for me to breakthrough.
Link to comment
Share on other sites

I had used a web-based application named AutoTrader(hxxp://st*cksdev*loper.com/autotrader/) for amibroker & Zerodha Kite. This specific application is actually connected Kite web socket with Amibroker. But it was only for trial. I tried to reset the trial but not able to. Though figure out that the application actually determine the first install date & based on that the trial version is detected, so there is no web based verification. As the application is based on java & I don't know the language so its difficult for me to breakthrough.

 

dear sir

 

you really connect with auto trader & kite api?

because auto trader can connect with zerodha nest/kite platform not with kite api

Link to comment
Share on other sites

  • 1 month later...

have u tried to pull tick data? most exchanges broadcast data directly to broker terminal using RTD server concept . so am not sure whether its pure tick or snapshot of ticks. since i dont trade in indian markets i can't tell but i came across this product long back. that developer cloned the code git hub which was banned due to licence conflicts.

 

most data vendors will be out of business if that software is copied and made public and exchanges too will loose money.

 

try using the VM and someother mechanism to reset trials since its uing machine id and adapter address.

 

the people who crack java apps can help you.

Link to comment
Share on other sites

  • 3 weeks later...
john u have got solution for (hxxp://st*cksdev*loper.com/autotrader/)

 

Applying a simple logic only allow to use the interface but RTD/Backfill is not working. Maybe one Java programmer may help to bypass it.

 

Download the following class file "hxxps://www.sendspace.com/file/u805xp" & replace it inside the *.war file in the follwing path - (open the war file with 7zip)

 

"C:\axxotxraxxr\tomcat\webapps\ROOT.war\WEB-INF\classes\com\pexsxeus\alxotrxdxr\

 

*make sure to delete the existing ROOT folder of the same path.

Edited by john1992
Link to comment
Share on other sites

  • 4 weeks later...
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...