logo

Search Results

View as Markdown

Search keywords or browse categories at a specific Walmart store

The Search endpoint searches a keyword or lists a category against one Walmart store. It returns structured product listings by default, with the prices and availability that store actually offers, or the store's Walmart search or category page as HTML.


Endpoint

GET https://api.scrape.do/plugin/walmart/search

Each successful request costs 10 credits. Failed requests are never charged.


Input Parameters

ParameterTypeRequiredDescription
tokenstring*Your Scrape.do API authentication token
qstringConditionalSearch keyword (URL-encoded). query is accepted as an alias. Provide exactly one of q, cat_id, or url.
cat_idstringConditionalNumeric category id from the end of a Walmart /browse/ URL, such as 976759_976787_1001391. Requires storeid and returns JSON only.
urlstringConditionalFull, URL-encoded walmart.com/browse/ category URL. Requires storeid. Use this instead of cat_id for output=html.
storeintegerConditionalWalmart store id to scope results to. Provide exactly one of store or zipcode.
zipcodestringConditional5-digit US ZIP code to scope results to. Provide exactly one of store or zipcode.
storeidintegerExact Walmart store id, paired with zipcode. Required for category requests and output=html. This can target stores not supported by the standalone store parameter.
pageintegerResult page from 1 to 100 (default: 1). See Pagination.
timeoutintegerPer-request timeout in milliseconds (default: system maximum)
outputstringjson (default) or html. HTML output requires storeid.

For exact-store targeting, pass the store's own zipcode together with storeid. Walmart must list that store for the ZIP code or the request returns 400.


JSON Response Parameters

FieldTypeDescription
storeobjectThe store this response reflects
querystringThe keyword that was searched. Empty for a category request.
total_resultsnumberTotal matches Walmart reports for the keyword, across all pages
pagenumberCurrent page number
total_pagesnumberHighest page available for this keyword
has_more_pagesbooleanWhether Walmart reports further results after this page (see Pagination)
resultsarrayThe search results

Store Object Fields

FieldTypeDescription
store_idstringThe store id this response is scoped to
citystringCity the store is in
statestringTwo-letter state code
postal_codestringZIP code for the store's location

Result Object Fields

FieldTypeDescription
positionnumber1-based position in this response
item_idstringWalmart item id. Pass this to /plugin/walmart/product
namestringProduct title
brandstringNot currently returned by search. Use /plugin/walmart/product for the brand
urlstringProduct page URL
imagestringProduct thumbnail URL
pricenumberCurrent price at this store. null when Walmart shows no price
list_pricenumberPre-discount price, present only when the item is discounted
currencystringCurrency code (USD)
ratingnumberAverage customer rating
reviews_countnumberNumber of reviews
sellerstringWho sells the item — Walmart.com or a marketplace seller's name
availabilitystringStock status at this store, e.g. IN_STOCK, OUT_OF_STOCK
fulfillmentarrayFulfillment methods offered, lowercased — e.g. ["delivery","pickup"]
sponsoredbooleantrue for paid placements
categorystringWalmart's category path for the item

results holds the main search results for your keyword, including sponsored placements marked "sponsored": true. Merchandising carousels that Walmart mixes into the same page — "trending", "highly rated" — are excluded, because they do not answer the keyword you searched for.


Example Usage

Step 1: Pick a Store and a Keyword

Target by store id when you are tracking a fixed location:

curl "https://api.scrape.do/plugin/walmart/search?q=milk&store=1735&token=YOUR_TOKEN"

Or by ZIP code when you care about an area rather than a specific store:

curl "https://api.scrape.do/plugin/walmart/search?q=milk&zipcode=60074&token=YOUR_TOKEN"

The store chosen for a ZIP code can vary between requests; read store in the response.

Step 2: Read the Response

{
  "store": {
    "store_id": "1735",
    "city": "…",
    "state": "IL",
    "postal_code": "…"
  },
  "query": "milk",
  "total_results": 413,
  "page": 1,
  "total_pages": 19,
  "has_more_pages": true,
  "results": [
    {
      "position": 1,
      "item_id": "23619910",
      "name": "Lactaid Whole Milk, 96 oz",
      "url": "https://www.walmart.com/ip/Lactaid-Whole-Milk-96-oz/23619910",
      "image": "https://i5.walmartimages.com/seo/Lactaid-Whole-Milk-96-oz.jpeg",
      "price": 6.24,
      "list_price": null,
      "currency": "USD",
      "rating": 4.6,
      "reviews_count": 1183,
      "seller": "Walmart.com",
      "availability": "IN_STOCK",
      "fulfillment": ["pickup", "delivery"],
      "sponsored": false,
      "category": "Food/Dairy Eggs & Cheese/Milk"
    }
  ]
}

