Search Walmart products
Input
query requiredFree-text search query.
page optionalResult page (1-based). Walmart caps pagination around 15-25 pages; max_page in the result says where. Same page re-fetched returns the same organic order; sponsored tiles rotate.
Default: 1sort optionalWalmart's own sort options.
Default: "best_match"Output
url requiredpage requiredsort requireditems requiredThe query's actual matches, and only those. Walmart pads a page that matches little or nothing with an 'Other options to consider' block; those products are kept out of here and returned in related_items, so the length of this array tracks total_count instead of the tile count on screen. An empty array means the query matched nothing, which is a real answer rather than a failure.
query requiredmax_page requiredLast page Walmart will serve for this query.
total_count requiredWalmart's own count of real matches for the query. It tracks items, not the number of tiles rendered: a page can show dozens of products while this is 0.
related_count requiredHow many suggestions are in related_items. A high number next to a low total_count means Walmart mostly padded the page.
related_items requiredProducts Walmart suggests under 'Other options to consider' when the query matches little or nothing. Same shape as items. These are NOT results for the query and must not be treated as matches: for a query matching nothing they are the entire page. Empty for a query with plenty of matches.
corrected_query requiredQuery Walmart actually searched when it auto-corrected the spelling; null otherwise.
