You are trying to understand and operationalize congestion at Los Angeles-Long Beach (USLAX) without mixing it up with live AIS wait-time feeds. By the end of this guide, you will query the FreightPulse Port Congestion API for USLAX, read the lagged IMF PortWatch metrics, and wire them into your monitoring or planning workflow.
What the USLAX congestion endpoint actually returns
The port-congestion data for Los Angeles-Long Beach (USLAX) comes from IMF PortWatch and is intentionally lagged by roughly 6–7 days. The core metrics are a 7-day moving average of port calls per day compared with a 90-day baseline. The API returns a simple envelope and a results array containing the port, the UN/LOCODE, a qualitative congestion label, an as_of date, and the metrics you can plot or alert on.
This is not a live AIS queue length or anchorage wait-time feed. Treat it as a smoothed, near-real-time indicator backed by an authoritative, lagged data source.
Authentication and request shape
The endpoint accepts a port parameter set to the string USLAX for Los Angeles-Long Beach. Authenticate using an HTTP header X-API-Key with your key. If you are evaluating without a key, you can make up to 100 requests per day per IP as a guest.
- Auth header: X-API-Key: YOUR_API_KEY
- Endpoint: GET https://freightpulsehq.com/api/v1/port-congestion?port=USLAX
- Envelope: {"success": true, "data": {...}}
- Source: IMF PortWatch, lagged ~6–7 days, 7-day avg vs 90-day baseline
Refer to the API reference for general behavior and field semantics: Documentation.
Quickstart: curl for Los Angeles-Long Beach
Run this request to retrieve the latest congestion snapshot for USLAX.
curl -H "X-API-Key: YOUR_API_KEY" "https://freightpulsehq.com/api/v1/port-congestion?port=USLAX"
This request returns a JSON envelope with a results array. For a single port query, you should expect a single element in results.
Official JSON example and how to read it
Below is the documented fixture for USLAX (as_of 2026-08-14). This is not live today; use it to validate your parsing and UI.
{
"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
}
}
]
}
}
What you will typically use:
- port and locode: Identify the facility. For Los Angeles-Long Beach, locode is "US LAX".
- as_of: ISO-8601 date indicating the observation date; series is lagged ~6–7 days.
- congestion: A qualitative label you can surface in simple dashboards.
- metrics.recent_avg_portcalls_per_day: 7-day average of port calls/day.
- metrics.baseline_avg_portcalls_per_day: 90-day baseline average.
- metrics.ratio_vs_baseline: Dimensionless ratio (recent vs baseline) useful for thresholding and alerts.
Units and cadence:
- Port calls are measured in calls per day.
- The “recent” average is a 7-day moving average; the baseline is a 90-day average.
- The data reflects IMF PortWatch and is typically 6–7 days behind the current date.
Python example: fetch and interpret USLAX congestion
The following script calls the same endpoint, validates the envelope, and extracts the fields you need for alerts or dashboards.
import os
import requests
API_KEY = os.getenv("FREIGHTPULSE_API_KEY", "YOUR_API_KEY")
URL = "https://freightpulsehq.com/api/v1/port-congestion"
PARAMS = {"port": "USLAX"}
HEADERS = {"X-API-Key": API_KEY}
def fetch_uslax_congestion():
resp = requests.get(URL, params=PARAMS, headers=HEADERS, timeout=15)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError("API returned success=false")
results = data.get("data", {}).get("results", [])
if not results:
raise RuntimeError("No results for USLAX")
record = results[0]
port = record.get("port")
locode = record.get("locode")
as_of = record.get("as_of")
congestion_label = record.get("congestion")
metrics = record.get("metrics", {})
recent = metrics.get("recent_avg_portcalls_per_day")
baseline = metrics.get("baseline_avg_portcalls_per_day")
ratio = metrics.get("ratio_vs_baseline")
# Example usage: simple thresholding on ratio
status = "worsening" if ratio is not None and ratio < 1.0 else "improving_or_above_baseline"
return {
"port": port,
"locode": locode,
"as_of": as_of,
"congestion": congestion_label,
"recent_avg": recent,
"baseline_avg": baseline,
"ratio": ratio,
"status": status
}
if __name__ == "__main__":
result = fetch_uslax_congestion()
print(f"[{result['as_of']}] {result['port']} ({result['locode']}): {result['congestion']}")
print(f"Recent avg: {result['recent_avg']} calls/day vs baseline {result['baseline_avg']} (ratio {result['ratio']})")
print(f"Interpretation: {result['status']} relative to 90-day baseline")
Field semantics and integration notes
Congestion labels are a readable summary you can display directly in a UI. For automated logic, prefer ratio_vs_baseline, which compresses the signal into a single number where 1.0 indicates parity with the 90-day baseline, values below 1.0 indicate below-baseline activity, and values above 1.0 indicate above-baseline activity.
The as_of field is a date without a time component. Because the underlying series is lagged by ~6–7 days, you can safely cache responses for many hours without losing fidelity. A practical approach is to refresh once per day after your ETL cutoff.
Error handling, caching, and scheduling
- HTTP errors: Treat non-2xx as transient failures and back off with retries.
- Envelope check: Always verify success is true before reading data.
- Absent data: If results is empty, keep your last good value and mark the indicator as stale.
- Caching: Because data is lagged and smoothed (7-day average), a 12–24 hour cache is reasonable for dashboards.
- Scheduling: Pull daily at a fixed time. Many teams run updates after their usual data warehouse jobs to keep downstream numbers consistent.
Using the metrics in dashboards and alerts
Dashboards: Show the congestion label alongside the ratio, recent_avg_portcalls_per_day, and baseline_avg_portcalls_per_day to provide both a qualitative and quantitative view. The ratio is the most compact metric for color-coding (e.g., thresholds around 0.9 and 1.1) without having to expose raw call counts.
Alerts: Trigger a notification when ratio_vs_baseline crosses a threshold for several consecutive days to avoid noise inherent to rolling averages. Because the data is lagged, alerts are best used for planning adjustments rather than hour-by-hour operations.
Data hygiene and validation
- Sanity check: ratio_vs_baseline should be approximately recent_avg_portcalls_per_day / baseline_avg_portcalls_per_day.
- Consistency: The locode for Los Angeles-Long Beach appears as "US LAX". Preserve the spacing exactly as returned when you store or display it.
- Units: Keep all derived calculations in “calls/day” to prevent unit drift when combining with other sources.
Compliance and usage constraints
- Source and lag: The series is from IMF PortWatch and lags by about 6–7 days. Do not treat it as live AIS-derived wait times.
- Rate limits: Guests without a key are allowed up to 100 requests/day per IP. Use an API key for production workloads.
- Attribution and accuracy: Keep labels and fields as returned. Do not transform the as_of date into a “now” timestamp.
- Pricing data: The API returns congestion metrics, not freight rates. Do not quote a freight-rates USD fare as today’s price based on this response.
Troubleshooting common implementation issues
- Mismatch with live trackers: If your live AIS view shows heavy anchorage but the API shows “moderate,” remember the data is lagged and smoothed; both can be true.
- Empty results: Verify the exact query parameter port=USLAX and that you are using the GET method with the header X-API-Key.
- Unexpected ratio: Recalculate ratio as recent_avg_portcalls_per_day / baseline_avg_portcalls_per_day and compare to the returned value to detect parsing mistakes.
FAQ
Is this data live?
No. It is based on IMF PortWatch and is typically 6–7 days behind. It represents a 7-day moving average vs a 90-day baseline, not real-time AIS wait times.
How often should I poll the endpoint?
Daily is sufficient for most workflows, given the lag and smoothing. Many teams cache results for 12–24 hours.
Do I need an API key?
An API key is recommended for reliability. Guests without a key have a limit of 100 requests per day per IP.
What does ratio_vs_baseline represent?
It is the recent 7-day average divided by the 90-day baseline average. Values below 1.0 indicate recent port-call activity is below baseline.
Does the endpoint paginate?
The response shows a results array. For a single-port query like USLAX, you should expect a single element. No pagination parameters are shown for this request.
Set up reliable congestion monitoring for Los Angeles-Long Beach in minutes. Create an account to get your API key and start integrating: Register. If you need implementation details, field definitions, or additional examples, see the Documentation.