Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kevinsawicki/stock-quotes

Java library for the Google Finance Historical Prices API
https://github.com/kevinsawicki/stock-quotes

Last synced: 26 days ago
JSON representation

Java library for the Google Finance Historical Prices API

Awesome Lists containing this project

README

        

# Stock Quotes [![Build Status](https://travis-ci.org/kevinsawicki/stock-quotes.png)](https://travis-ci.org/kevinsawicki/stock-quotes)

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

The stock-quotes library is available from [Maven Central](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.kevinsawicki%22%20AND%20a%3A%22stock-quotes%22).

```xml

com.github.kevinsawicki
stock-quotes
1.3

```

## Dependencies

* [kevinsawicki/http-request](http://github.com/kevinsawicki/http-request)

## 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.

```java
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());
```