Search
The walmart_search source is designed to retrieve Walmart search result pages. We can return the HTML for any Walmart page you like. Additionally, we can deliver structured (parsed) output for Walmart search pages.
Request samples
The example below illustrates how you can get a parsed Walmart search page result.
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "walmart_search",
"query": "iphone",
"parse": true
}'import requests
from pprint import pprint
# Structure payload.
payload = {
'source': 'walmart_search',
'query': 'iphone',
'parse': True,
}
# Get response.
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Instead of response with job status and results url, this will return the
# JSON response with the result.
pprint(response.json())const https = require("https");
const username = "USERNAME";
const password = "PASSWORD";
const body = {
source: "walmart_search",
query: "iphone",
parse: true,
};
const options = {
hostname: "realtime.oxylabs.io",
path: "/v1/queries",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization:
"Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
},
};
const request = https.request(options, (response) => {
let data = "";
response.on("data", (chunk) => {
data += chunk;
});
response.on("end", () => {
const responseData = JSON.parse(data);
console.log(JSON.stringify(responseData, null, 2));
});
});
request.on("error", (error) => {
console.error("Error:", error);
});
request.write(JSON.stringify(body));
request.end();# The whole string you submit has to be URL-encoded.
https://realtime.oxylabs.io/v1/queries?source=walmart_search&query=iphone&parse=true&access_token=12345abcde<?php
$params = array(
'source' => 'walmart_search',
'query' => 'iphone',
'parse' => true
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
const Username = "USERNAME"
const Password = "PASSWORD"
payload := map[string]interface{}{
"source": "walmart_search",
"query": "iphone",
"parse": true,
}
jsonValue, _ := json.Marshal(payload)
client := &http.Client{}
request, _ := http.NewRequest("POST",
"https://realtime.oxylabs.io/v1/queries",
bytes.NewBuffer(jsonValue),
)
request.SetBasicAuth(Username, Password)
response, _ := client.Do(request)
responseText, _ := ioutil.ReadAll(response.Body)
fmt.Println(string(responseText))
}
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
namespace OxyApi
{
class Program
{
static async Task Main()
{
const string Username = "USERNAME";
const string Password = "PASSWORD";
var parameters = new {
source = "walmart_search",
query = "iphone",
parse = true
};
var client = new HttpClient();
Uri baseUri = new Uri("https://realtime.oxylabs.io");
client.BaseAddress = baseUri;
var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
requestMessage.Content = JsonContent.Create(parameters);
var authenticationString = $"{Username}:{Password}";
var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
var response = await client.SendAsync(requestMessage);
var contents = await response.Content.ReadAsStringAsync();
Console.WriteLine(contents);
}
}
}package org.example;
import okhttp3.*;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;
public class Main implements Runnable {
private static final String AUTHORIZATION_HEADER = "Authorization";
public static final String USERNAME = "USERNAME";
public static final String PASSWORD = "PASSWORD";
public void run() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("source", "walmart_search");
jsonObject.put("query", "iphone");
jsonObject.put("parse", true);
Authenticator authenticator = (route, response) -> {
String credential = Credentials.basic(USERNAME, PASSWORD);
return response
.request()
.newBuilder()
.header(AUTHORIZATION_HEADER, credential)
.build();
};
var client = new OkHttpClient.Builder()
.authenticator(authenticator)
.readTimeout(180, TimeUnit.SECONDS)
.build();
var mediaType = MediaType.parse("application/json; charset=utf-8");
var body = RequestBody.create(jsonObject.toString(), mediaType);
var request = new Request.Builder()
.url("https://realtime.oxylabs.io/v1/queries")
.post(body)
.build();
try (var response = client.newCall(request).execute()) {
if (response.body() != null) {
try (var responseBody = response.body()) {
System.out.println(responseBody.string());
}
}
} catch (Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
System.exit(0);
}
public static void main(String[] args) {
new Thread(new Main()).start();
}
}{
"source": "walmart_search",
"query": "iphone",
"parse": true
}We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint or asynchronous Push-Pull integration, refer to the integration methods section.
Request parameter values
Generic
source
Sets the scraper.
walmart_search
query
The keyword or phrase to search for products.
-
min_price
Set the minimum price.
-
max_price
Set the maximum price.
-
sort_by
Select sorting of products. Available values are: price_low, price_high, best_seller, best_match.
best_match
parse
Returns parsed data when set to true.
false
- mandatory parameter
Localization
Adapt results to specific stores, shipping locations, etc. Find the list in JSON format of Walmart Store IDs here:
You can also find the official page of Walmart Stores here.
domain
Domain localization for Walmart.
String
fulfillment_speed
Set the fulfillment speed. Available values are: today, 2_days, anytime, tomorrow.
String
fulfillment_type
Set the fulfillment type. Available values are: in_store.
String
delivery_zip
Set the shipping to location.
String
store_id
Set the store location.
String
Structured data
Output data dictionary
HTML example
JSON structure
The table below presents a detailed list of each search page element we parse, along with its description and data type. The table also includes some metadata.
url
The search page URL.
string
facets
An array containing details of any available search facets (refinements) shown on the search result page.
array
results
Search page results.
array
results.general
An object with general product details.
object
results.price
An object with pricing details of the product.
object
results.rating
Object contains details on product rating.
object
results.seller
Object contains seller information.
object
results.variants (optional)
Array contains a list of product variants.
array
results.fulfillment
Object contains details on product fulfillment options.
object
location
Provides information on the location in which the request was run in.
object
page_details
Object contains data on search query result page.
object
parse_status_code
The status code of the parsing job. You can see the parser status codes described here.
integer
created_at
The timestamp when the scraping job was created.
timestamp
updated_at
The timestamp when the scraping job was finished.
timestamp
page
Page number from which the data was extracted
integer
url
The search page URL.
string
job_id
The ID of the job associated with the scraping job.
string
status_code
The status code of the scraping job. You can see the scraper status codes described here.
integer
is_render_forced
Identifies whether rendering has been forced for this request.
boolean
parser_type
Type of parser used for extracting the data (e.g., "walmart_search_new").
string
General

