Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevcodez/amazon-stock
Kotlin library to retrieve the current stock from an amazon article using Product Advertising API.
https://github.com/kevcodez/amazon-stock
amazon dokka gradle java junit5 kotlin maven-central product-advertising-api stock
Last synced: 5 days ago
JSON representation
Kotlin library to retrieve the current stock from an amazon article using Product Advertising API.
- Host: GitHub
- URL: https://github.com/kevcodez/amazon-stock
- Owner: kevcodez
- License: mit
- Created: 2018-07-05T16:57:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-07T23:09:17.000Z (over 6 years ago)
- Last Synced: 2024-11-08T18:12:41.791Z (about 2 months ago)
- Topics: amazon, dokka, gradle, java, junit5, kotlin, maven-central, product-advertising-api, stock
- Language: Kotlin
- Homepage:
- Size: 62.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Amazon Stock
This library allows retrieving the current stock from an amazon offer.
![Maven metadata URI](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/de/kevcodez/amazon/stock/maven-metadata.xml.svg) [![Build Status](https://travis-ci.org/kevcodez/amazon-stock.svg?branch=master)](https://travis-ci.org/kevcodez/amazon-stock) [![GitHub license](https://img.shields.io/github/license/kevcodez/amazon-stock.svg)](https://github.com/kevcodez/amazon-stock/blob/master/LICENSE)
## Getting started
## Maven
```xmlde.kevcodez.amazon
stock
0.1.0```
## Gradle
```groovy
compile "de.kevcodez.amazon:stock:0.1.0"
```### Example
```kotlin
val stockService = StockService(
AmazonConfig(
endpoint = "webservices.amazon.de",
accessKeyId = "xxx",
secretKey = "yyy",
associateTag = ""
)
)val stock = stockservice.getStockInformation(listOf("B01BPJK4S2"))
println(stock)
```> [StockInformation(price=12.9, stock=9, asin=B01BPJK4S2)]
## How does it work?
To retrieve the stock, an API call to the [Product Advertising API](https://docs.aws.amazon.com/AWSECommerceService/latest/DG/Welcome.html) is done.
By entering an usually high amount of 999 as requested stock during a CartCreate-Call, the available stock is returned.## Getting API access
Go to [Sign up for the Product Advertising API](https://docs.aws.amazon.com/AWSECommerceService/latest/DG/becomingDev.html) and get your access token/secret key.