> ## Documentation Index
> Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Top Products

> Best-selling products and product-view metrics for the requested range.

Top-selling products by units sold plus aggregate product/category view
metrics for the requested date range.

**Required scope:** `read_analytics`

## Query Parameters

<ParamField query="range" type="string" default="last_7_days">
  Predefined range (same options as `/summary`).
</ParamField>

<ParamField query="start" type="string">Custom range start (ISO 8601).</ParamField>
<ParamField query="end" type="string">Custom range end (ISO 8601).</ParamField>

<ParamField query="limit" type="number" default="10">
  Page size (1–100).
</ParamField>

<ParamField query="page" type="number" default="1">Page number.</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="top products">
    <ResponseField name="topProductsByUnitSold" type="array">
      Sorted by units sold descending.
    </ResponseField>

    <ResponseField name="productViewCount" type="number">Distinct products viewed.</ResponseField>
    <ResponseField name="totalProductViews" type="number">Total product page views.</ResponseField>
    <ResponseField name="totalProductViewcount" type="number">Total product view events.</ResponseField>
    <ResponseField name="productViewAverage" type="number">Avg views per product.</ResponseField>
    <ResponseField name="productCountsByDay" type="object">Map of date → product views.</ResponseField>
    <ResponseField name="topRatedProductName" type="string">Highest-rated product in range.</ResponseField>
    <ResponseField name="categoryViewCount" type="number">Distinct categories viewed.</ResponseField>
    <ResponseField name="totalcategoryview" type="number">Total category page views.</ResponseField>
    <ResponseField name="categoryViewAverage" type="number">Avg views per category.</ResponseField>
    <ResponseField name="topRatedCategoryName" type="string">Highest-rated category in range.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status": 200,
    "state": "success",
    "message": null,
    "data": {
      "topProductsByUnitSold": [],
      "productViewCount": 0,
      "totalProductViews": 0,
      "totalProductViewcount": 0,
      "productViewAverage": 0,
      "productCountsByDay": {},
      "topRatedProductName": "",
      "categoryViewCount": 0,
      "totalcategoryview": 0,
      "categoryViewAverage": 0,
      "topRatedCategoryName": ""
    },
    "pagination": null
  }
  ```
</ResponseExample>
