# Top Products

Returns the top products by visibility across all categories.

## Request

```
GET /v1/commerce/top-products
```

### Query Parameters

All [common filters](/getting-started/filtering.md) plus [commerce-specific filters](/getting-started/filtering.md#commerce-specific-filters):

| Parameter         | Type              | Required | Default     | Description                      |
| ----------------- | ----------------- | -------- | ----------- | -------------------------------- |
| `limit`           | integer           | No       | 5           | Number of top products to return |
| `startDate`       | string (ISO 8601) | No       | 30 days ago | Start of date range              |
| `endDate`         | string (ISO 8601) | No       | Today       | End of date range                |
| `providers`       | string\[]         | No       | All         | Filter by AI provider            |
| `shoppingIntents` | string\[]         | No       | All         | Filter by shopping intent        |

## Response

### Success (200 OK)

```json
[
  {
    "entity": "Widget Pro X1",
    "visibilityPercentage": 78.3,
    "topicId": "550e8400-e29b-41d4-a716-446655440030",
    "topicName": "PLCs & Controllers",
    "imageUrl": "https://cdn.example.com/product-a1.jpg"
  },
  {
    "entity": "Gizmo Drive Z3",
    "visibilityPercentage": 65.7,
    "topicId": "550e8400-e29b-41d4-a716-446655440031",
    "topicName": "Variable Frequency Drives",
    "imageUrl": null
  }
]
```

### Fields

| Field                  | Type           | Description                               |
| ---------------------- | -------------- | ----------------------------------------- |
| `entity`               | string         | Product name                              |
| `visibilityPercentage` | number         | Product visibility score                  |
| `topicId`              | string or null | Category/topic ID this product belongs to |
| `topicName`            | string or null | Category name                             |
| `imageUrl`             | string or null | Product image URL                         |

## Examples

### curl

```bash
curl "https://app.limy.ai/api/v1/commerce/top-products?limit=10" \
  -H "X-API-Key: YOUR_API_KEY"
```

### Python

```python
response = requests.get(
    f"https://app.limy.ai/api/v1/commerce/top-products",
    headers={"X-API-Key": API_KEY},
    params={"limit": 10}
)

for i, product in enumerate(response.json(), 1):
    print(f"{i}. {product['entity']} ({product['topicName']}): {product['visibilityPercentage']}%")
```

### JavaScript

```javascript
const response = await fetch(
  `https://app.limy.ai/api/v1/commerce/top-products?limit=10`,
  { headers: { 'X-API-Key': API_KEY } }
);

const products = await response.json();
products.forEach((p, i) =>
  console.log(`${i + 1}. ${p.entity} (${p.topicName}): ${p.visibilityPercentage}%`)
);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-reference.limy.ai/analytics/overview/top-products.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
