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

# Analytics timeseries [+]

> Bucketed revenue and order series for a window and its previous window, ready to chart.

Revenue and order counts bucketed over time, for the requested window **and** the equivalent previous window, so you can draw "current vs previous" comparison charts directly. The bucket size adapts to the window: hourly for day windows, daily for week/month windows, monthly for the year.

<Info>
  **Tier:** Premium, requires a premium key **and** an active Branding+ subscription (checked on every request).
</Info>

## Request

```bash theme={null}
curl "https://nmcrate.com/api/public/v1/studio/analytics/timeseries?period=last7d" \
  -H "x-api-key: nmk_studio_..."
```

### Query parameters

| Parameter | Type   | Default  | Description                                                                                                             |
| --------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `period`  | string | `last7d` | `today`, `yesterday` (hourly) · `last7d`, `last30d`, `last90d`, `thisWeek`, `thisMonth` (daily) · `thisYear` (monthly). |

## Response

```json theme={null}
{
  "period": "last7d",
  "bucket": "day",
  "currency": "USD",
  "current": {
    "range": { "start": "2026-07-07T00:00:00.000Z", "end": "2026-07-13T23:59:59.999Z" },
    "labels": ["Jul 7", "Jul 8", "Jul 9", "Jul 10", "Jul 11", "Jul 12", "Jul 13"],
    "revenue": [42.5, 0, 118.97, 59.98, 12.99, 84.5, 25.98],
    "orders": [3, 0, 8, 4, 1, 6, 2],
    "totalRevenue": 344.92,
    "totalOrders": 24
  },
  "previous": {
    "range": { "start": "2026-06-30T00:00:00.000Z", "end": "2026-07-06T23:59:59.999Z" },
    "labels": ["Jun 30", "Jul 1", "Jul 2", "Jul 3", "Jul 4", "Jul 5", "Jul 6"],
    "revenue": [0, 29.99, 15.0, 89.97, 0, 44.5, 9.99],
    "orders": [0, 2, 1, 6, 0, 3, 1],
    "totalRevenue": 189.45,
    "totalOrders": 13
  },
  "deltas": {
    "revenue": 82.1,
    "orders": 84.6
  }
}
```

| Field             | Description                                                                         |
| ----------------- | ----------------------------------------------------------------------------------- |
| `bucket`          | `hour`, `day`, or `month`, derived from `period`.                                   |
| `current.labels`  | Human-readable x-axis labels; empty buckets are included so the axis is continuous. |
| `current.revenue` | Net revenue per bucket, numbers in USD dollars.                                     |
| `deltas`          | Percentage change of the window totals vs the previous window.                      |

## Errors

| HTTP | Code                    | When                                                             |
| ---- | ----------------------- | ---------------------------------------------------------------- |
| 403  | `PREMIUM_KEY_REQUIRED`  | The key is basic-tier.                                           |
| 403  | `SUBSCRIPTION_INACTIVE` | Premium key, but the Branding+ subscription is no longer active. |
