Cron Setup

anilbhatt
Is there compulsory to login? I want to setup a cron to fetch latest quotes will it possible?

Is there any other way to fetch latest quotes of a stock?
  • Vivek
    @anilbhatt Yeah it's necessary to generate access_token to fetch through quotes api.
  • anilbhatt
    @vivek Thanks. Is there any way to setup cron on server to fetch latest quotes?
  • Kailash
    @anilbhatt You can, but when the access_token expires, you have to login again. This is an exchange requirement.
  • anilbhatt
    Okay. But i want to feed my database in every 5 min? That i will do with CURL. if i have to login everytime then it won't be possible for me to do it on unix based server. Is there any solution around in like Websocket in python?

  • Kailash
    @anilbhatt You don't have to login every time, only when the access_token expires (We flush it at 8:15 AM every morning).

    You can use WebSockets to receive ticks every second and compute your own 5-min data point and insert to the DB.
  • anilbhatt
    @Kailash Thanks.

    any sample code for websocket? which i can test?

    also, can you confirm that, websocket will be working on only trading hours?
  • Vivek
    @anilbhatt Please check our official clients for websocket implementation and examples - https://kite.trade/docs/connect/v1/#libraries-and-resources

    Yeah after market you will get day closing price.
  • jimit.ab
    Do you mean that Access token will expire every day at 8:15 in the morning? If so, any other alternative to for long access token?
  • sujith
    Hi @jimit.ab,
    It is mandatory to login everyday as per exchange regulation. You have to manually login everyday.
  • vishnu
    You can automate login using any headless browser. Example mechanize for python.
This discussion has been closed.