Package com.github.oscerd.finnhub.client
Class FinnhubClient
java.lang.Object
com.github.oscerd.finnhub.client.FinnhubClient
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFinnhubClient(String token) FinnhubClient(String token, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionGet the Stock Candle object for a date or a range.getCompanyProfile(String symbol) org.apache.hc.client5.http.impl.classic.CloseableHttpClientcom.fasterxml.jackson.databind.ObjectMappergetSymbols(String exchange) getToken()searchSymbol(String query) voidsetHttpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient) voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) void
-
Constructor Details
-
FinnhubClient
public FinnhubClient() -
FinnhubClient
-
FinnhubClient
-
-
Method Details
-
getToken
-
setToken
-
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
- Throws:
IOExceptionorg.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 symbolresolution- 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:
IOExceptionorg.apache.hc.core5.http.ParseException
-
getCompanyProfile
public CompanyProfile getCompanyProfile(String symbol) throws IOException, org.apache.hc.core5.http.ParseException - Throws:
IOExceptionorg.apache.hc.core5.http.ParseException
-
getSymbols
public List<EnrichedSymbol> getSymbols(String exchange) throws IOException, org.apache.hc.core5.http.ParseException - Throws:
IOExceptionorg.apache.hc.core5.http.ParseException
-
searchSymbol
public SymbolLookup searchSymbol(String query) throws IOException, org.apache.hc.core5.http.ParseException - Throws:
IOExceptionorg.apache.hc.core5.http.ParseException
-