Query Widget Data
POSThttps://api.confident-ai.com/v1/dashboards/{dashboardId}/widgets/{widgetId}/query
Fetches computed data for one widget. Request time range fields override widget defaults for this query only.
curl -X POST "https://api.confident-ai.com/v1/dashboards/{dashboardId}/widgets/{widgetId}/query" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"startTime": "2024-01-01T00:00:00.000Z",
"endTime": "2024-01-31T23:59:59.999Z",
"granularity": "day"
}'{
"success": true,
"data": {
"widgetId": "WIDGET-ID",
"type": "LINE",
"mode": "TIME_SERIES",
"kind": "TIME_SERIES",
"unit": "COUNT",
"xAxis": {
"type": "time"
},
"series": [
{
"key": "Count",
"name": "Count",
"color": "BLUE",
"lineId": "LINE-ID",
"points": [
{
"x": "2024-01-01T00:00:00.000Z",
"y": 42
}
]
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
dashboardIdstringRequiredThe id of the dashboard.
widgetIdstringRequiredThe id of the widget.
Request body
startTimestringISO 8601 start time for the query range. Must be provided with
endTime.endTimestringISO 8601 end time for the query range. Must be provided with
startTime.granularityenumOptional bucket granularity override for the query.
Show 5 enum valuesHide 5 enum values
thirty_minuteshourdayweekmonth
Response
The computed data for the requested widget.
successbooleanIndicates if the request was successful.
dataobjectThe computed widget data.
Show 10 propertiesHide 10 properties
widgetIdstringThe id of the queried widget.
typeenumThe widget's visualization (display) type, echoed from its configuration. This is how the widget is drawn and does not determine which data fields are populated — use
kindfor that.Show 6 enum valuesHide 6 enum values
LINEAREABARSTACKED_BARTABLEBIG_NUMBER
modeenumThe widget's configured aggregation mode, echoed from its configuration. When reading the response, branch on
kindrather thanmode.Show 2 enum valuesHide 2 enum values
TIME_SERIESDIMENSION_SERIES
kindenumThe shape of the data in this response, and the field you should branch on when reading it.
TIME_SERIESandDIMENSIONpopulateseries(withxAxis.typetimeandcategoryrespectively);BIG_NUMBERpopulatesvalues;TABLEpopulatescolumnsandrows. It is derived fromtypeandmode, so it can differ frommode— e.g. aDIMENSION_SERIESwidget displayed as aTABLEreturnskind: TABLE.Show 4 enum valuesHide 4 enum values
TIME_SERIESDIMENSIONBIG_NUMBERTABLE
unitenumUnit for the returned values, when applicable.
Show 6 enum valuesHide 6 enum values
COUNTPERCENTSCORESECONDSUSDMILLISECONDS
xAxisobjectPresent for TIME_SERIES and DIMENSION data.
Show 1 propertyHide 1 property
typeenumAxis type for the returned data.
Show 2 enum valuesHide 2 enum values
timecategory
serieslist of objectsPresent for TIME_SERIES and DIMENSION data.
Show 5 propertiesHide 5 properties
keystringStable key that uniquely identifies this series within the result. Use it to correlate series across queries or as a render key.
namestringDisplay name for the series.
colorstringDisplay color for the series.
lineIdstringThe line id that produced this series, when applicable.
pointslist of objectsPoints in this series.
Show 2 propertiesHide 2 properties
xstringTime bucket start or category label.
ynumberNumeric value for the series at this point, or null when no data is available.
valueslist of objectsPresent for BIG_NUMBER data.
Show 5 propertiesHide 5 properties
keystringStable key that uniquely identifies this value within the result.
namestringDisplay name for the value.
colorstringDisplay color for the value.
lineIdstringThe line id that produced this value, when applicable.
valuenumberScalar value, or null when no data is available.
columnslist of objectsColumn definitions for TABLE data. The first column is the dimension (key
dimension); the remaining columns are one per line, keyed by the line's name.Show 2 propertiesHide 2 properties
keystringStable column key. Read each row's value for this column as
row[key].labelstringDisplay label for the column.
rowslist of objectsPresent for TABLE data.
deprecatedbooleanIndicates if this endpoint is deprecated.