All Projects → ISchwarz23 → Amazon-Product-Advertising-API-URL-Builder

ISchwarz23 / Amazon-Product-Advertising-API-URL-Builder

Licence: Apache-2.0 license
Build Amazon Product Advertising API request URLs without having to read the documentation or study the used hashing algorithms.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Amazon-Product-Advertising-API-URL-Builder

ngx-aws-deploy
☁️🚀 Deploy your Angular app to Amazon S3 directly from the Angular CLI 🚀☁️
Stars: ✭ 84 (+211.11%)
Mutual labels:  builder, amazon
FireTVRemote-Node
A web app that can control your Amazon FireTV (Stick). Just startup Node, fill in your device's IP address and use your web browser as a remote. (Enable ADB debugging)
Stars: ✭ 54 (+100%)
Mutual labels:  amazon
damb
An advanced module builder for Dolibarr ERP/CRM
Stars: ✭ 14 (-48.15%)
Mutual labels:  builder
patterns
Good practices to create code in Java, open to other languages. ⚡
Stars: ✭ 14 (-48.15%)
Mutual labels:  builder
flhooks
React like Hooks implementation for Flutter.
Stars: ✭ 38 (+40.74%)
Mutual labels:  builder
Scripts-Sploits
A number of scripts POC's and problems solved as pentests move along.
Stars: ✭ 37 (+37.04%)
Mutual labels:  builder
sphinx-markdown-builder
sphinx builder that outputs markdown files.
Stars: ✭ 135 (+400%)
Mutual labels:  builder
o2d3m
Wavefront OBJ to Doom3 map converter.
Stars: ✭ 15 (-44.44%)
Mutual labels:  builder
Alexa-skills-starters
💻 A collection of super cool Amazon Alexa skills for complete newbies. 💻
Stars: ✭ 24 (-11.11%)
Mutual labels:  amazon
sqs-exporter
A Prometheus Exporter for the Amazon Simple Queue Service (SQS)
Stars: ✭ 24 (-11.11%)
Mutual labels:  amazon
AdvancedSQL
The best Java query builder/SQL connector.
Stars: ✭ 23 (-14.81%)
Mutual labels:  builder
designable
🧩 Make everything designable 🧩
Stars: ✭ 2,156 (+7885.19%)
Mutual labels:  builder
react-json-logic
Build and evaluate JsonLogic with React components
Stars: ✭ 21 (-22.22%)
Mutual labels:  builder
ocibuilder
A tool to build OCI compliant images
Stars: ✭ 63 (+133.33%)
Mutual labels:  builder
flyio
Input Output Files in R from Cloud or Local
Stars: ✭ 46 (+70.37%)
Mutual labels:  amazon
react-native-aws-mobile-analytics
A react-native module for using Amazon's AWS Mobile Analytics with the aws-sdk
Stars: ✭ 16 (-40.74%)
Mutual labels:  amazon
aws-sdk-net-extensions-cognito
An extension library to assist in the Amazon Cognito User Pools authentication process
Stars: ✭ 80 (+196.3%)
Mutual labels:  amazon
docker-geth-lb
MyEtherWallet AWS set up. Deploy public-facing Ethereum nodes using AWS CloudFormation / Docker / Parity / Geth / ethstats
Stars: ✭ 127 (+370.37%)
Mutual labels:  amazon
grapesjs-plugin-forms
Set of form components and blocks for the GrapesJS editor
Stars: ✭ 39 (+44.44%)
Mutual labels:  builder
Discord-AIO
Discord AIO (All In One) - discord stealer/token grabber builder with token checks, webhook spammer, obfuscation, encryption, crypto miner, RAT and a lot of extra features.
Stars: ✭ 105 (+288.89%)
Mutual labels:  builder

Build Status

The Amazon-Product-Advertising-API URL Builder

Simple builder in plain Java to create requests to the Amazon Product Advertising API.

APA-API-Logo
Amazon challenges all developers that want to use their Advertising API. Especially the creation of the request URL is pretty complex. Therefor I've created this URL Builder, which allows you to create the request URL without having to read the Product Advertisement API documentation or study the used hashing algorithms.

Setup

To use this library in your Java or Android project you can download it from jCenter (GroupId: de.codecrafters.apaarb, ArtifactId: apaarb) in the latest version. If you use gradle add jCenter() to your repositories (if not done yet) and specify the dependency.

dependencies {
    ...
    compile 'de.codecrafters.apaarb:apaarb:0.9.1'
    ...
}

This library is written in plain java and does not depend on any other library.

Item Identification

There are multiple types of ID representations handled by Amazon. Namely they are ASIN, ISBN, UPX and EAN. So especially if you want to look up a specific item you have to give its ID.
Theses IDs are represented inside this library by the ItemId class. To create them you simply call the matching create- method.

ItemId myAsin = ItemId.createAsin("AsinValue");
ItemId myEan  = ItemId.createEan("EanValue");
ItemId myIsbn = ItemId.createIsbn("IsbnValue");
ItemId myUpx  = ItemId.createUpx("UpxValue");

