---
title: Stock Estimation
slug: rainforestapi/product-data-api/parameters/stock-estimation
docTags: 
createdAt: 2024-07-30T12:48:41.128Z
---

# Stock Estimation Parameters

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

The Stock Estimation Parameters are applicable when making a request with  `type=stock_estimation`  to retrieve stock level and related information from the shopping cart for a single product on Amazon - the product is specified using the  `asin`  parameter. The parameters should be appended as querystring parameters to the Product Data API `GET` HTTP request.

Stock level data is retrieved from the shopping cart page for a single product on Amazon.&#x20;

**Four credits&#x20;**&#x61;re charged for this request due to the multiple internal requests required to retrieve this data.

:::hint{type="info"}
**Four Credits Charged per Request.**
Four credits are charged for this request due to the multiple internal requests required to retrieve this data.
:::

:::hint{type="info"}
**Stock for a Specific Seller Offer**
By default a Stock Estimation request will return data for the  **buybox winning offer**  for the passed ASIN.

To return stock estimation for a specific seller offer, rather than the buybox winner, you should pass the  `offer_id` , retrieved from a  `type=offers`  [offers](https://docs.trajectdata.com/rainforestapi/product-data-api/parameters/offers) request, in the stock estimation request's  `offer_id`  parameter.
Note that  `offer_id` 's are dynamic, and change over time, so it is recommended that you run your  `type=offers`  request to retrieve the  `offer_id`  directly before your stock estimation request.
:::

![](https://apiimages.imgix.net/rainforestapi/images/png/docs/stock_estimation.png?auto=format\&ixlib=react-9.5.1-beta.1\&w=600 "Stock Estimation Page")

For example to request stock-estimation data for the ASIN  `B073JYC4XM`  on  `amazon.com`  the request would be:

:::CodeblockTabs
HTTP

```HTTP
https://api.rainforestapi.com/request?api_key=demo&type=stock_estimation&amazon_domain=amazon.com&asin=B073JYC4XM
```

```curl
curl -L --get https://api.rainforestapi.com/request \
-d api_key="demo" \
-d type="stock_estimation" \
-d amazon_domain="amazon.com" \
-d asin="B073JYC4XM"
```

```nodejs
const axios = require('axios');

// set up the request parameters
const params = {
  api_key: "demo",
  type: "stock_estimation",
  amazon_domain: "amazon.com",
  asin: "B073JYC4XM"
}

// make the http GET request to Rainforest API
axios.get('https://api.rainforestapi.com/request', { params })
  .then(response => {

    // print the JSON response from Rainforest 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': 'stock_estimation',
  'amazon_domain': 'amazon.com',
  'asin': 'B073JYC4XM'
}

# make the http GET request to Rainforest API
api_result = requests.get('https://api.rainforestapi.com/request', params)

# print the JSON response from Rainforest API
print(json.dumps(api_result.json()))
```

```php
<?php
      
# set up the request parameters
$queryString = http_build_query([
  'api_key' => 'demo',
  'type' => 'stock_estimation',
  'amazon_domain' => 'amazon.com',
  'asin' => 'B073JYC4XM'
]);

# make the http GET request to Rainforest API
$ch = curl_init(sprintf('%s?%s', 'https://api.rainforestapi.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 Rainforest API
echo $api_result;

?>
```
:::

***

### Stock Estimation Parameters

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

| *`Parameter`*     | *`Required`* | *`Description`*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *`amazon_domain`* | *`optional`* | The Amazon domain on which to perform the stock estimation for the product specified in the `asin` parameter. For a full list of supported Amazon domains see [Supported Amazon Domains ](https://docs.trajectdata.com/rainforestapi/product-data-api/reference/amazon-domains).                                                                                                                                                                                                                                                                                                                                                      |
| *`asin`*          | *`optional`* | The Amazon ASIN (product ID) to perform the stock estimation on. Used in combination with the `amazon_domain` parameter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| *`offer_id`*      | *`optional`* | By default a Stock Estimation request will return data for the **buybox winning offer** for the passed ASIN.  <br />To return stock estimation for a specific seller offer, rather than the buybox winner, you should pass the `offer_id` , retrieved from a `type=offers` [offers ](https://docs.trajectdata.com/rainforestapi/product-data-api/parameters/offers)request, in the stock estimation request's `offer_id` parameter. Note that `offer_id` 's are dynamic, and change over time, so it is recommended that you run your `type=offers` request to retrieve the `offer_id` directly before your stock estimation request. |

***

**Next Steps**
     [Stock Estimation Results](https://docs.trajectdata.com/rainforestapi/product-data-api/results/stock-estimation)
