Hi @greybit, The request token is valid for a couple of minutes and it can be used only once whereas access token is valid for one whole day. Once you get access token make sure you store it in app preference and re-use it. Don't make requestAccessToken call everytime you run the App. Please check out webinar for log in process.
Using python as per webminar it works well and i can connect.
using the same credentials [Hard coding from python values]in java it connects..
But using the plain java code it is not working.
// Set request token and public token which are obtained from login process. // UserModel userModel = kiteconnect.requestAccessToken("request_token", "your_apiSecret"); // UserModel userModel = kiteconnect.requestAccessToken("nf8hu24fioh7fr0xxxxxxxxxxxxxxxxx","yda78c7hascf1xr6xxxxxxxxxxxx");
now able to login.. but still its a manual process to get the access token.. please add the code in the test project.. and more over i am not able to get historical data..
Hi @greybit, It is mandatory by the exchange that a user has to log in manually at least once a day. I am afraid we can't help you with that.
As of now, javakiteconnect library contains library module, distribution jar and example files for reference. We will upload project from next version of javakiteconnect.
Historical API is an add-on subscription, it is not included in the base subscription. You can go to developers console and subscribe for the same.
@greybit, javakiteconnect is an exact replica of pykiteconnect, all the functions available in python client is available in java client also. You can fetch access token using requestAccessToken method.
1. can i get the intraday 5 mins candles data using tickers? 2. In example " tokens.add(53287175);" what that 53287175 means? 3. Do i need to buy the API and historical data for each app? or its based on one zerodha id and can be used for multiple apps?
1. can i get the intraday 5 mins candles data using tickers?
5min candles are built using live market data. You can build 5min candles by storing tick data.
2. In example " tokens.add(53287175);" what that 53287175 means?
You need to send instrument token while subscribing for ticker. You can get instrument token from instrument dump. Check out details about instrument dump here. In this dump, you will get the list of all the instruments that are being traded for the day.
3. Do i need to buy the API and historical data for each app? or its based on one zerodha id and can be used for multiple apps?
Each Kite Connect App is by default single user App. You can subscribe to only Kite Connect and use it. If you want to use it with multiple client ids then you need to create multiple apps.
KiteConnect is purely an execution platform. We don't provide strategies. One of our community members has created this repo. You can check that out for reference.
Please share me the data structure format in which i will get the response from historic API. or Please share me any doc which explain about historic API output.
As per code and example i can able to see only for single script.
1. do i need to call the historic api for each script to get data? 2. or do i hv option to give the list of scripts and request for data in one call? if yes, please share more info.
The request token is valid for a couple of minutes and it can be used only once whereas access token is valid for one whole day. Once you get access token make sure you store it in app preference and re-use it.
Don't make
requestAccessToken
call everytime you run the App.Please check out webinar for log in process.
Can you let us know the errors?
Using python as per webminar it works well and i can connect.
using the same credentials [Hard coding from python values]in java it connects..
But using the plain java code it is not working.
// Set request token and public token which are obtained from login process.
// UserModel userModel = kiteconnect.requestAccessToken("request_token", "your_apiSecret");
// UserModel userModel = kiteconnect.requestAccessToken("nf8hu24fioh7fr0xxxxxxxxxxxxxxxxx","yda78c7hascf1xr6xxxxxxxxxxxx");
// kiteconnect.setAccessToken(userModel.accessToken);
// kiteconnect.setPublicToken(userModel.publicToken);
kiteconnect.setAccessToken("q893l7gwacp520pixxxxxxxxxxxxxxxx");
kiteconnect.setPublicToken("51ed7daf3ac84d7axxxxxxxxxxxxxxxxx");
It is mandatory by the exchange that a user has to log in manually at least once a day. I am afraid we can't help you with that.
As of now, javakiteconnect library contains library module, distribution jar and example files for reference. We will upload project from next version of javakiteconnect.
Historical API is an add-on subscription, it is not included in the base subscription. You can go to developers console and subscribe for the same.
Thanks for your response!!!
now i am using Python to get a "Access token" using the "request token" and manually pasting in the java code for login..
is there any other way to get the "Access token " without using python??
javakiteconnect is an exact replica of pykiteconnect, all the functions available in python client is available in java client also.
You can fetch access token using requestAccessToken method.
I have few more quires,
1. can i get the intraday 5 mins candles data using tickers?
2. In example " tokens.add(53287175);" what that 53287175 means?
3. Do i need to buy the API and historical data for each app? or its based on one zerodha id and can be used for multiple apps?
If you want to use it with multiple client ids then you need to create multiple apps.
To implement my logic i need SMA and DATR. please let me know if you have any predefined API for the same. or a code to get these values.
KiteConnect is purely an execution platform. We don't provide strategies. One of our community members has created this repo. You can check that out for reference.
Please share me the data structure format in which i will get the response from historic API. or Please share me any doc which explain about historic API output.
As per code and example i can able to see only for single script.
1. do i need to call the historic api for each script to get data?
2. or do i hv option to give the list of scripts and request for data in one call? if yes, please share more info.
Check out documentation. You need to make a request for each scrip to get data.