Zerodha Kite Api
How login Zerodha api using C# application?
Hi Friends, recently i have started create application for zerodha api to make my own client for trading.
Many of us have question how to login and trade using our custom C# application. I also face same problem i was looking solution for the same but i was not able to fine exact way of doing it.
I have gone through zerodha api document
According to them we need web view to make us to work this. Please follow be steps to get login token for API.
Steps :
1) Creaet your login URL which is kite login + API key
eg.
var kiteURL="https://kite.trade/connect/login?v=3&api_key="
var apiKey="xpma3rmciorheitb"
2) Add web Browser to you web form set below properties
webBrowser1.AllowNavigation = true;
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.Navigate(new Uri(kiteURL+apiKey));
3) Now you need to register event "webBrowser1_DocumentCompleted"
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string[] list = webBrowser1.Url.ToString().Split("&".ToCharArray());
foreach (string str in list)
{
string[] values = str.Split("=".ToCharArray());
if (values[0].Contains("request_token"))
{
requestToken = values[1];
}
}
}
Now You will be navigated to login page, Login using your User Name and Password if 2FA activate then pin might require.
After successful login you will see request token will be extracted.
if you are doing with console app or asp.net they you may need to add Windows form dll to you solution.
Dll Name: System.Windows.Forms.dll
Note: this is referring to Kite Version 3
Ref:-https://kite.trade/docs/connect/v3/apps/
I will coming with more blogs , Please feel free to email be if you any question sunilbrokerhedge@gmail.com
Thanks,
Happy Trading,
Happy Coding.
This is an excellent initiative.. looking forward many more articles like this.
ReplyDeleteThanku.. thanks a lot
ReplyDeleteNice information ��
ReplyDeleteThanks
ReplyDeleteNice information
ReplyDeleteCan you post this using Python?
ReplyDeleteTook me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! custom lapel pins
ReplyDeleteI think it could be more general if you get a football sports activity Reversirol Review
ReplyDeleteTwo full thumbs up for this magneficent article of yours. I've really enjoyed reading this article today and I think this might be one of the best article that I've read yet. Please, keep this work going on in the same quality. 相親
ReplyDeleteThe King Casino - CommunityKhabar
ReplyDeleteThe King Casino is 바카라 사이트 the only casino near the casino. ventureberg.com/ All casino games goyangfc.com are legal and the game variety is huge! https://shootercasino.com/merit-casino/ The games are also available at any communitykhabar of the
zeerodha best app, loveto using it,for more trading knowledge go to
ReplyDeleteTata Steel Share Price