After the creation you are able to get the ID value and type from the object.

String value = myId.getValue();
Type type = myId.getType();

The Type is an enumeration inside the ItemId class listing all the available ID types.

Authentication

If you do any request to the Amazon Product Advertising API you have to authenticate yourself. This authentication consists of an "Associate Tag", an "AWS Access Key" and an "AWS Secret Key". In this library they are grouped inside a data class called AmazonWebServiceAuthentication. This class can easily created using the factory method.

AmazonWebServiceAuthentication myAuthentication = AmazonWebServiceAuthentication create("myAssociateTag", "myAwsAccessKey", "myAwsSecretKey");

These user authentication can be used in multiple requests.

Service Location

Amazon distinguishes its services by location (countries). So you will get different responses for different locations (e.g. the currency, the available products, ...). You also have to set up your account for every location. To simplify the selection of the service this library contains an enumeration called AmazonWebServiceLocation, which contains all available service locations.

// America
AmazonWebServiceLocation.COM
// Germany
AmazonWebServiceLocation.DE
// ...

Item Lookup

Basic Request

If you want to lookup specific item information from Amazon you can do so by creating an Request using the AmazonProductAdvertisingApiRequestBuilder. You create a request builder for an item lookup by giving the ItemId of the item to search for. To create the request url you have to give the AmazonWebServiceLocation that shall be requested and the AmazonWebServiceAuthentication that shall be used.

final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemLookup(ITEM_ID)
                .createRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

The result is a request URL as String, that can be used to do the request with your favourite http request library. The result of the createRequestUrlFor() method will create a http link. If you prefer the https protocol in your url, simply call the createSecureRequestUrlFor().

final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemLookup(ITEM_ID)
                .createSecureRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

Specify the included Item Information

You also have the possibility to specify which item information will be returned by the amazon service when calling the request URL. This can be done using the ItemInformation enumeration, which lists all available item information categories. If you don't pass anything the request builder will add information about the item attributes to the request.

// static import was used for ItemInformation
final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemLookup(ITEM_ID)
                .includeInformationAbout(ATTRIBUTES)
                .includeInformationAbout(OFFERS)
                .includeInformationAbout(IMAGES)
                .createRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

Filter the Result

If you want to specify the result set, there is the possibility to do so by filtering the results by the condition of the products. All available conditions are listed inside the ItemCondition enumeration. An example usage is shown below.

// static import was used for ItemInformation and ItemCondition
final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemLookup(ITEM_ID)
                .includeInformationAbout(ATTRIBUTES)
                .includeInformationAbout(OFFERS)
                .includeInformationAbout(IMAGES)
                .filterByCondition(NEW)
                .createRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

Item Search

Basic Request

To do a basic item search request by keywords to Amazon you can do so by creating an Request using the AmazonProductAdvertisingApiRequestBuilder. You create a request builder for an item lookup by giving the keywords that shall be searched for as string (spaces are allowed). To create the request url you have to give the again the AmazonWebServiceLocation that shall be requested and the AmazonWebServiceAuthentication that shall be used.

final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemSearch("Deadpool Movie")
                .createRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

The result is a request URL as String, that can be used to do the request with your favourite http request library. The result of the createRequestUrlFor() method will create a http link. If you prefer the https protocol in your url, simply call the createSecureRequestUrlFor().

final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemLookup(ITEM_ID)
                .createSecureRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

Specify the included Item Information

You also have the possibility to specify which item information will be returned by the amazon service when calling the request URL. This can be done using the ItemInformation enumeration, which lists all available item information categories. If you don't pass anything the request builder will add information about the item attributes to the request.

// static import was used for ItemInformation
final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemSearch("Deadpool Movie")
                .includeInformationAbout(ATTRIBUTES)
                .includeInformationAbout(OFFERS)
                .includeInformationAbout(IMAGES)
                .createRequestUrlFor(AmazonWebServiceLocation.COM, authentication);

Filter the Result

If you want to specify the result set, there is the possibility to do so by filtering the results by the condition, the category, the minimum, as well as the maximum price of the items/products. All available conditions are listed inside the ItemCondition enumeration. The available categories are inside the enumeration called ItemCategory. To filter by minimum and maximum price you have to give an integer representing the price in the smallest currency unit of the given location. An example usage is shown below. This filters can be used separately as well as in combination.

// static import was used for ItemInformation and ItemCondition
final String requestUrl = AmazonProductAdvertisingApiRequestBuilder.forItemLookup(ITEM_ID)
                .includeInformationAbout(ATTRIBUTES)
                .includeInformationAbout(OFFERS)
                .includeInformationAbout(IMAGES)
                .filterByCondition(NEW)
                .filterByCategroy(DVD)
                .filterByMinimumPrice(10000)
                .filterByMaximumPrice(30000)
                .createRequestUrlFor(AmazonWebServiceLocation.COM, authentication);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].