Base URL:

Aggregates

Compute aggregate statistics from simulation results. Supports sums, means, and counts with optional filtering. Accepts a list of specifications.

List aggregates

GET/outputs/aggregates

Retrieve all computed aggregates.

https://v2.api.policyengine.org/outputs/aggregates

Get aggregate

GET/outputs/aggregates/:output_id

Retrieve a specific aggregate result.

Path parameters

https://v2.api.policyengine.org/outputs/aggregates/880e8400-e29b-41d4-a716-446655440000

Create aggregates (batch)

POST/outputs/aggregates

Create 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 simulation
variablestring - Variable name to aggregate
aggregate_typesum | mean | count
entitystring - Entity level (person, household, benunit, etc.)
filter_configobject | null - Optional quantile filtering

Aggregate types

sumTotal across population (weighted)
meanWeighted average
countNumber of entities (weighted)