walmart-api - 沃尔玛杂货店的开发人员 API

标签 walmart-api

沃尔玛有开发人员 API 和 SDK,但这些似乎是为电视、家具等一般元素设计的……有人碰巧知道沃尔玛杂货店是否有 SDK 或 API?我的用例是以编程方式为给定商店填充 Walmart Grocery 购物车。

最佳答案

对于 walmart 杂货 api,您可以使用 cURL 来获取杂货 list 。在我下面提供的示例中,我将使用 PHP (Guzzle/HTTP)
搜索鸡蛋 (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); 

这将根据您的搜索查询列出 50-60 件杂货。

在 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'

不确定这是否回答了您的问题,但我希望这是一个开始。

关于walmart-api - 沃尔玛杂货店的开发人员 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52140130/

相关文章:

php - 沃尔玛 API 搜索产品

javascript - 无法使用 Walmart API 更新提要

javascript - 查找沃尔玛的搜索 URL

python - 发布项目沃尔玛合作伙伴 API Python

php - 在本地数据库中存储 Amazon API 数据

walmart-api - Affiliate API 仅适用于 walmart.io "Try API"页面,但不适用于每个 curl 请求