stock-quotes

Java library for the Google Finance Historical Prices API

Stock Quotes Build Status

Library for accessing historical stock prices using the Google Finance API.

The stock-quotes library is available from Maven Central.

<dependency>
  <groupId>com.github.kevinsawicki</groupId>
  <artifactId>stock-quotes</artifactId>
  <version>1.3</version>
</dependency>

Dependencies

Usage

Get the closing prices for the current year

The following example requests the prices of the stock symbol tr for the current year and prints out the closing price for each day.

StockQuoteRequest request = new StockQuoteRequest();
request.setSymbol("tr");
request.setStartDate(DateUtils.yearStart());
request.setEndDate(DateUtils.yearEnd());

while(request.next())
  System.out.println(request.getDate() + ": " + request.getClose());