Analytics API¶
The Analytics API provides endpoints for workbook metrics calculation and data profiling for analytics visualizations.
Overview¶
CalcBridge analytics provides:
- Workbook Metrics: Calculate and retrieve portfolio-level metrics
- Data Profiling: Statistical analysis and distribution information for visualization
Endpoints¶
Get Workbook Metrics¶
Get calculated metrics for a workbook.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
workbook_id | string (UUID) | Workbook identifier |
Response¶
[
{
"metric_name": "total_par",
"value": 450000000.00,
"unit": "USD",
"calculated_at": "2026-01-25T10:30:00Z"
},
{
"metric_name": "weighted_average_spread",
"value": 385.5,
"unit": "bps",
"calculated_at": "2026-01-25T10:30:00Z"
}
]
Calculate Metrics¶
Trigger calculation of metrics for a workbook.
Response (201 Created)¶
{
"job_id": "calc_abc123",
"workbook_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"message": "Metric calculation started"
}
Get Workbook Profile¶
Get workbook profile data for analytics visualizations.
Query Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
sample_size | integer | 500 | Sample rows (50-5000) |
max_columns | integer | 30 | Maximum columns to profile (5-200) |
max_top_values | integer | 5 | Top values per column (1-20) |
Response¶
{
"workbook_id": "550e8400-e29b-41d4-a716-446655440000",
"row_count": 150,
"column_count": 45,
"columns": [
{
"name": "par_value",
"dtype": "float64",
"non_null_count": 150,
"null_count": 0,
"mean": 3000000.00,
"std": 1500000.00,
"min": 500000.00,
"max": 10000000.00
}
],
"profiled_at": "2026-01-25T10:30:00Z"
}
Related Documentation¶
- Workbooks API - Source workbook management
- Calculations API - Formula evaluation