Walmart Product API
Scrape Walmart product details into structured JSON/CSV with ScraperAPI in Java. Extract price, specs, reviews, and availability data easily.
This endpoint will retrieve Walmart product details.
try {
String apiKey = "APIKEY";
String product_id = "PRODUCT";
String url = "<https://api.scraperapi.com/structured/walmart/product?api_key=>" + apiKey + "&product_id=" + product;
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();
}Parameters
Details
API_KEY (required)
User account’s normal API key
PRODUCT_ID (required)
Walmart Product id. Exmaple: 5253396052
OUTPUT_FORMAT
For structured data methods we offer CSV and JSON output. JSON is default if parameter is not added. Options:
csv
json
Sample Response
Last updated
Was this helpful?

