# Get products in demand report

## Get products in demand report

> 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.<br>

```json
{"openapi":"3.0.3","info":{"title":"Back in Stock Intents API","version":"1.0.0"},"servers":[{"url":"https://app.stoqapp.com/api/v1/external","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Auth-Token"}},"schemas":{"ProductVariantDemand":{"type":"object","description":"Product variant with demand metrics and product data","properties":{"shopify_variant_id":{"type":"integer","description":"Shopify variant identifier"},"shopify_product_id":{"type":"integer","description":"Shopify product identifier"},"shopify_inventory_item_id":{"type":"integer","nullable":true,"description":"Shopify inventory item identifier"},"total":{"type":"integer","description":"Total number of intents (both pending and sent) for this variant"},"pending":{"type":"integer","description":"Number of pending (unsent) intents for this variant"},"last_requested_at":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp of the most recent intent created for this variant"},"product_data":{"type":"object","nullable":true,"description":"Shopify product data including variants","properties":{"id":{"type":"integer","description":"Shopify product ID"},"title":{"type":"string","description":"Product title"},"vendor":{"type":"string","description":"Product vendor/brand"},"variants":{"type":"array","description":"Array of product variants","items":{"type":"object","properties":{"id":{"type":"integer","description":"Shopify variant ID"},"title":{"type":"string","description":"Variant title (e.g., \"Medium / Red\")"},"sku":{"type":"string","description":"Variant SKU"}}}}}},"variant_data":{"type":"object","nullable":true,"description":"Specific variant data for this demand entry","properties":{"id":{"type":"integer","description":"Shopify variant ID"},"title":{"type":"string","description":"Variant title (e.g., \"Medium / Red\")"},"sku":{"type":"string","description":"Variant SKU"}}}}}}},"paths":{"/intents/products_in_demand":{"get":{"summary":"Get products in demand report","description":"Retrieve a paginated list of product variants with demand metrics based on customer intents.\nReturns aggregated data showing total intents, pending intents, and last requested date for each variant.\nResults can be filtered by date range and sorted by different metrics.\n","tags":["Intents"],"parameters":[{"in":"header","name":"X-Auth-Token","required":true,"schema":{"type":"string"},"description":"API key for authentication"},{"in":"query","name":"start_date","schema":{"type":"string","format":"date"},"description":"Filter by start date (YYYY-MM-DD). Filters based on last_requested_at field."},{"in":"query","name":"end_date","schema":{"type":"string","format":"date"},"description":"Filter by end date (YYYY-MM-DD). Filters based on last_requested_at field."},{"in":"query","name":"sort_by","schema":{"type":"string","enum":["pending","total","last_requested_at"],"default":"pending"},"description":"Sort results by pending intents, total intents, or last requested date"},{"in":"query","name":"direction","schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort direction (ascending or descending)"},{"in":"query","name":"page","schema":{"type":"integer","default":1},"description":"Page number for pagination"},{"in":"query","name":"per_page","schema":{"type":"integer","default":25,"maximum":500},"description":"Number of items per page (maximum 500)"},{"in":"query","name":"intent_type","schema":{"type":"string"},"description":"Filter by intent type (used when loading product data)"}],"responses":{"200":{"description":"A paginated list of product variants with demand metrics","content":{"application/json":{"schema":{"type":"object","properties":{"product_variants_in_demand":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariantDemand"}},"page":{"type":"integer","description":"Current page number"},"per_page":{"type":"integer","description":"Number of items per page"},"has_next_page":{"type":"boolean","description":"Whether there is a next page"},"has_prev_page":{"type":"boolean","description":"Whether there is a previous page"}}}}}},"400":{"description":"Bad request - invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized"}}}}}}
```
