Amazon Product Page API
Scrape Amazon product pages into clean JSON/CSV with ScraperAPI’s structured endpoint in Java. Extract prices, reviews, variants, and metadata by ASIN.
This endpoint will retrieve product data from an Amazon product page and transform it into usable JSON or CSV. It also provides links to all variants of the product (if any).
try {
String apiKey = "APIKEY";
String asin = "ASIN";
String country = "COUNTRY";
String tld = "TLD";
String url = "https://api.scraperapi.com/structured/amazon/product?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();
}API_KEY (requried)
User's normal API Key
ASIN (requried)
Amazon product ASIN
TLD
Amazon market to be scraped.
Valid values include:
com (amazon.com)
co.uk (amazon.co.uk)
ca (amazon.ca)
de (amazon.de)
es (amazon.es)
fr (amazon.fr)
it (amazon.it)
co.jp (amazon.co.jp)
in (amazon.in)
cn (amazon.cn)
com.sg (amazon.com.sg)
com.mx (amazon.com.mx)
ae (amazon.ae)
com.br (amazon.com.br)
nl (amazon.nl)
com.au (amazon.com.au)
com.tr (amazon.com.tr)
sa (amazon.sa)
se (amazon.se)
pl (amazon.pl)
COUNTRY
Valid values are two letter country codes for which we offer Geo Targeting (e.g. “au”, “es”, “it”, etc.).
Where an amazon domain needs to be scraped from another country (e.g. scraping amazon.com from Canada to get Canadian shipping information), both TLD and COUNTRY parameters must be specified.
OUTPUT_FORMAT
For structured data methods we offer CSV and JSON output. JSON is default if parameter is not added. Options:
csv
json
ZIP Code Targeting
To find out mote about ZIP Code targeting, please follow this link
Sample Response:
Last updated
Was this helpful?

