Port Congestion Monitoring with Python

A 3-minute, typed-Python quick start for congestion scores, ETA delays and demurrage exposure across 19 global ports (5 Brazilian ports live).

You don't need heavy infrastructure to monitor port congestion. With a typed Python SDK you can pull congestion scores, ETA delays and demurrage exposure for 19 global ports (5 Brazilian ports live) in a few lines.

How to monitor port congestion with Python

1. Install
pip install --upgrade aetherx-oracle
2. Call a port
from aetherx import OracleClient

client = OracleClient(api_key="YOUR_RAPIDAPI_KEY")

risk = client.get_port_risk("BRSSZ")   # Santos
print(risk.port_name)
print(risk.congestion_score)
print(risk.eta_delay_days)
print(risk.estimated_daily_demurrage_usd)
3. Scan a portfolio in one call
results = client.get_ports_risk(["BRSSZ", "CNSHA", "NLRTM", "USLAX", "SGSIN"])
for r in sorted(results, key=lambda x: x.congestion_score, reverse=True):
    print(f"{r.port_id:<6} {r.congestion_score:.2f}  {r.estimated_daily_demurrage_usd:,}/day")
4. Add the 24/48/72h trend
trend = client.get_port_trend("NLRTM")
print(trend.trend)
print(trend.projection["h48"].congestion_score)

Async example

For quants and supply-chain monitors that poll many ports, use the async extra to parallelize:

pip install aetherx-oracle[async]
import asyncio
from aetherx import OracleClient

async def main():
    client = OracleClient(api_key="YOUR_RAPIDAPI_KEY")
    risks = await client.get_ports_risk_async(["BRSSZ", "CNSHA", "NLRTM"])
    for r in risks:
        print(r.port_id, r.congestion_score)

asyncio.run(main())
Example response
{
  "port_id": "NLRTM",
  "port_name": "Rotterdam",
  "country": "Holanda",
  "congestion_score": 0.4,
  "eta_delay_days": 0.8,
  "waiting_vessels": 6,
  "freight_volatility_index": 0.29,
  "estimated_daily_demurrage_usd": 48000,
  "updated_at": "2026-09-19 13:16:59",
  "as_of": "2026-09-19 13:16:59",
  "data_source": "static_reference_seed",
  "data_source_label": "Static reference seed (not live telemetry).",
  "live_detail": null,
  "validation": null
}

The same signal is available through the MCP server for AI agents and the plain REST API (https://aetherx.aether-grid.io/v1/port-risk?port_id=BRSSZ).

Get a free API key