finnhubio / Finnhub-API

Finnhub API provides institutional-grade financial data to investors, fintech startups and investment firms. We support real-time stock price, global fundamentals and alternative data. https://finnhub.io/docs/api
98 stars 6 forks source link

Websocket limit #137

Closed hypo-thesis closed 4 years ago

hypo-thesis commented 4 years ago

I am given to understand that 60 api calls a min can be made.

  1. Is it the same for websocket queries too ?
  2. How to limit websocket queries to that many a minute ?
finnhubio commented 4 years ago

what do you mean by "websocket queries" ?

hypo-thesis commented 4 years ago

const socket = new WebSocket('wss://ws.finnhub.io?token=mytoken'); has started my websocket. I am receiving many multiples query from socket.addEventListener('message', function (event) The responses seem to be way beyond 60 a minute.

finnhubio commented 4 years ago

Ah I see. we do not limit the number of messages you receive through websocket so don't worry about it.

hypo-thesis commented 4 years ago

Websocket is idle when there is no price change so at the point of making the connection it may receive no data for a while. Is there any way I can get the last price regardless of the changes through your API ?

finnhubio commented 4 years ago

You can checkout the Quote endpoint for that: https://finnhub.io/docs/api#quote