Skip to content

Latest commit

History

137 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Keepa API Framework

This framework is intended for users of the Keepa API.

Features

  • Retrieves content from the API asynchronously and in parallel via Deferred callbacks (Java 8 Lambda friendly)
  • Parses API response to easy to use Java objects
  • Provides methods that facilitate the work with price history data

Maven

<repositories>
<repository>
<id>Keepa</id>
<name>Keepa Repository</name>
<url>https://keepa.com/maven/</url>
</repository>
...
</repositories>
<dependencies>
<dependency>
<groupId>com.keepa.api</groupId>
<artifactId>backend</artifactId>
<version>LATEST</version>
</dependency>
...
</dependencies>

Gradle

repositories {
...
maven { url 'https://keepa.com/maven/' }
}
dependencies {
...
compile 'com.keepa.api:backend:latest.release'
}
Also consider to add
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 0, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
Which makes sure that the newest version from our servers is pulled during build.

Quick Example

Make an API request

KeepaAPIapi = newKeepaAPI("YOUR_API_KEY"); // the KeepaAPI object is reuseableRequestr = Request.getProductRequest(AmazonLocale.US, 90, null, "B001GZ6QEC");
api.sendRequest(r)
.done(result -> {
switch (result.status) {
caseOK:
// iterate over received product informationfor (Productproduct : result.products){
// System.out.println(product);if (product.productType == Product.ProductType.STANDARD.code || product.productType == Product.ProductType.DOWNLOADABLE.code) {
//get basic data of product and print to stdoutintcurrentAmazonPrice = ProductAnalyzer.getLast(product.csv[Product.CsvType.AMAZON.index], Product.CsvType.AMAZON);
//check if the product is in stock -1 -> out of stockif (currentAmazonPrice == -1) {
System.out.println(product.asin + " " + product.title + " is currently out of stock!");
} else {
System.out.println(product.asin + " " + product.title + " Current Amazon Price: " + currentAmazonPrice);
}
// get weighted mean of the last 90 days for AmazonintweightedMean90days = ProductAnalyzer.calcWeightedMean(product.csv[Product.CsvType.AMAZON.index], KeepaTime.nowMinutes(), 90, Product.CsvType.AMAZON);
...
} else {
...
}
}
break;
default:
System.out.println(result);
}
})
.fail(failure -> System.out.println(failure));

About

Keepa.com API Java Framework

Resources

Stars

84 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages