docsgetting-startedresponse-format

Response Format

All responses use a consistent JSON envelope. Successful responses return HTTP 200 with { success: true, data, metadata }. The metadata object always includes generated_at, period boundaries, record counts, and query_time_ms. Accuracy endpoints also echo metadata.accuracy_metric (high or low) when applicable. Date parameters (days, date_from, date_to) control the analysis window and are reflected in metadata.

cURL
// Success response (HTTP 200)
{
"success": true,
"data": {
"count": 20,
"mean_error": -1.2,
"std_dev": 2.8,
"mae": 2.1,
"rmse": 2.9
},
"metadata": {
"generated_at": "2026-02-20T23:55:00Z",
"period_start": "2026-01-21",
"period_end": "2026-02-20",
"days_analyzed": 30,
"total_records": 20,
"query_time_ms": 3,
"station_id": "KLAX"
}
}
// Error response (HTTP 4xx/5xx)
{
"success": false,
"error": "Station KXYZ not found",
"metadata": {
"generated_at": "2026-02-20T23:55:00Z",
"endpoint": "/api/v1/accuracy/summary"
}
}