...
"general": {
"pos": 1,
"url": "/ip/Adidas-Men-s-California-2-0-Crew-Neck-Short-Sleeve-Tee-T-Shirt/833623567?classType=VARIANT",
"image": "https://i5.walmartimages.com/seo/Adidas-Men-s-California-2-0-Crew-Neck-Short-Sleeve-Tee-T-Shirt_1b8e0b00-fdc7-4b88-99fb-9a633bf0227b_1.812a96a559770448397cd828ef1cf68b.jpeg?odnHeight=180&odnWidth=180&odnBg=FFFFFF",
"title": "Adidas Men's California 2.0 Crew Neck Short Sleeve Tee T-Shirt",
"sponsored": true,
"product_id": "833623567",
"out_of_stock": false,
"section_title": "Results for \"adidas\""
},
...pos
An indicator denoting the position of a given item within the section product is attributed to.
integer
url
The URL of the product.
string
image
The URL of the main product image.
string
title
Title or name of the product.
string
product_id
The ID of the product.
string
sponsored
Identifies if product is sponsored.
boolean
badge (optional)
Deal, popular pick, bestseller, 100+ bought since yesterday
list of strings
section_title
The name of the section which product is attributed to in the search page.
string
out_of_stock
Indicates if item is out of stock.
boolean
Price

...
"price": {
"price": 1149.99,
"currency": "USD",
"price_min": 1149.99
"price_max": 1399.00
},
...price
The current price of the product without any deductions.
float
price_strikethrough(optional)
The strikethrough price is either a Was Price, a Bundle Price, or a List Price.
float
currency
The ISO 4217 three-letter code of the currency.
string
price_min(optional)
The minimum price of the product in the case of range pricing.
float
price_max(optional)
The maximum price of the product in the case of range pricing.
float
Rating

...
"rating": {
"count": 428,
"rating": 4.6
},
...rating
Average rating of the product.
float
count
Number of ratings for the product.
integer
Seller
Data not displayed visually.
name
Name of the seller.
string
id
ID of the seller.
string
Variants

...
"variants": [
{
"url": "/ip/Apple-MacBook-Air-13-3-inch-Laptop-Gold-M1-Chip-8GB-RAM-256GB-storage/550880792?classType=undefined&variantFieldId=actual_color",
"image": "https://i5.walmartimages.com/asr/a9857413-b9fa-4c8d-9f81-7ea4c93889a1.410fd3cb7fe36102bbe2d3dca32a8075.jpeg?odnHeight=180&odnWidth=180&odnBg=ffffff",
"title": "Gold",
"product_id": "550880792"
},
{
"url": "/ip/Apple-MacBook-Air-13-3-inch-Laptop-Silver-M1-Chip-8GB-RAM-256GB-storage/715596133?classType=undefined&variantFieldId=actual_color",
"image": "https://i5.walmartimages.com/asr/056c08d5-2d68-44f2-beb0-dd8a47e2f8e8.2a2a210657937c3c11b37df5be8fa4ad.jpeg?odnHeight=180&odnWidth=180&odnBg=ffffff",
"title": "Silver",
"product_id": "715596133"
},
{
"url": "/ip/Apple-MacBook-Air-13-3-inch-Laptop-Space-Gray-M1-Chip-8GB-RAM-256GB-storage/609040889?classType=undefined&variantFieldId=actual_color",
"image": "https://i5.walmartimages.com/asr/af1d4133-6de9-4bdc-b1c6-1ca8bd0af7a0.c0eb74c31b2cb05df4ed11124d0e255b.jpeg?odnHeight=180&odnWidth=180&odnBg=ffffff",
"title": "Space Gray",
"product_id": "609040889"
}
],
...url
URL of the product variation.
string
title
The title of the product variation.
string
product_id
The Id of the product variation.
string
image
The image of the product variation.
string
Fulfillment

...
"fulfillment": {
"pickup": true,
"delivery": true,
"shipping": true,
"free_shipping": false
}
...pickup
Indicates if the product is available to be fulfilled via in-store pickup.
boolean
delivery
Indicates if the product is available to be fulfilled via delivery from store.
Delivery comes from your local store, if available.
boolean
shipping
Indicates if the product is available to be fulfilled via home shipping.
boolean
free_shipping
Indicates if shipping is free of charge.
boolean
Facets
...
"facets": [
{
"type": "sort",
"values": [
{
"name": "Best Match"
},
{
"name": "Price Low"
},
{
"name": "Price High"
},
{
"name": "Best Seller"
}
],
"display_name": "Sort by"
},
...display_name
The display name of the facet (i.e. the user-facing name).
string
type
The facet type.
string
values
The facet values array shows the values of the given facet.
array
values.name
The facet value name.
string
values.item_count (optional)
The number of items available for the specific facet.
integer
Location

...
"location": {
"city": "Sacramento",
"state": "CA",
"store_id": "8915",
"zip_code": "95829"
},
...city
The city the request was run on.
string
state
The state the request was run on.
string
zip_code
The zip code the request was run on.
string
store_id
The ID of the store that the request was run on.
string
Page details
...
"page_details": {
"page": 1,
"total_results": 11524,
"last_visible_page": 25
},
...total_results
The total number of search results shown as being available.
integer
last_visible_page
Last page number of search results.
integer
page
Page number from which the product data was extracted
integer
Last updated
Was this helpful?

