# Category Products

Returns products within a specific category, with visibility metrics, ranking, and pricing information.

## Request

```
GET /v1/commerce/categories/{topicId}/products
```

### Path Parameters

| Parameter | Type          | Required | Description       |
| --------- | ------------- | -------- | ----------------- |
| `topicId` | string (UUID) | Yes      | Category/topic ID |

### 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                            |
| ----------------- | ----------------- | -------- | ------------ | -------------------------------------- |
| `sortBy`          | string            | No       | `visibility` | Sort order: `visibility` or `trending` |
| `limit`           | integer           | No       | 50           | Items per page (max 100)               |
| `offset`          | integer           | No       | 0            | Pagination offset                      |
| `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
{
  "products": [
    {
      "entity": "Widget Pro X1",
      "visibilityPercentage": 78.3,
      "visibilityChange": 4.2,
      "typicalRank": 1,
      "price": "2499.00",
      "currency": "USD",
      "imageUrl": "https://cdn.example.com/product-a1.jpg"
    },
    {
      "entity": "Widget Lite S2",
      "visibilityPercentage": 56.1,
      "visibilityChange": -1.3,
      "typicalRank": 3,
      "price": "899.00",
      "currency": "USD",
      "imageUrl": null
    }
  ],
  "totalCount": 34,
  "category": {
    "topicId": "550e8400-e29b-41d4-a716-446655440030"
  }
}
```

### Fields

| Field                             | Type           | Description                              |
| --------------------------------- | -------------- | ---------------------------------------- |
| `products`                        | array          | List of products in this category        |
| `products[].entity`               | string         | Product name                             |
| `products[].visibilityPercentage` | number         | Product visibility score                 |
| `products[].visibilityChange`     | number or null | Change from previous period              |
| `products[].typicalRank`          | integer        | Typical ranking position in AI responses |
| `products[].price`                | string or null | Product price                            |
| `products[].currency`             | string or null | Price currency code                      |
| `products[].imageUrl`             | string or null | Product image URL                        |
| `totalCount`                      | integer        | Total products in this category          |
| `category.topicId`                | string (UUID)  | Category ID                              |

## Examples

### curl

```bash
curl "https://app.limy.ai/api/v1/commerce/categories/{topicId}/products?\
sortBy=visibility&limit=10" \
  -H "X-API-Key: YOUR_API_KEY"
```

### Python

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

data = response.json()
print(f"Total products: {data['totalCount']}")
for product in data['products']:
    print(f"  #{product['typicalRank']} {product['entity']}: {product['visibilityPercentage']}%")
```

### JavaScript

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

const { products, totalCount } = await response.json();
console.log(`${totalCount} products`);
products.forEach(p =>
  console.log(`  #${p.typicalRank} ${p.entity}: ${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/category-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.