Step 3: Chain Into Product Lookups

Each result's item_id is what the product endpoint takes, so a search feeds product lookups directly:

curl "https://api.scrape.do/plugin/walmart/product?item=23619910&store=1735&token=YOUR_TOKEN"

Keep the same store across both calls — that is what makes the price on the product page match the price you saw in the search results.

Browse a Category at an Exact Store

Use the category id for structured JSON:

curl "https://api.scrape.do/plugin/walmart/search?cat_id=976759_976787_1001391&zipcode=34787&storeid=110&token=YOUR_TOKEN"

For HTML, pass the full category URL through url:

curl "https://api.scrape.do/plugin/walmart/search?url=https%3A%2F%2Fwww.walmart.com%2Fbrowse%2Fsnacks-cookies-chips%2Fcookies%2F976759_976787_1001391&zipcode=34787&storeid=110&output=html&token=YOUR_TOKEN"

HTML Output

Set output=html and pass zipcode with storeid to receive Walmart's search or category page with content-type: text/html:

curl "https://api.scrape.do/plugin/walmart/search?q=milk&zipcode=60074&storeid=1735&output=html&token=YOUR_TOKEN"

The page reflects the store you target: the product tiles carry that store's prices, stock, and pickup and delivery options.

The first requests to a storeid that has not been used recently can return 502 while its session is prepared. Retry after about one minute.


Pagination

Request the next result page with page=<page + 1>:

curl "https://api.scrape.do/plugin/walmart/search?q=milk&zipcode=60074&page=2&token=YOUR_TOKEN"

Continue while has_more_pages is true and results is not empty. page accepts 1 to 100, but results currently end at page 20: page 20 can still report has_more_pages: true and a higher total_pages, and page 21 onward returns an empty results array. Pages beyond the available results return 200 with an empty results array, has_more_pages: false and total_results: 0, and are charged like any successful request. Read total_pages and total_results from page 1: later pages can report different values, and an out-of-range response may return total_pages: 1.


Empty Results

A keyword that genuinely matches nothing at that store returns 200 with an empty array, not an error:

{
  "store": { "store_id": "1735", "city": "…", "state": "IL", "postal_code": "…" },
  "query": "zxqwvbnmasdfghjkl123",
  "total_results": 0,
  "page": 1,
  "total_pages": 0,
  "has_more_pages": false,
  "results": []
}

Error Responses

StatusBodyCause
400{"error":"token is required"}Missing token
400{"error":"exactly one of store or zipcode is required"}Both or neither of store / zipcode were provided
400{"error":"store must be numeric"}store is not numeric
400{"error":"zipcode must be a 5-digit US zip"}zipcode is not a valid 5-digit US ZIP
400{"error":"storeid must be numeric"}storeid is not numeric
400{"error":"storeid requires zipcode"}storeid was sent with store instead of zipcode
400{"error":"storeid is not available for this zipcode"}The exact store is not available for that ZIP code
400{"error":"output=html requires storeid"}HTML was requested without an exact store id
400{"error":"output must be json or html"}output has an unsupported value
400{"error":"timeout is invalid"}timeout is not an integer
400{"error":"timeout must be a positive number of milliseconds"}timeout is zero or negative
400{"error":"page must be an integer between 1 and 100"}page is not an integer from 1 to 100
400Unsupported store idThis endpoint does not cover that store id. Pass zipcode instead, or contact support to have your store added.
400{"error":"q (search query), cat_id (category), or url (category URL) is required"}No keyword or category was provided
400{"error":"provide q, cat_id, or url — not more than one"}More than one keyword or category input was provided
400{"error":"url must be a walmart.com /browse/ category URL"}url is not a Walmart category URL
400{"error":"cat_id must be numeric category tokens like 976759_976787_1001391"}cat_id has an invalid format
400{"error":"category output=html requires url (the full /browse/ URL); cat_id returns JSON"}HTML was requested with cat_id instead of url
400{"error":"cat_id requires storeid"}A category id was provided without an exact store id
400{"error":"url requires storeid"}A category URL was provided without an exact store id
502{"error":"walmart-search plugin failure.","message":"…"}Could not get a valid response for this store or ZIP. Not charged.

On this page