# Category Visibility

Returns visibility metrics for each product category, including visibility percentage, product count, trend data, and period-over-period changes.

## Request

```
GET /v1/commerce/categories
```

### 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               |
| ----------------- | ----------------- | -------- | ----------- | ------------------------- |
| `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
[
  {
    "topicId": "550e8400-e29b-41d4-a716-446655440030",
    "topicName": "Industrial Sensors",
    "slug": "industrial-sensors",
    "visibilityPercentage": 62.4,
    "visibilityChange": 5.1,
    "productCount": 34,
    "timeSeriesData": [
      {
        "bucketIndex": 0,
        "startDate": "2026-01-01",
        "endDate": "2026-01-31",
        "visibilityPercentage": 57.3
      }
    ]
  },
  {
    "topicId": "550e8400-e29b-41d4-a716-446655440031",
    "topicName": "PLCs & Controllers",
    "slug": "plcs-controllers",
    "visibilityPercentage": 48.9,
    "visibilityChange": -2.3,
    "productCount": 21,
    "timeSeriesData": [...]
  }
]
```

### Fields

| Field                  | Type           | Description                                 |
| ---------------------- | -------------- | ------------------------------------------- |
| `topicId`              | string (UUID)  | Category/topic ID                           |
| `topicName`            | string         | Category name                               |
| `slug`                 | string         | URL-friendly category slug                  |
| `visibilityPercentage` | number         | Current visibility in this category         |
| `visibilityChange`     | number or null | Change from previous period                 |
| `productCount`         | integer        | Number of tracked products in this category |
| `timeSeriesData`       | array          | Visibility trend over time                  |

## Examples

### curl

```bash
curl "https://app.limy.ai/api/v1/commerce/categories" \
  -H "X-API-Key: YOUR_API_KEY"
```

### Python

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

for cat in response.json():
    change = cat['visibilityChange'] or 0
    print(f"{cat['topicName']}: {cat['visibilityPercentage']}% ({change:+.1f}%), {cat['productCount']} products")
```

### JavaScript

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

const categories = await response.json();
categories.forEach(c =>
  console.log(`${c.topicName}: ${c.visibilityPercentage}% (${c.productCount} products)`)
);
```


---

# 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/categories.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.
