GET /ports/{locode}/congestion

Port congestion

Congestion score, 90-day history and the anchorage wait for one port.

A port's latest congestion score and 90-day history, plus the two waits people ask about: median_anchorage_wait_h (hours a ship waits at anchor for a berth) and longest_wait_days (the longest any vessel at the port has been waiting). Either is null — never 0 — when we hold no reading. Answers for every port we score, whether or not it has a page on /ports. Reads Traqo analytics — never consumes a slot. Requires port-congestion on your organisation’s plan.

Request

GET https://traqocontainer.com/api/v1/ports/{locode}/congestion

Authentication.

Your API key as a Bearer token: Authorization: Bearer YOUR_API_KEY.

Rate limit.Each API key gets 120 requests per minute by default; your key's own budget comes back in the X-RateLimit-* headers.Limits by plan.

Parameters

NameInTypeRequiredDescription
locodepathstringYes

Port UN/LOCODE (5 chars).

Example request

curl "https://traqocontainer.com/api/v1/ports/INMUN/congestion" \
  -H "Authorization: Bearer YOUR_API_KEY"

Run it in the sandbox — no key, no account: the same request answers at https://traqocontainer.com/api/v1/sandbox/ports/{locode}/congestion with a schema-identical reply.

Responses

Example 200 body:

{
  "success": true,
  "data": {
    "locode": "INNSA",
    "latest": {
      "score": 58,
      "bucket": "moderate",
      "tier": "A",
      "trend7d": 9,
      "components": {
        "waiting": 63,
        "anchorage_hours": 116,
        "berth_hours": 58
      },
      "computedAt": "2026-11-01T12:00:00.000Z"
    },
    "history": [
      {
        "computedAt": "2026-08-09T12:00:00.000Z",
        "score": 0,
        "bucket": "fluid"
      },
      {
        "computedAt": "2026-08-16T12:00:00.000Z",
        "score": 0,
        "bucket": "fluid"
      }
    ],
    "median_anchorage_wait_h": 116,
    "longest_wait_days": 6
  }
}
StatusMeaning
200

Congestion score + history

400

Bad request — check required parameters.

401

Invalid or missing API key.

403

Port congestion is unavailable. TWO different causes share this status and data.error distinguishes them: feature_disabled — switched off for the whole deployment, independent of your subscription — or plan_required — on, and your ORGANISATION’s plan is below the configured minimum (the message names it). A teammate is judged by the organisation’s plan, not their own. The sandbox does not reproduce this — it has no account to gate on and always answers 200.

429

Rate limit exceeded — see the Retry-After header. The body names the plan the limit was computed from (plan, always the ORGANISATION’s plan, not the row your key hangs off) and what would raise it: upgrade with next_plan and next_limit_per_min, or contactUrl when there is no plan above yours. Exactly one of the two is present.

Error bodies and retry advice: Errors.