Home → Blog

Rotterdam vessel activity can be difficult to put into context when a port-call count is viewed without a historical baseline. By the end of this guide, you can request the NLRTM data, read its activity and baseline fields, and integrate the lagged result without mistaking it for a live vessel waiting-time feed.

What the Rotterdam congestion endpoint measures

The port-congestion endpoint uses IMF PortWatch data to compare Rotterdam’s average daily port calls over the most recent seven-day window with a 90-day baseline for the same port. The request uses the UN/LOCODE NLRTM; the response identifies Rotterdam with the formatted code NL RTM.

Illustration: API to Get Port Congestion at Rotterdam

The data is typically lagged by roughly six to seven days, rather than being a live AIS view. The response metadata in the example below describes a broader four-to-eleven-day lag because PortWatch republishes its daily series weekly. Check as_of on each result instead of assuming that the request date is the observation date.

Most importantly, the response describes port-call activity, not vessel waiting time. Its congestion field is a deprecated alias of activity. A low activity reading can have different causes, including a closure or ships waiting offshore, so it cannot establish either the cause or the length of a delay.

Request the Rotterdam data

Send a GET request to /api/v1/port-congestion with port=NLRTM. Authenticate with the X-API-Key header, replacing YOUR_API_KEY with your key when you run the command:

curl -H "X-API-Key: YOUR_API_KEY" "https://freightpulsehq.com/api/v1/port-congestion?port=NLRTM"

Guest requests without a key are available at 100 requests per day per IP. For an integration that makes authenticated requests, keep the key out of source control and send it in the header rather than adding it to the request URL.

The response has a success flag and a data object. Check that the request succeeded and that data.results contains a Rotterdam entry before reading its metrics. Do not assume that an HTTP response alone guarantees a usable observation.

Read the response and interpret its fields

The following supplied response is a point-in-time example, not a current Rotterdam reading:

{
    "success": true,
    "data": {
        "results": [
            {
                "port": "Rotterdam",
                "locode": "NL RTM",
                "country": "The Netherlands",
                "activity": "moderate",
                "congestion": "moderate",
                "as_of": "2026-11-20",
                "metrics": {
                    "recent_avg_portcalls_per_day": 79.1,
                    "baseline_avg_portcalls_per_day": 82.1,
                    "ratio_vs_baseline": 0.96
                }
            }
        ],
        "global_summary": {
            "ports_high_activity": 0,
            "ports_moderate_activity": 1,
            "ports_low_activity": 0,
            "ports_high_congestion": 0,
            "ports_moderate": 1,
            "ports_low": 0
        },
        "meta": {
            "source": "IMF PortWatch (portwatch.imf.org) - UN Global Platform AIS data",
            "data_lag_days": "4-11 (PortWatch republishes the daily series once a week; check as_of)",
            "methodology": "activity is port-call volume, not congestion: last 7 days' avg calls vs a 90-day baseline for the same port. low means fewer calls than usual, which can be a closure or ships waiting offshore. It does not measure vessel wait or anchorage time. congestion is a deprecated alias of activity."
        }
    },
    "meta": {
        "request_id": "62fc7b98-c9db-4b66-a4b2-4f37ec5c4c25"
    }
}

For a Rotterdam integration, read the entry in data.results and retain its as_of date alongside the values you display. The example’s activity and deprecated congestion alias both say moderate; neither is a measured wait time.

The two port-call averages are in calls per day. recent_avg_portcalls_per_day is the recent seven-day average, while baseline_avg_portcalls_per_day is the 90-day baseline. ratio_vs_baseline is a unitless comparison: in this example, 0.96 indicates recent activity below the baseline, not a wait measured in hours or days.

The as_of value in the example is a date, not a timestamp with a time or timezone. Preserve it as returned and avoid displaying a time of day or timezone that the response does not provide. The source and methodology in data.meta help explain the observation; the top-level meta.request_id can be retained for troubleshooting.

Call the endpoint from Python

This example uses Python’s standard library, calls the same Rotterdam URL as the curl request, and reads the fields needed for a basic display. Replace YOUR_API_KEY before running it, or adapt the key lookup to your deployment’s secret-management approach.

import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen

url = "https://freightpulsehq.com/api/v1/port-congestion?port=NLRTM"
request = Request(url, headers={"X-API-Key": "YOUR_API_KEY"})

try:
with urlopen(request) as response:
payload = json.load(response)
except HTTPError as exc:
raise SystemExit(f"Request failed with HTTP status {exc.code}") from exc
except URLError as exc:
raise SystemExit(f"Could not reach the endpoint: {exc.reason}") from exc
except json.JSONDecodeError as exc:
raise SystemExit("The response was not valid JSON") from exc

if payload.get("success") is not True:
raise SystemExit("The API did not report a successful request")

data = payload.get("data") or {}
results = data.get("results") or []
rotterdam = next(
(item for item in results if item.get("locode") == "NL RTM"),
None,
)

if rotterdam is None:
raise SystemExit("No Rotterdam result was returned")

metrics = rotterdam.get("metrics") or {}

print("Port:", rotterdam.get("port"))
print("As of:", rotterdam.get("as_of"))
print("Activity:", rotterdam.get("activity"))
print("Congestion alias:", rotterdam.get("congestion"))
print("Recent calls per day:", metrics.get("recent_avg_portcalls_per_day"))
print("Baseline calls per day:", metrics.get("baseline_avg_portcalls_per_day"))
print("Ratio vs baseline:", metrics.get("ratio_vs_baseline"))

The sample selects the formatted response code NL RTM, rather than expecting the response to repeat the unspaced query value. It also distinguishes an unsuccessful request from a successful response with no Rotterdam result. For a user-facing application, treat missing fields as unavailable instead of converting them to zero or presenting them as a measured value.

Ship the integration without overstating freshness

Store the observation date with the Rotterdam values, and label the data as lagged port-call activity. If you cache a response, preserve its original as_of value: the time your application fetched or cached the response is not the same as the date of the underlying observation.

Because the underlying series is republished weekly, repeated requests can return an observation with the same as_of date. Choose a refresh and cache policy appropriate for that cadence, while allowing for the lag to vary. If a cached value is displayed when a refresh fails, make its observation date visible so readers can judge its age.

Keep the activity label and the ratio together when possible. The label is convenient for a compact display, while the recent and baseline averages explain what the comparison represents. Avoid renaming the ratio as vessel delay, queue length, anchorage time, or a live congestion score.

Record request failures separately from missing observations, and retain the returned request ID when available. The Documentation is the place to check current integration details before deciding how your application should handle errors or changes to the response.

FAQ

Is this a live Rotterdam vessel-waiting API?

No. It reports lagged IMF PortWatch port-call activity relative to a historical baseline. It does not measure vessel wait or anchorage time.

Why is the response code formatted as NL RTM?

The request uses NLRTM in the port parameter, while the supplied response formats the locode as NL RTM. Account for that difference when selecting the Rotterdam result.

Should I use activity or congestion?

Use activity when describing what the metric represents. The supplied methodology identifies congestion as a deprecated alias; neither field establishes how long a vessel waits.

How fresh is the result?

The data is typically around six to seven days behind, but the supplied metadata describes a four-to-eleven-day lag. Read as_of for the observation date rather than assuming a fixed delay.

Can I call the endpoint without an API key?

Yes. Guest access without a key is limited to 100 requests per day per IP. The authenticated request shown above uses the X-API-Key header.

To add authenticated Rotterdam activity data to your integration, Register, run the curl request, and verify the returned as_of date before displaying the result.