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.http.impl.client.CloseableHttpClient getHttpClient()
      • setHttpClient

        public void setHttpClient​(org.apache.http.impl.client.CloseableHttpClient httpClient)
      • getQuote

        public Quote getQuote​(String symbol)
                       throws org.apache.http.client.ClientProtocolException,
                              IOException
        Throws:
        org.apache.http.client.ClientProtocolException
        IOException
      • getCandle

        public Candle getCandle​(String symbol,
                                String resolution,
                                long startEpoch,
                                long endEpoch)
                         throws IOException
        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
      • getCompanyProfile

        public CompanyProfile getCompanyProfile​(String symbol)
                                         throws org.apache.http.client.ClientProtocolException,
                                                IOException
        Throws:
        org.apache.http.client.ClientProtocolException
        IOException
      • searchSymbol

        public SymbolLookup searchSymbol​(String query)
                                  throws org.apache.http.client.ClientProtocolException,
                                         IOException
        Throws:
        org.apache.http.client.ClientProtocolException
        IOException