Package com.github.oscerd.finnhub.client
Class FinnhubClient
- java.lang.Object
-
- com.github.oscerd.finnhub.client.FinnhubClient
-
public class FinnhubClient extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFinnhubClient.Builder
-
Constructor Summary
Constructors Constructor Description FinnhubClient()FinnhubClient(String token)FinnhubClient(String token, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CandlegetCandle(String symbol, String resolution, long startEpoch, long endEpoch)Get the Stock Candle object for a date or a range.CompanyProfilegetCompanyProfile(String symbol)org.apache.hc.client5.http.impl.classic.CloseableHttpClientgetHttpClient()com.fasterxml.jackson.databind.ObjectMappergetObjectMapper()QuotegetQuote(String symbol)List<EnrichedSymbol>getSymbols(String exchange)StringgetToken()SymbolLookupsearchSymbol(String query)voidsetHttpClient(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient)voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)voidsetToken(String token)
-
-
-
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:
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
-
-