Skip to content

app.routers.ancillary

ancillary

Ancillary services: aFRR/FCR capacity prices, volumes, revenue.

get_imbalance_prices async

get_imbalance_prices(request: Request, response: Response, start: str = Query(...), end: str = Query(...), max_points: int = Query(8000, ge=10, le=50000))

aFRR energy + imbalance long/short prices at 15-min granularity from ts_15min.

Source code in dashboard/backend/app/routers/ancillary.py
@router.get("/imbalance-prices")
async def get_imbalance_prices(
    request: Request,
    response: Response,
    start: str = Query(...),
    end: str = Query(...),
    max_points: int = Query(8000, ge=10, le=50000),
):
    """aFRR energy + imbalance long/short prices at 15-min granularity from ts_15min."""
    engine = request.app.state.engine
    payload = await run_in_threadpool(
        _get_imbalance_prices_sync, engine, start, end, max_points
    )
    add_cache_headers(response, end, today_iso())
    return payload