There are Developer API's and SDK's for Walmart, but these appear to be designed for general items like TV's, furniture, etc... does anybody happen to know if there is an SDK or API for Walmart Grocery? My use case is to populate a Walmart Grocery shopping cart programmatically for a given store.
8
votes
I'm also interested in this, it would be extremely useful and beneficial to not only walmart but us developers as well.
- Mike Mulligan
Exactly Mike. It was my understanding that this was something in the works, but haven't seen anything published yet
- jbambrough
It must be in the works because devices such as Amazon Alexa and Google Home would be able to utilize this and make grocery shopping easier than ever.
- Mike Mulligan
1 Answers
1
votes
For the walmart grocery api, you can use cURL to get a list of grocery items. In the example I provide below I will be using PHP (Guzzle/HTTP)
Search For Eggs (PHP)
$client = new Client(['base_uri' => 'https://grocery.walmart.com/v4/api/']);
$method = 'GET';
$path = 'products/search';
$query = [
'query' =>
[
'storeId' => '1855', //store location
'count' => 50,
'page' => 1,
'offset' => 0,
'query' => 'Egg Dozen'
]
];
$req = $client->request($method, $path, $query);
$data = json_decode($req->getBody()->getContents());
$products = $data->products;
print_r($products);
This will list off 50-60 grocery items based off of your search query.
Search For Eggs in cURL
curl -X GET \
'https://grocery.walmart.com/v4/api/products/search?storeId=1855&count=1&page=1&offset=0&query=eggs' \
-H 'Postman-Token: 1723fea5-657d-4c54-b245-027d41b135aa' \
-H 'cache-control: no-cache'
Not sure if that answered your question but I hope it is a start.