---
title: Search
slug: bluecartapi/walmart-product-data-api/parameters/search
docTags: 
createdAt: 2024-07-27T17:51:31.971Z
---

# Search Parameters

<font color="#52c41a">`GET`</font>  `/request`

The Search Parameters are applicable when making a request with  `type=search`  to retrieve search results from Walmart. The search term is specified in the  `search_term`  parameter. The parameters should be appended as querystring parameters to the Walmart Product Data API `GET` HTTP request.

Search results are retrieved from the [Search results page](https://www.walmart.com/search/?query=highlighter+pens) on Walmart.

![](https://apiimages.imgix.net/bluecartapi/images/png/docs/search.png?auto=format\&ixlib=react-9.5.1-beta.1\&w=600 "Search Results Page")

For example, to request search results for the search term  `highlighter pens` , sorted by "best selling products", the request would be:

:::CodeblockTabs
HTTP

```HTTP
https://api.bluecartapi.com/request?api_key=demo&type=search&search_term=highlighter+pens&sort_by=best_seller
```

```curl
curl -L --get https://api.bluecartapi.com/request \
-d api_key="demo" \
-d type="search" \
-d search_term="highlighter+pens" \
-d sort_by="best_seller"
```

```nodejs
const axios = require('axios');

// set up the request parameters
const params = {
  api_key: "demo",
  type: "search",
  search_term: "highlighter pens",
  sort_by: "best_seller"
}

// make the http GET request to BlueCart API
axios.get('https://api.bluecartapi.com/request', { params })
  .then(response => {

    // print the JSON response from BlueCart API
    console.log(JSON.stringify(response.data, 0, 2));

  }).catch(error => {
    // catch and print the error
    console.log(error);
  })
```

```python
import requests
import json

# set up the request parameters
params = {
  'api_key': 'demo',
  'type': 'search',
  'search_term': 'highlighter pens',
  'sort_by': 'best_seller'
}

# make the http GET request to BlueCart API
api_result = requests.get('https://api.bluecartapi.com/request', params)

# print the JSON response from BlueCart API
print(json.dumps(api_result.json()))
```

```php
<?php
      
# set up the request parameters
$queryString = http_build_query([
  'api_key' => 'demo',
  'type' => 'search',
  'search_term' => 'highlighter pens',
  'sort_by' => 'best_seller'
]);

# make the http GET request to BlueCart API
$ch = curl_init(sprintf('%s?%s', 'https://api.bluecartapi.com/request', $queryString));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
# the following options are required if you're using an outdated OpenSSL version
# more details: https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);

$api_result = curl_exec($ch);
curl_close($ch);

# print the JSON response from BlueCart API
echo $api_result;

?>
```
:::

***

### Search Parameters

The following parameters are available for all requests made when  `type=search` .

| *`Parameter`*          | *`Required`*        | *`Description`*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `walmart_domain`<br /> | *`optional`*        | The Walmart domain to target. The value of the walmart\_domain parameeter determines which additional parameters are available. For example, `walmart.ca` supports only `type=search` and `type= product` at this time. <br />defaults to `walmart.com`<br />Valid values for `walmart_domain` are:<br />1. `walmart_domain=walmart.com`<br />2. target walmart.com domain<br /><br />1. `walmart_domain=walmart.ca`<br />2. target walmart.ca domain                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| *`search_term`*        | <u>*`required`*</u> | A search term to use to search for Walmart items. Either the `search_term` or `url` parameter must be supplied.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| *`category_id`*        | *`optional`*        | Limits the search results returned from `type=search` requests to the category area specified in the search `category_id` property.  <br />View the official [Search Category IDs ](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/reference/search-category-ids)to get `category_id` values for use with [Search Requests ](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/reference/search-category-ids). Search Category IDs can also be retrieved from any Walmart URL in the `cat_id` Walmart URL querystring parameter.  <br />Either the `category_id` or `search_term` parameter must be supplied when making `type=search` requests.  <br />**Note** the `category_id` values supplied to a `type=search` request are [Search Category IDs ](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/reference/search-category-ids). They are not the same as the `category_id` values supplied to a `type=category` request and returned by the [Categories API ](https://docs.trajectdata.com/bluecartapi/categories-api/overview). |
| *`sort_by`*            | *`optional`*        | Determines how the results are sorted. Valid values are:<br />1. `best_seller`<br />2. Sort results by best selling products first.<br /><br />1. `price_high_to_low`<br />2. Sort results by highest to lowest priced.<br /><br />1. `price_low_to_high`<br />2. Sort results by lowest to highest priced.<br /><br />1. `best_match`<br />2. Sort results by best match.<br /><br />1. `highest_rating`<br />2. Sort results by highest rated products first.<br /><br />1. `newly_listed`<br />2. Sort results by newly listed products first.<br /><br />1. `new`<br />2. Sort results by newest products first<br />- <br />:inlineImage[]{src="https://apiimages.imgix.net/bluecartapi/images/png/docs/sort_by.png?auto=format&ixlib=react-9.5.1-beta.1&w=150" alt caption}                                                                                                                                                                                                                                                                                                              |
| *`delivery_type`*      | *`optional`*        | Determines whether results are filtered to just those matching the given delivery type. Valid values are:<br />1. `pickup`<br />2. Filter results to products available for pickup in store.<br /><br />1. `delivery_from_store`<br />2. Filter results to products available delivery from a store.<br /><br />1. `shipping`<br />2. Filter results to products available via home shipping.<br /><br />1. `available_in_store`<br />2. Filter results to products available in store (use the `customer_zipcode` parameter to set the store location).<br />- <br />:inlineImage[]{src="https://apiimages.imgix.net/bluecartapi/images/png/docs/search_delivery_type.png?auto=format&ixlib=react-9.5.1-beta.1&w=150" alt caption}                                                                                                                                                                                                                                                                                                                                                            |
| *`rating`*             | *`optional`*        | Determines whether results are filtered to just those matching the given customer star rating. Valid values are:<br />1. `one_star`<br />2. Filter results to products with a 1 to 1.9 star customer rating.<br /><br />1. `two_star`<br />2. Filter results to products with a 2 to 2.9 star customer rating.<br /><br />1. `three_star`<br />2. Filter results to products with a 3 to 3.9 star customer rating.<br /><br />1. `four_star`<br />2. Filter results to products with a 4 to 5 star customer rating.<br />- <br />:inlineImage[]{src="https://apiimages.imgix.net/bluecartapi/images/png/docs/search_rating.png?auto=format&ixlib=react-9.5.1-beta.1&w=150" alt caption}                                                                                                                                                                                                                                                                                                                                                                                                        |
| *`condition`*          | *`optional`*        | Filters the results to just products matching the given condition. Valid values are:<br />1. `new`<br />2. Filter results to just new products.<br /><br />1. `refurbished`<br />2. Filter results to just refurbished products.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| *`min_price`*          | *`optional`*        | Determines the minimum price of results to return, expressed in dollars and cents (i.e. `min_price=2.99` for $2.99).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| *`max_price`*          | *`optional`*        | Determines the maximum price of results to return, expressed in dollars and cents (i.e. `min_price=39.99` for $39.99).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| *`page`*               | *`optional`*        | The current page of results to retrieve. Inspect the `pagination` results property for details on the number of pages available.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| *`max_page`*           | *`optional`*        | Use the `max_page` parameter to get multiple pages of results in one request. The API will automatically paginate through pages and concatenate the results into one response.  <br />See the [Pagination ](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/pagination)docs for more information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| *`facets`*             | *`optional`*        | A free-form set of filter facets to use with the request. Available facet data is returned from `type=search` requests or can be retrieved from any Walmart URL in the `facet` Walmart URL querystring parameter.  <br />Facet data should be expressed in comma seperated notation, with the name and value of the facet delimited by an equals ("=") character.  <br />For example, to set the `brand` facet to the value `Garmin` and the `screen_size` facet to the value `6"` the value of the `facets` request parameter would be `facets=brand=Garmin,screen_size=6"`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| *`url`*                | *`optional`*        | The Walmart search results page to retrieve results from.  <br />**Note** : If the `url` parameter is supplied then all other parameters are ignored as they are overriden be those specified in the `url` parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

***

**Next Steps**
     [Search Results](https://docs.trajectdata.com/bluecartapi/walmart-product-data-api/results/search)
