/api/v1/custom-dashboards/{id}/widgets/{widgetId}/dataGet widget data
Returns a shape-normalized payload for the widget, computed fresh on every call (no caching; `Cache-Control` is not set). Requires `?projectId`, which is membership-verified before the handler runs; the widget must belong to the path dashboard and that dashboard to the project (403 otherwise). The widget's `data_source.source` selects the query — cost / cost-breakdown / latency / errors (over `traces`), usage / quality / score / percentage / distribution (over `eval_runs`), traces / evals / security row lists, activity (7x24 heatmap) and correlation (scatter) — and `data_source.days` (1-90, default 7) the window. Response is `{source, shape, data}` where shape is series | metric | categories | scatter | heat | rows, or `shape:"empty"` for an unrecognized source. Row caps: 5,000 per aggregate query, 20 for row lists, 200 for correlation, 10,000 for activity.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
id in pathrequiredstringwidgetId in pathrequiredstringResponse
200 example
{
"success": true
}All status codes
Code samples
cURL
# {id}, {widgetId} are shown with EXAMPLE values — replace them with real values.
curl -X GET \
https://evalguard.ai/api/v1/custom-dashboards/00000000-0000-0000-0000-000000000000/widgets/00000000-0000-0000-0000-000000000000/data \
-H "Authorization: Bearer $EVALGUARD_API_KEY"TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {id}, {widgetId} are shown with EXAMPLE values — replace them with real values.
const res = await fetch("https://evalguard.ai/api/v1/custom-dashboards/00000000-0000-0000-0000-000000000000/widgets/00000000-0000-0000-0000-000000000000/data", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {id}, {widgetId} are shown with EXAMPLE values — replace them with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("GET", "https://evalguard.ai/api/v1/custom-dashboards/00000000-0000-0000-0000-000000000000/widgets/00000000-0000-0000-0000-000000000000/data", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
// {id}, {widgetId} are shown with EXAMPLE values — replace them with real values.
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/custom-dashboards/00000000-0000-0000-0000-000000000000/widgets/00000000-0000-0000-0000-000000000000/data", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}