---
title: "Retrieve aggregated congestion data for multiple ports"
method: POST
path: "/congestion/batch"
tags: ["Congestion"]
---

# Retrieve aggregated congestion data for multiple ports

`POST /congestion/batch`

## Request

- Base URL: `https://api.sinay.ai/congestion/api/v1`
- URL: `https://api.sinay.ai/congestion/api/v1/congestion/batch`
- Auth: API key in header `API_KEY`

Returns congestion, time-in-port statistics, and vessel counts for a list of ports.

Maximum 10 ports per request.

## Request body

- CongestionBatchRequest
  - `portCodes` string[], required: List of port codes (unlocode), maximum 10

## Response `200`

The congestion aggregates

- object
  - `results` CongestionAggregate[]
    - `portCode` string, required: The port code (unlocode)
    - `rateOccupation` RateOccupationBreakdown, required
      - `commercialVessels` RateOccupationByVesselType
        - `rateOccupationPercentage` number, double, nullable
        - `rateOccupationGapWithMean` number, double, nullable
      - `cargo` RateOccupationByVesselType
        - `rateOccupationPercentage` number, double, nullable
        - `rateOccupationGapWithMean` number, double, nullable
      - `tanker` RateOccupationByVesselType
        - `rateOccupationPercentage` number, double, nullable
        - `rateOccupationGapWithMean` number, double, nullable
      - `roro` RateOccupationByVesselType
        - `rateOccupationPercentage` number, double, nullable
        - `rateOccupationGapWithMean` number, double, nullable
    - `time` TimeAggregate, required
      - `timeInPortStatistics` TimeStatistics
        - `max` number, double, nullable
        - `median` number, double, nullable
        - `min` number, double, nullable
    - `vesselsInPortCount` VesselsInPortCount, required
      - `commercialVessels` integer, nullable
      - `cargo` integer, nullable
      - `tanker` integer, nullable
      - `roro` integer, nullable

## Other responses

- `400`: The body in the request is not correct
- `401`: The authentication failed
- `500`: An error occurend on server side
- `default`: default

---

[API](https://skmtc.dev/safecube/apis/congestion-api.md) - [All operations](https://skmtc.dev/safecube/apis/congestion-api/llms.txt) - [OpenAPI document](https://skmtc.dev/safecube/apis/congestion-api/revisions/93b20569de8b?raw)
