Home → Blog

You need a reliable way to measure port congestion at Los Angeles–Long Beach (USLAX) and compare the current 7-day average against a 90-day baseline to guide routing, scheduling, and cost decisions. By the end of this guide, you’ll be able to query the FreightPulse Port Congestion API for USLAX, read the response correctly (including the “ratio_vs_baseline” metric), and build logic that flags deviations from normal activity.

What this endpoint tells you (and what it does not)

The Port Congestion API returns IMF PortWatch congestion metrics for a requested port, lagged about 6–7 days. Data represents a 7-day average benchmarked against a 90-day baseline; it is not live AIS or real-time queue estimates. Use it for context and trend-aware planning rather than minute-by-minute dispatching.

For Los Angeles–Long Beach (USLAX), the API provides:

Interpretation: a ratio below 1.0 indicates throughput below the 90-day norm (potential tightness or reduced activity); a ratio above 1.0 indicates above-baseline throughput.

Authentication, access, and request model

Calls use a simple GET to a single endpoint with the target port specified via a query parameter. Authentication is via an X-API-Key header:

Endpoint:

GET https://freightpulsehq.com/api/v1/port-congestion?port=USLAX

Because data is lagged ~6–7 days, you can safely cache responses for several hours without losing fidelity. There is no pagination for this endpoint; the payload is a single results array scoped to the requested port.

Quickstart: curl and Python examples

curl (copy/paste)

Run this from your terminal to fetch the USLAX record:

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

Python (requests)

import requests

url = "https://freightpulsehq.com/api/v1/port-congestion"
headers = {"X-API-Key": "YOUR_API_KEY"}
params = {"port": "USLAX"}

resp = requests.get(url, headers=headers, params=params, timeout=10)
resp.raise_for_status()
payload = resp.json()

if not payload.get("success"):
raise RuntimeError("API returned success=false")

results = payload["data"]["results"]
if not results:
raise RuntimeError("No results for USLAX")

r = results[0]
as_of = r["as_of"] # e.g., "2026-08-14" (ISO date, no timezone)
congestion_label = r["congestion"] # e.g., "moderate"
recent = r["metrics"]["recent_avg_portcalls_per_day"] # float, calls/day (7-day avg)
baseline = r["metrics"]["baseline_avg_portcalls_per_day"] # float, calls/day (90-day avg)
ratio = r["metrics"]["ratio_vs_baseline"] # float, dimensionless

print(f"USLAX as of {as_of}: {congestion_label}")
print(f"Recent 7-day avg: {recent} calls/day vs baseline {baseline} calls/day")
print(f"Ratio vs baseline: {ratio}")

Sample JSON response (documented fixture)

The following is the documented fixture for USLAX (as_of 2026-08-14 — not live today):

{"success":true,"data":{"results":[{"port":"Los Angeles-Long Beach","locode":"US LAX","country":"United States","congestion":"moderate","as_of":"2026-08-14","metrics":{"recent_avg_portcalls_per_day":8.7,"baseline_avg_portcalls_per_day":10.2,"ratio_vs_baseline":0.85}}]}}

Field usage:

USLAX vs 90-day baseline: applying the ratio for Transportation decisions

In the fixture, the recent 7-day average (8.7 calls/day) is below the 90-day baseline (10.2 calls/day), yielding a ratio of 0.85. That indicates activity below the longer-term norm and supports a “moderate” congestion label in the payload. While this isn’t a live vessel queue, the ratio provides a stable, comparable signal for planning.

How to use it in routing and scheduling:

Developer experience and response shape

The API uses a single, straightforward GET with a required port parameter and a stable response envelope. All key congestion indicators are within data.results[0].metrics, reducing parsing overhead. With an as_of date and an explicit ratio_vs_baseline field, you can avoid re-computing ratios and minimize downstream logic.

Documentation is concise and focused on Transportation congestion data for ports, with a single auth header and a predictable response shape. Because it is IMF PortWatch data, you gain standardized coverage and consistent update cadence, at the cost of not being live AIS.

Coverage and reliability characteristics

Source: IMF PortWatch data. Expect a ~6–7 day lag. This is designed for monitoring and operational planning rather than live dispatch corrections. It avoids volatile spikes common in live AIS while providing a normalized, 90-day baseline to anchor the signal.

Operational tips:

Choosing the right signal: recent 7-day vs the 90-day baseline

Both metrics are returned together, but they serve different purposes:

Pick the ratio when building alerts and dashboards spanning multiple ports; pick the raw recent average when modeling absolute capacity at USLAX specifically.

Implementation patterns that save time

Minimal integration for dashboards

Triggering operational alerts

Data hygiene

Side-by-side criteria: how the 7-day vs 90-day baseline comparison helps Transportation workflows

When to pick ratio_vs_baseline: multi-port dashboards, trend detection, SLA guardrails, and normalized scoring. When to focus on recent_avg_portcalls_per_day: modeling absolute daily throughput and capacity for USLAX-specific decisions.

Troubleshooting and validation

Next steps

FAQ

Is this live AIS data?
No. It is IMF PortWatch, lagged about 6–7 days. Use it for trend-aware planning, not minute-by-minute dispatch.

What timezone is as_of in?
as_of is an ISO date (no timezone). Treat it as the effective date for the measurement window rather than a timestamp.

How often should I call the endpoint?
Daily is sufficient for most workflows. Cache results for several hours since backfilled values won’t change intra-day.

Can I compare USLAX to other ports using the ratio?
Yes, ratio_vs_baseline is designed for normalized comparisons. Only use fields actually returned by each port’s response.

Do I need an API key?
You can call as a guest up to 100 requests/day per IP. For sustained use, include X-API-Key: YOUR_API_KEY.

Set up your USLAX congestion monitoring in minutes. Create an account and get an API key to move from manual checks to automated, ratio-driven alerts: Register.