REST API for running epidemic simulations on epydemix.
Documentation and API reference: https://epydemix-webapi.vercel.app/docs
# Install dependencies
uv sync
# Run development server
uv run uvicorn app.main:app --reload
# Run tests
uv run pytestPOST /api/v1/simulations- Run epidemic simulationGET /api/v1/populations- List available populationsGET /api/v1/populations/{name}- Get population detailsGET /api/v1/populations/{name}/contacts- Get contact matricesGET /api/v1/models/presets- List model presetsGET /api/v1/health- Health check
# Build and run
docker compose up
# Development with hot reload
docker compose --profile dev up api-dev# List available populations
curl http://localhost:8000/api/v1/populations
# Run SIR simulation
curl -X POST http://localhost:8000/api/v1/simulations \
-H "Content-Type: application/json" \
-d '{
"model": {"preset": "SIR"},
"population": {"name": "United_States"},
"simulation": {
"start_date": "2024-01-01",
"end_date": "2024-03-01",
"Nsim": 100
}
}'API documentation and reference is available here.
Most API parameters follow epydemix conventions. Refer to the epydemix documentation for details on model parameters, population data, and simulation options.