A Java implementation of the CryptoCompare API service.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'me.joshmcfarlin:CryptoCompareAPI:master-SNAPSHOT'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>me.joshmcfarlin</groupId>
<artifactId>CryptoCompareAPI</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
public class Test {
private CryptoCompareAPI api = new CryptoCompareAPI();
public static void main(String[] args) {
double dayAverage = api.historic.getDayAverage("BTC", "USD");
System.out.println("Bitcoin day average:");
System.out.println(dayAverage);
Market.ExchangeAverage exchangeAverage = api.market.getExchangeAverage("BTC", "USD", "Coinbase,Kraken,Bitstamp");
System.out.println("Bitcoin average from Coinbase, Kraken, and Bitstamp:");
System.out.println(exchangeAverage.getHigh24Hour());
Map<String, Double> btcPrice = api.market.getPrice("BTC", "USD,EUR");
System.out.println("Bitcoin price in USD and EUR:");
System.out.println(btcPrice);
}
}
An example is provided in the test sources.
Documentation is provided at https://joshmcfarlin.me/CryptoCompareAPI/
This project is developed under the MIT license. This can be found at LICENSE.