> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenrows.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the Walmart Product Information API

> Extract detailed Walmart product information such as pricing, brand, SKU, and inventory data using the ZenRows Product Information API.

The Walmart Product Information API allows you to seamlessly extract detailed product data, search results, and customer reviews directly from Walmart. With this API, you can integrate Walmart insights into your applications and streamline workflows such as price monitoring, inventory management, and product analysis.

* Product Information: Name, Brand, Description, and SKU.
* Pricing Details: Regular and Discounted Prices, Currency Information.
* Images: High-quality product images.
* Availability: Stock status and fulfillment details.
* Categories: Breadcrumb hierarchy for navigation.
* Customization Options: Variations like color and size, along with associated prices.
* Warranty Information: Details about included warranties

Example Use Cases:

* **Price Comparison:** Monitor pricing changes and compare products.
* **Inventory Management:** Integrate real-time stock data into inventory systems.

## Supported Query Parameters

| PARAMETER          | TYPE     | DEFAULT | DESCRIPTION                                                                                          |
| ------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| **sku** `required` | `string` |         | The Walmart item ID (numeric, 8 to 20 characters). Example: `5074872077`.                            |
| **url**            | `string` |         | The full Walmart product URL. Example: `https://www.walmart.com/ip/5074872077`.                      |
| **tld**            | `string` | `.com`  | Top-level domain (TLD) for the Walmart website. Default is `.com`. Supported examples: `.com`, `.ca` |

## How to Setup

Request the product endpoint using the SKU of the desired product:

```bash theme={null}
https://ecommerce.api.zenrows.com/v1/targets/walmart/products/{sku}?apikey=YOUR_ZENROWS_API_KEY
```

### Example

```bash cURL theme={null}
curl "https://ecommerce.api.zenrows.com/v1/targets/walmart/products/{sku}?apikey=YOUR_ZENROWS_API_KEY"
```

<Note>Replace `{sku}` with the actual product ID.</Note>

<RequestExample>
  ```python Python theme={null}
  # pip install requests
  import requests

  sku = "123456789"  # Example SKU
  api_endpoint = f"https://ecommerce.api.zenrows.com/v1/targets/walmart/products/{sku}"
  params = {
      "apikey": "YOUR_ZENROWS_API_KEY",
  }
  response = requests.get(api_endpoint, params=params)
  print(response.text)
  ```

  ```javascript NodeJS theme={null}
  // npm install axios
  const axios = require('axios');

  const apikey = 'YOUR_ZENROWS_API_KEY';
  const sku = '123456789'; // Example SKU
  const api_endpoint = `https://ecommerce.api.zenrows.com/v1/targets/walmart/products/${sku}`;

  axios
      .get(api_endpoint, {
          params: {
              apikey,
          },
      })
      .then((response) => console.log(response.data))
      .catch((error) => console.log(error));
  ```

  ```java Java theme={null}
  import org.apache.hc.client5.http.fluent.Request;
  import org.apache.hc.core5.net.URIBuilder;
  import java.net.URI;

  public class ZRRequest {
      public static void main(final String... args) throws Exception {
          String apikey = "YOUR_ZENROWS_API_KEY";
          String sku = "123456789"; // Example SKU
          String api_endpoint = "https://ecommerce.api.zenrows.com/v1/targets/walmart/products/" + sku;

          URI uri = new URIBuilder(api_endpoint)
              .addParameter("apikey", apikey)
              .build();

          String response = Request.get(uri)
              .execute().returnContent().asString();

          System.out.println(response);
      }
  }
  ```

  ```php PHP theme={null}
  <?php
  $apikey = 'YOUR_ZENROWS_API_KEY';
  $sku = '123456789'; // Example SKU
  $api_endpoint = "https://ecommerce.api.zenrows.com/v1/targets/walmart/products/$sku";
  $params = [
      'apikey' => $apikey,
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $api_endpoint . '?' . http_build_query($params));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

  $response = curl_exec($ch);
  echo $response . PHP_EOL;
  curl_close($ch);
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"
      "io/ioutil"
      "log"
      "net/http"
      "net/url"
  )

  func main() {
      apikey := "YOUR_ZENROWS_API_KEY"
      sku := "123456789" // Example SKU
      api_endpoint := "https://ecommerce.api.zenrows.com/v1/targets/walmart/products/" + sku
      params := url.Values{}
      params.Add("apikey", apikey)

      resp, err := http.Get(api_endpoint + "?" + params.Encode())
      if err != nil {
          log.Fatalln(err)
      }
      defer resp.Body.Close()

      body, err := ioutil.ReadAll(resp.Body)
      if err != nil {
          log.Fatalln(err)
      }

      fmt.Println(string(body))
  }
  ```

  ```ruby Ruby theme={null}
  # gem install faraday
  require 'faraday'

  apikey = 'YOUR_ZENROWS_API_KEY'
  sku = '123456789' # Example SKU
  api_endpoint = "https://ecommerce.api.zenrows.com/v1/targets/walmart/products/#{sku}"

  conn = Faraday.new(url: api_endpoint) do |f|
  f.params = {
      apikey: apikey,
  }
  end

  response = conn.get

  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example theme={null}
  {
      "availability_status": "In Stock",
      "brand": "Apple",
      "category_breadcrumb": [
          "Electronics",
          "Cell Phones",
          "Smartphones"
      ],
      "customization_options": [
          {
              "image": "https:\/\/i5.walmartimages.com\/asr\/98765432-10ab-cdef-5678-90abcdef1234.jpg",
              "is_selected": true,
              "option_name": "Color",
              "price": 799.99,
              "value": "Black"
          }
      ],
      "description": "The latest iPhone with A15 Bionic chip, 5G capability, and advanced dual-camera system.",
      "fast_track_message": "Get it by tomorrow with fast shipping!",
      "fulfilled_by_walmart": true,
      "gtin": "00123456789012",
      "images": [
          "https:\/\/i5.walmartimages.com\/asr\/12345678-90ab-cdef-1234-567890abcdef.9d9d9d9d9d9d.jpg"
      ],
      "price": 799.99,
      "price_before_discount": 799.99,
      "price_currency_code": "USD",
      "price_currency_symbol": "$",
      "product_name": "Apple iPhone 13",
      "product_url": "https:\/\/www.walmart.com\/ip\/Apple-iPhone-13\/123456789",
      "rating": 4.8,
      "review_count": 3500,
      "sku": "123456789",
      "warranty": "1-year limited warranty"
  }
  ```
</ResponseExample>

## Troubleshooting and FAQs

<Accordion title="How can I change the country for product retrieval?">
  The country parameter allows you to target specific countries (e.g., `us`, `ca`, `es`). The default is us for the United States. You can modify this in your API request by setting the country parameter (e.g., `country=es` for Spain).
</Accordion>

<Accordion title="Can I use the Walmart Product Scraper API for commercial purposes?">
  Yes, the Walmart Product Scraper API can be used for both personal and commercial projects. Be sure to adhere to Walmart's terms of service and any applicable legal requirements when using the data.
</Accordion>
