Amazon Offers API
This endpoint will retrieve offers for a specified product from an Amazon offers page and transform it into usable JSON or CSV.
try {
String apiKey = "APIKEY";
String asin = "ASIN";
String country = "COUNTRY";
String tld = "TLD";
String url = "https://api.scraperapi.com/structured/amazon/offers?api_key=" + apiKey + "&asin=" + ASIN + "&country=" + country + "&tld=" + tld;
URL urlForGetRequest = new URL(url);
String readLine = null;
HttpURLConnection conection = (HttpURLConnection) urlForGetRequest.openConnection();
conection.setRequestMethod("GET");
int responseCode = conection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(conection.getInputStream()));
StringBuffer response = new StringBuffer();
while ((readLine = in.readLine()) != null) {
response.append(readLine);
}
in.close();
System.out.println(response.toString());
} else {
throw new Exception("Error in API Call");
}
} catch (Exception ex) {
ex.printStackTrace();
}
Sample Response
{
"item": {
"name": "Razer Blade 15 Gaming Laptop 2019: Intel Core i7-9750H 6 Core, NVIDIA GeForce RTX 2060, 15.6\" FHD 1080p 144Hz, 16GB RAM, 512GB SSD, CNC Aluminum, Chroma RGB Lighting, Thunderbolt 3",
"subtitle": "",
"author": "",
"brand": "Razer",
"product_information": {
"brand": "Razer",
"series": "Blade 15",
"screen_size": "15.6 Inches",
"color": "Classic Black",
"hard_disk_size": "512 GB",
"cpu_model": "Core i7 Family",
"ram_memory_installed_size": "16 GB",
"operating_system": "Windows 10",
"card_description": "Dedicated",
"graphics_coprocessor": "NVIDIA GeForce RTX 2060"
},
"listings_link": "https://www.amazon.com/gp/aod/ajax/ref=tmm_pap_used_aod_0?filters=%257B%2522all%2522%253Atrue%252C%2522usedLikeNew%2522%253Atrue%252C%2522usedVeryGood%2522%253Atrue%252C%2522usedGood%2522%253Atrue%257D&condition=used&asin=B07R1P4DQG&pc=dp;",
"image": "",
"average_rating": 4.4,
"total_reviews": 697
},
"listings": [
{
"price_with_currency": "",
"price": null,
"shipping_price": null,
"has_prime_shipping": false,
"ships_from": "Amazon.com",
"sold_by": "Amazon.com",
"fullfilled_by_amazon": false
}
],
"pagination": []
}
Last updated