Class FinnhubClient


  • public class FinnhubClient
    extends Object
    • Constructor Detail

      • FinnhubClient

        public FinnhubClient()
      • FinnhubClient

        public FinnhubClient​(String token)
      • FinnhubClient

        public FinnhubClient​(String token,
                             com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • Method Detail

      • getToken

        public String getToken()
      • setToken

        public void setToken​(String token)
      • getObjectMapper

        public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      • setObjectMapper

        public void setObjectMapper​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      • getHttpClient

        public org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpClient()
      • setHttpClient

        public void setHttpClient​(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient)
      • getQuote

        public Quote getQuote​(String symbol)
                       throws IOException,
                              org.apache.hc.core5.http.ParseException
        Throws:
        IOException
        org.apache.hc.core5.http.ParseException
      • getCandle

        public Candle getCandle​(String symbol,
                                String resolution,
                                long startEpoch,
                                long endEpoch)
                         throws IOException,
                                org.apache.hc.core5.http.ParseException
        Get the Stock Candle object for a date or a range. Set startEpoch equal to the endEpoch for one day.
        Parameters:
        symbol - Ticker symbol
        resolution - Supported resolution includes 1, 5, 15, 30, 60, D, W, M. Some timeframes might not be available depending on the exchange.
        startEpoch - In seconds, not milliseconds.
        endEpoch - As above.
        Returns:
        JSON object with arrays for the close, low, high, open, volume. status is a String.
        Throws:
        IOException
        org.apache.hc.core5.http.ParseException