---
title: "Get Databricks cost trends by product over time"
method: GET
path: "/api/v1/databricks/cost/trends/by-product"
tags: ["DATABRICKS", "Databricks", "Databricks Cost"]
---

# Get Databricks cost trends by product over time

`GET /api/v1/databricks/cost/trends/by-product`

## Request

- Base URL: `https://api.myaltimate.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.myaltimate.com/api/v1/databricks/cost/trends/by-product`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Get cost trends over time, sliced for a UI category.

Returns time series data with DBU consumption and estimated cost per
period, with each row labelled by the category's chosen segment. The
``products`` array in the response is the canonical legend for the
category (in display order, including segments with no data) so the FE
legend stays stable across date ranges.

## Query parameters

- `start_date` string, date, required: Start date for the period
- `end_date` string, date: End date for the period
- `granularity` string: Time granularity: 'day', 'week', or 'month'
- `workspace_id` string, nullable: Filter by workspace ID
- `category` 'total' | 'clusters' | 'sql_warehouse' | 'ai_ml' | 'lakehouse' | 'platform': Spec-group category identifier shared across the cost APIs. Used by: * ``GET /cost/trends/by-product?category=<value>`` — selects which products get filtered in and how each row's segment label is computed. * ``GET /cost/overview`` — each ``category_breakdown`` item carries one of these values. See ``CATEGORY_DEFINITIONS`` in ``app.service.databricks.cost_constants`` for the per-category filter list, segment label expression, and canonical legend order.
- `navigationSource` string, nullable

## Headers

- `x-tenant` string, required

## Response `200`

Successful Response

- ProductTrendsResponse: Response model for cost trends by product endpoint.
  - `trends` ProductTrendItem[], required: List of trend data by product
    - `period` string, required: Period label (date or week/month)
    - `product` string, required: Product name (JOBS, SQL, etc.)
    - `total_dbus` number, required: Total DBUs for this period+product
    - `estimated_cost` number, required: Estimated cost for this period+product
  - `products` string[], required: Canonical segment labels for the chart legend, in display order. When called with a ``category``, this is the full set of expected segments for that category — empty segments are still included so the legend stays stable across date ranges.
  - `granularity` string, required: Time granularity (day/week/month)
  - `category` 'total' | 'clusters' | 'sql_warehouse' | 'ai_ml' | 'lakehouse' | 'platform': Spec-group category identifier shared across the cost APIs. Used by: * ``GET /cost/trends/by-product?category=<value>`` — selects which products get filtered in and how each row's segment label is computed. * ``GET /cost/overview`` — each ``category_breakdown`` item carries one of these values. See ``CATEGORY_DEFINITIONS`` in ``app.service.databricks.cost_constants`` for the per-category filter list, segment label expression, and canonical legend order.

## Other responses

- `403`: Not authorized
- `404`: No ClickHouse database configured
- `422`: Validation Error

---

[API](https://skmtc.dev/myaltimate/apis/myaltimate-api.md) - [All operations](https://skmtc.dev/myaltimate/apis/myaltimate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/myaltimate/apis/myaltimate-api/revisions/727657ce54e9?raw)
