Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Developer API for Walmart Grocery

Tags:

walmart-api

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.

like image 849
jbambrough Avatar asked Sep 02 '18 18:09

jbambrough


People also ask

Does Walmart use API?

The Walmart Marketplace APIs provide resources for sellers to manage their items, orders, prices, promotions, inventory and reports on Walmart.com. The Walmart Developer Portal provides all the tools you need to directly integrate with Walmart Marketplace APIs.

What is API on Walmart application?

The Walmart Marketplace API provides resources for seller applications to manage items, orders, prices, promotions, inventory and reports on Walmart.com. The Walmart Developer Center provides all the tools you need to directly integrate with the Walmart Marketplace API. Get started.


1 Answers

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.

like image 98
Solomon Antoine Avatar answered Oct 03 '22 21:10

Solomon Antoine