---
title: Search
slug: asindataapi/product-data-api/parameters/search
docTags: 
createdAt: 2024-08-01T10:34:46.728Z
---

# Search Parameters

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

The Search Parameters are applicable when making a request with  `type=search`  to retrieve search results for an Amazon domain - the Amazon domain is specified using the  `amazon_domain`  parameter and the search term is specified in the  `search_term`  parameter. The parameters should be appended as querystring parameters to the Product Data API `GET` HTTP request.

Search results are retrieved from the [search results page](https://www.amazon.com/s?k=highlighter+pens\&s=review-rank) on Amazon.

![](https://apiimages.imgix.net/asindataapi/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 "average customer review", on  `amazon.com` , the request would be:

:::CodeblockTabs
HTTP

```HTTP
https://api.asindataapi.com/request?api_key=demo&type=search&amazon_domain=amazon.com&search_term=highlighter+pens&sort_by=average_review
```

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

```nodejs
const axios = require('axios');

// set up the request parameters
const params = {
  api_key: "demo",
  type: "search",
  amazon_domain: "amazon.com",
  search_term: "highlighter pens",
  sort_by: "average_review"
}

// make the http GET request to ASIN Data API
axios.get('https://api.asindataapi.com/request', { params })
  .then(response => {

    // print the JSON response from ASIN Data 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',
  'amazon_domain': 'amazon.com',
  'search_term': 'highlighter pens',
  'sort_by': 'average_review'
}

# make the http GET request to ASIN Data API
api_result = requests.get('https://api.asindataapi.com/request', params)

# print the JSON response from ASIN Data API
print(json.dumps(api_result.json()))
```

```php
<?php
      
# set up the request parameters
$queryString = http_build_query([
  'api_key' => 'demo',
  'type' => 'search',
  'amazon_domain' => 'amazon.com',
  'search_term' => 'highlighter pens',
  'sort_by' => 'average_review'
]);

# make the http GET request to ASIN Data API
$ch = curl_init(sprintf('%s?%s', 'https://api.asindataapi.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 ASIN Data API
echo $api_result;

?>
```
:::

***

### Search Parameters

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

| *`Parameter`*         | *`Required`* | *`Description`*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *`amazon_domain`*     | *`optional`* | The Amazon domain to retrieve search results from. For a full list of supported Amazon domains see [Supported Amazon Domains ](https://docs.trajectdata.com/asindataapi/product-data-api/reference/amazon-domains).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| *`search_term`*       | *`optional`* | A search term to use to search products.<br />- <br />:inlineImage[]{src="https://apiimages.imgix.net/asindataapi/images/png/docs/search_search_term.png?auto=format&ixlib=react-9.5.1-beta.1&w=400" alt caption}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| *`refinements`*       | *`optional`* | A comma-seperated list of refinement values to filter the search results by. These allow you to refine your search by values such as "Reviews rating 4 and over", "price range" and "brand".  <br />Refinement values are returned in the `refinements` array of each `type=search` result. Refinement values are dynamic and change by category area or search term used. If you wish to use refinements you should first issue a `type=search` request without specifying any `refinements` to retrieve a master list of the avaialble refinements for the given category area/search term. You can then cache these refinement values for use on subsequent requests.  <br />For example, to run a `type=search` request specifying two refinements with values `p_85/2470955011` and `p_36/2421886011` the value of the `refinements` parameter would be `refinements=p_85/2470955011,p_36/2421886011`<br />- <br />:inlineImage[]{src="https://apiimages.imgix.net/asindataapi/images/png/docs/search_refinements.png?auto=format&ixlib=react-9.5.1-beta.1&w=150" alt caption} |
| *`category_id`*       | *`optional`* | A category ID to limit search results to. ASIN Data API will use the `category_id` in the following form: `https:// amazon_domain /s?node= category_id `.  <br />**Note** that pagination for **top-level** categories is not supported by the Amazon sites. If you wish to iterate the contents of a category the recommended approach is to pick the lowest level categories to perform your iteration / pagination on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| *`sort_by`*           | *`optional`* | Determines the sort order of search results to return. Valid values are:<br />1. `most_recent`<br />2. Sort search results by newest arrivals.<br /><br />1. `price_low_to_high`<br />2. Sort search results by lowest to highest price.<br /><br />1. `price_high_to_low`<br />2. Sort search results by highest to lowest price.<br /><br />1. `featured`<br />2. Sort search results by featured first.<br /><br />1. `average_review`<br />2. Sort search results by average customer review.<br />- <br />:inlineImage[]{src="https://apiimages.imgix.net/asindataapi/images/png/docs/search_sort_by.png?auto=format&ixlib=react-9.5.1-beta.1&w=150&dpr=1&q=75" alt caption}                                                                                                                                                                                                                                                                                                                                                                                                   |
| *`exclude_sponsored`* | *`optional`* | Whether to exclude sponsored search results (when set to `exclude_sponsored=true` ) from the search results returned, or not. Defaults to `false` .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| *`page`*              | *`optional`* | The current page of search results to retrieve. Inspect the `pagination.total_pages` property in the [Search results ](https://docs.trajectdata.com/asindataapi/product-data-api/results/search)to see how many pages of search results are 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/asindataapi/product-data-api/pagination)docs for more information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| *`url`*               | *`optional`* | The Amazon search results page URL to retrieve search results from. Be sure to URL-encode the `url` parameter.  <br />**Note** the `url` parameter is supplied, the `search_term` parameter cannot be used (as the `url` itself defines the search term used).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| *`direct_search`*     | *`optional`* | By default Amazon will, if a spelling mistake is suspected in the `search_term` , show search results for the corrected search term.  <br />To disable this behaviour and search for the value in `search_term` directly, without auto-correcting it, set `direct_search=true` .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

***

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