Launch Week 02 wrapped — explore all five launches

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.

POST/v1/dashboards/{dashboardId}/widgets/{widgetId}/query
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"
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • dashboardIdstringRequired

    The id of the dashboard.

  • widgetIdstringRequired

    The id of the widget.

Request body

  • startTimestring

    ISO 8601 start time for the query range. Must be provided with endTime.

  • endTimestring

    ISO 8601 end time for the query range. Must be provided with startTime.

  • granularityenum

    Optional bucket granularity override for the query.

    Show 5 enum valuesHide 5 enum values
    • thirty_minutes
    • hour
    • day
    • week
    • month

Response

The computed data for the requested widget.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    The computed widget data.

    Show 10 propertiesHide 10 properties
    • widgetIdstring

      The id of the queried widget.

    • typeenum

      The 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 kind for that.

      Show 6 enum valuesHide 6 enum values
      • LINE
      • AREA
      • BAR
      • STACKED_BAR
      • TABLE
      • BIG_NUMBER
    • modeenum

      The widget's configured aggregation mode, echoed from its configuration. When reading the response, branch on kind rather than mode.

      Show 2 enum valuesHide 2 enum values
      • TIME_SERIES
      • DIMENSION_SERIES
    • kindenum

      The shape of the data in this response, and the field you should branch on when reading it. TIME_SERIES and DIMENSION populate series (with xAxis.type time and category respectively); BIG_NUMBER populates values; TABLE populates columns and rows. It is derived from type and mode, so it can differ from mode — e.g. a DIMENSION_SERIES widget displayed as a TABLE returns kind: TABLE.

      Show 4 enum valuesHide 4 enum values
      • TIME_SERIES
      • DIMENSION
      • BIG_NUMBER
      • TABLE
    • unitenum

      Unit for the returned values, when applicable.

      Show 6 enum valuesHide 6 enum values
      • COUNT
      • PERCENT
      • SCORE
      • SECONDS
      • USD
      • MILLISECONDS
    • xAxisobject

      Present for TIME_SERIES and DIMENSION data.

      Show 1 propertyHide 1 property
      • typeenum

        Axis type for the returned data.

        Show 2 enum valuesHide 2 enum values
        • time
        • category
    • serieslist of objects

      Present for TIME_SERIES and DIMENSION data.

      Show 5 propertiesHide 5 properties
      • keystring

        Stable key that uniquely identifies this series within the result. Use it to correlate series across queries or as a render key.

      • namestring

        Display name for the series.

      • colorstring

        Display color for the series.

      • lineIdstring

        The line id that produced this series, when applicable.

      • pointslist of objects

        Points in this series.

        Show 2 propertiesHide 2 properties
        • xstring

          Time bucket start or category label.

        • ynumber

          Numeric value for the series at this point, or null when no data is available.

    • valueslist of objects

      Present for BIG_NUMBER data.

      Show 5 propertiesHide 5 properties
      • keystring

        Stable key that uniquely identifies this value within the result.

      • namestring

        Display name for the value.

      • colorstring

        Display color for the value.

      • lineIdstring

        The line id that produced this value, when applicable.

      • valuenumber

        Scalar value, or null when no data is available.

    • columnslist of objects

      Column 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
      • keystring

        Stable column key. Read each row's value for this column as row[key].

      • labelstring

        Display label for the column.

    • rowslist of objects

      Present for TABLE data.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI