---
title: "Get a chart's data"
method: GET
path: "/api/v3/charts/{chartId}/data"
tags: ["V3 Charts"]
---

# Get a chart's data

`GET /api/v3/charts/{chartId}/data`

## Request

- Base URL: `https://app.formbricks.com`
- URL: `https://app.formbricks.com/api/v3/charts/{chartId}/data`
- Auth: one of:
  - API key in cookie `next-auth.session-token`
  - API key in header `x-api-key`
  - HTTP bearer

Runs a saved chart and returns its rows — the endpoint every dashboard widget loads its data
from. A date range given here replaces the chart's own range on `FeedbackRecords.collectedAt`,
exactly as a dashboard's date filter does, so the numbers match what a person sees on a
dashboard filtered the same way. `dateRange=all-time` removes the range; without a date range
the chart's saved range applies. Every range is read in the organization's display time zone;
a `timezone` parameter is refused with 400. For a chart grouped by time alone, a requested
range that spans more than 10,000 buckets of its granularity answers 422 `limit_exceeded` on
`dateRange`: request a shorter range, or use a chart with a coarser granularity.

Needs read access to the chart's workspace and to its Feedback Dataset. Counts against the
chart-query budget (600 per minute, 20 at once, per user or API key), not the v3 default.

## Path parameters

- `chartId` string, cuid2, required

## Query parameters

- `dateRange` string
- `from` string, date
- `to` string, date

## Response `200`

The chart's rows

- object
  - `data` ChartData, required: What a chart query returns: one row per group, keyed by field name, the label maps to display stored ids with, and the query as it ran.
    - `rows` object[], required
    - `optionLabels` object, required: Choice option ids to their labels in the survey's default language, in survey order. Filled when the rows group by `FeedbackRecords.valueId` (or a `valueText` grouping the server rewrote to it); empty otherwise.
    - `fieldLabels` object, required: Matrix row field ids (`<elementId>__<rowId>`) to their statements, in survey order. Filled when the rows group by `FeedbackRecords.fieldId` over matrix questions; empty otherwise.
    - `query` object, required: The query as it ran: after the requested date range replaced the saved one, and after a `valueText` grouping on a single-choice question was rewritten to `valueId`. The row keys follow this query.

## Other responses

- `400`: Bad Request — malformed JSON, invalid query/body/params, duplicate name, or unsupported field.
- `401`: Not authenticated (no valid session or API key).
- `403`: Forbidden. `code: forbidden` when the caller has no access to the workspace, the Feedback Dataset or the resource (which may also not exist; 404 is not used, to avoid leaking existence). `code: dashboards_plan_required` when the caller is authorized but the organization does not have the Dashboards add-on or a license that includes it — checked after authorization, so a caller without access never learns the organization's plan.
- `422`: Unprocessable Content — semantic validation failed or the requested lifecycle transition is invalid.
- `429`: Too Many Requests (`code: too_many_requests`). Chart data, preview and field-value lookups share one budget of 600 requests per minute per user or API key, separate from the 100 per minute of the rest of v3, so a dashboard can load every widget's data. At most 20 of them run at once per user or key; past that the answer is 429 with `Retry-After: 1`. `Retry-After` says when to retry.
- `500`: Internal Server Error.
- `502`: Bad Gateway (`code: bad_gateway`) — the chart query could not be run: the analytics engine was unreachable, refused it, or it ran longer than the one-minute limit and was stopped. The engine's own error is never returned. Retrying later is safe; a query that timed out needs a narrower date range or grouping.

## Changes

- **2026-10-28** `84820a01e550`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/formbricks/apis/formbricks-api-v3/changes/api/v3/charts/:chartId/data/get.md)

---

[API](https://skmtc.dev/formbricks/apis/formbricks-api-v3.md) - [All operations](https://skmtc.dev/formbricks/apis/formbricks-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/formbricks/apis/formbricks-api-v3/revisions/25335c959a13?raw)
