Walmart Search API

Scrape Walmart search results into structured JSON/CSV with ScraperAPI in Java. Gather product lists, paginate results, and power price‑monitoring tools.

This endpoint will retrieve product list data from Walmart as a result of a search.

try {
String apiKey = "APIKEY";
String query = "QUERY";
String page = "PAGE";
String url = "https://api.scraperapi.com/structured/walmart/search?api_key=" + apiKey + "&query=" + query + "&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's normal API Key

QUERY (required)

Example: matchbox+cars

PAGE

Pagination. Example: 2

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?