Get widget data
get_widget_dataRead the numbers behind data widgets, for charting them. Requires one of: widget_ids for specific widgets, or source_id for every data widget on a report. Returns one entry per widget: its name, its saved chart type, its state, and — once its fetch has landed — the metric and dimension labels, the period totals, the previous period's totals, and the rows. chart is the visualization the widget is saved as and the one the app renders: draw it as that. score is a single KPI value (read it from summary, not the rows), table is a table, map is geographic, and the rest are line / area / bar / column / pie / donut / funnel. Stored variants map to their family — spline and areaspline are line and area, stacked_ and 3d_ prefixes are the type they name. chart is present while a widget is still fetching too, so a placeholder can take the right shape. Pass widget_ids for the widgets a call touched, or source_id for every data widget on a report. A widget in state "loading" is still fetching and carries no rows yet — call again for it. "demo" means the datasource is not linked to the client and the numbers shown in the app are placeholders; "error" means its last fetch failed. Rows are capped at row_cap and truncated says whether any were cut. datasource_type says how to read the entry: a Static Value widget (CUSTOM_DATA) shows the value field and has no series; a GOALS widget plots its summary against the target, which list_goals holds; CALCULATION rows are keyed by the calculated metric id, whose name is the matching metric label. A metric that carries a symbol (percent, currency, decimal…) is formatted that way in the app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Wait up to 15 seconds for in-flight fetches to land, returning as soon as they all have. Default true | |
| row_cap | No | Rows returned per widget (default 200) | |
| source_id | No | Read every data widget on this report instead (report id from list_reports) | |
| widget_ids | No | Widgets to read (ids from list_widgets, or widget_id from add_data_widget). Up to 200 — use source_id for a whole report |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | One entry per widget — its name, state, the `chart` it is saved as, the metric and dimension labels, this period's summary totals, the previous period's, and the rows (capped at row_cap, with `truncated` saying whether any were cut). A widget in state "loading" is still fetching and carries no rows yet. | |
| success | Yes | True when the call succeeded. |