Walmart Category API

Scrape Walmart category pages into structured JSON/CSV with ScraperAPI in Java. Extract product listings, prices, and availability by department ID.

This endpoint will retrieve Walmart product list for a specified product category.

try {
String apiKey = "APIKEY";
String category = "CATEGORY";
String page = "PAGE";
String url = "<https://api.scraperapi.com/structured/walmart/category?api_key=>" + apiKey + "&category=" + category + "&page=" + page;
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

category (required)

Walmart category id. Example: 3944_1089430_37807

page

Pagination. Example: 3

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?