Aggregates
Compute aggregate statistics from simulation results. Supports sums, means, and counts with optional filtering. Accepts a list of specifications.
List aggregates
GET
/outputs/aggregatesRetrieve all computed aggregates.
https://v2.api.policyengine.org/outputs/aggregates
Get aggregate
GET
/outputs/aggregates/:output_idRetrieve a specific aggregate result.
Path parameters
https://v2.api.policyengine.org/outputs/aggregates/880e8400-e29b-41d4-a716-446655440000
Create aggregates (batch)
POST
/outputs/aggregatesCreate multiple aggregates from a list of specifications. Worker will compute them.
Request body
https://v2.api.policyengine.org/outputs/aggregates
Aggregate specification
simulation_idUUID - Source simulationvariablestring - Variable name to aggregateaggregate_typesum | mean | countentitystring - Entity level (person, household, benunit, etc.)filter_configobject | null - Optional quantile filteringAggregate types
sumTotal across population (weighted)meanWeighted averagecountNumber of entities (weighted)