Get Data Report
get_data_reportReport actual stored dataset values over any date range or granularity, grouped by brand, channel, or dimension, using declared metric roles instead of model training windows.
Instructions
Report actual data from a stored dataset: any window, any grain, by brand, channel or dimension.
Reads the dataset itself (every column, any date range) rather than a fitted model's training window. Use it for "sales and TV spend in the North region for August, by week".
Roles are DECLARED, never guessed from column names. Declare them with upload_data(roles=...)
or per request with roles. Without a declaration only the schema's own naming rules apply:
a column named date, {channel}_spend and {channel}_activity. Every other column is
reported as role "unknown" and is not aggregated — declare the KPI and hierarchy columns.
Role vocabulary (aggregation, unit) — also in get_data_schema under x-simba-roles:
kpi (sum), spend (sum, currency), activity (sum), multiplier (mean)
outcome:online_sales|store_sales|margin (sum, currency), outcome:orders|new_customers (sum)
media:impressions|clicks|grps (sum; give a channel: {"role": "media:grps", "channel": "tv"})
control:price|rate|index (mean), control:stock (each brand's last value, summed)
hierarchy, dimension:market|product|campaign (keys for filtering and group_by)
date
Buckets: week = ISO week from Monday; month/quarter = calendar. A weekly row counts in the month of its week-start date. The response's meta.aggregation states every rule applied.
Args: dataset_id: The uploaded file id (from upload_data or list_uploads). Registered pipeline outputs are uploaded files too. start, end: Optional ISO dates (YYYY-MM-DD), inclusive. granularity: "native" (default), "week", "month" or "quarter". group_by: "hierarchy", "channel", or a dimension role such as "dimension:market". hierarchy: Keep only this brand/region value. metrics: Roles or role families to include, e.g. ["kpi", "spend", "outcome:orders"] or ["control"]. Default: every metric role present. roles: {column: role | {"role", "channel"}} overriding roles stored at upload.
Returns {dataset: {id, name, source, version, sha256, data_through}, granularity, rows: [{period_start, period_end, group, metric, value, unit}], meta: {basis: "dataset", aggregation, roles, channels}}. Errors carry a code: dataset_not_found (404), invalid_report_request (400), report_too_large (413, over 10,000 rows — narrow the window or coarsen the granularity).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| roles | No | ||
| start | No | ||
| metrics | No | ||
| group_by | No | ||
| hierarchy | No | ||
| dataset_id | Yes | ||
| granularity | No | native |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||