com.tecacet.finance.service.stock.yahoo.YahooSplitService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfapi Show documentation
Show all versions of jfapi Show documentation
JFApi connects to various Web Services that provide financial data such as stock prices,
splits, dividends, and FX rates.
package com.tecacet.finance.service.stock.yahoo;
import com.tecacet.finance.model.Split;
import com.tecacet.finance.model.StandardPeriodType;
import com.tecacet.finance.service.stock.SplitService;
import com.tecacet.finance.service.stock.StockServiceException;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
public class YahooSplitService extends AbstractYahooService implements SplitService {
private YahooSplitParser parser = new YahooSplitParser();
@Override
public List getSplitHistory(String symbol, LocalDate fromDate, LocalDate toDate) throws StockServiceException {
try {
Map params = getRequestParams(fromDate, toDate, StandardPeriodType.DAY);
params.put("events", "split");
InputStream is = getUrlStream(symbol, params);
return parser.parse(is);
} catch (Exception e) {
throw new StockServiceException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy