---
title: "Get products in demand report"
description: "Retrieve a paginated list of product variants with demand metrics based on customer intents. Returns aggregated data showing total intents, pending intents, and last requested date for each variant. Results can be filter"
url: https://docs.stoqapp.com/v1/back-in-stock/get-products-in-demand-report/
api: "API v1 (legacy)"
method: GET
path: "/external/intents/products_in_demand"
---

# Get products in demand report

`GET https://app.stoqapp.com/api/v1/external/intents/products_in_demand`

Retrieve a paginated list of product variants with demand metrics based on customer intents.
Returns aggregated data showing total intents, pending intents, and last requested date for each variant.
Results can be filtered by date range and sorted by different metrics.

## Query parameters

- `start_date` (string): Filter by start date (YYYY-MM-DD). Filters based on last_requested_at field.
- `end_date` (string): Filter by end date (YYYY-MM-DD). Filters based on last_requested_at field.
- `sort_by` (string): Sort results by pending intents, total intents, or last requested date One of: `pending`, `total`, `last_requested_at`.
- `direction` (string): Sort direction (ascending or descending) One of: `asc`, `desc`.
- `page` (integer): Page number for pagination
- `per_page` (integer): Number of items per page (maximum 500)
- `intent_type` (string): Filter by intent type (used when loading product data)

## Headers

- `X-Auth-Token` (string, required): API key for authentication

## Returns

- `product_variants_in_demand` (array of objects)
  - `shopify_variant_id` (integer): Shopify variant identifier
  - `shopify_product_id` (integer): Shopify product identifier
  - `shopify_inventory_item_id` (integer, nullable): Shopify inventory item identifier
  - `total` (integer): Total number of intents (both pending and sent) for this variant
  - `pending` (integer): Number of pending (unsent) intents for this variant
  - `last_requested_at` (string, nullable): Timestamp of the most recent intent created for this variant
  - `product_data` (object, nullable): Shopify product data including variants
    - `id` (integer): Shopify product ID
    - `title` (string): Product title
    - `vendor` (string): Product vendor/brand
    - `variants` (array of objects): Array of product variants
      - `id` (integer): Shopify variant ID
      - `title` (string): Variant title (e.g., &quot;Medium / Red&quot;)
      - `sku` (string): Variant SKU
  - `variant_data` (object, nullable): Specific variant data for this demand entry
    - `id` (integer): Shopify variant ID
    - `title` (string): Variant title (e.g., &quot;Medium / Red&quot;)
    - `sku` (string): Variant SKU
- `page` (integer): Current page number
- `per_page` (integer): Number of items per page
- `has_next_page` (boolean): Whether there is a next page
- `has_prev_page` (boolean): Whether there is a previous page

Rate limit: this call costs 1 point ([rate limits](https://docs.stoqapp.com/docs/rate-limits/)).

## Examples

### Get products in demand report

```sh
curl "https://app.stoqapp.com/api/v1/external/intents/products_in_demand" \
  -H "X-Auth-Token: $STOQ_API_KEY"
```

### Get products in demand report filtered by sort_by and direction

```sh
curl "https://app.stoqapp.com/api/v1/external/intents/products_in_demand?sort_by=pending&direction=desc" \
  -H "X-Auth-Token: $STOQ_API_KEY"
```

## 200

A paginated list of product variants with demand metrics

```json
{
  "product_variants_in_demand": [
    {
      "shopify_variant_id": 43900910010503,
      "shopify_product_id": 7891234567890,
      "total": 42,
      "pending": 37,
      "last_requested_at": "2026-06-24T09:12:00Z",
      "variant_data": {
        "id": 43900910010503,
        "title": "Medium / Red",
        "sku": "TSHIRT-M-RED"
      },
      "product_data": {
        "id": 7891234567890,
        "title": "Classic T-Shirt",
        "vendor": "Acme"
      }
    }
  ],
  "page": 1,
  "per_page": 25,
  "has_next_page": true,
  "has_prev_page": false
}
```

## 400

Bad request - invalid parameters

## 401

Unauthorized

