Knowing whether activity at Shekou (Shenzhen) is unusual can help you qualify a port-congestion alert, but it does not tell you how long vessels are waiting. By the end of this guide, you can request Shekou’s reported activity, read its baseline comparison, and handle the age and limitations of the underlying data.
What the Shekou endpoint measures
FreightPulse exposes port-congestion data through GET /api/v1/port-congestion?port=. For this port, the query value is Shekou, and the returned port name is Shekou (Shenzhen).
The underlying source is IMF PortWatch. The measure compares the average daily port-call count over the last seven days with a 90-day baseline for the same port. The data is typically lagged by about six to seven days; the response metadata notes that the lag can range from four to eleven days because PortWatch republishes its daily series weekly.
This is not a live AIS feed or a measurement of vessel wait or anchorage time. The response’s congestion field is a deprecated alias of activity, so an integration should not interpret its label as a direct measurement of congestion.
Request the Shekou data
Send the port name as the port query parameter and pass your key in the X-API-Key header. Replace YOUR_API_KEY with your own key before running this request:
curl -H "X-API-Key: YOUR_API_KEY" "https://freightpulsehq.com/api/v1/port-congestion?port=Shekou"
Guest access without a key is limited to 100 requests per day per IP. For an integration that runs on a schedule or serves multiple users, account for that limit rather than assuming every user has a separate guest allowance.
Keep the key on the server side instead of embedding it in browser code. The Documentation is the reference for details beyond the request and fields shown here.
Read the response
The following sample shows the response envelope and a Shekou result. Its values describe the sample’s as_of date; they should not be treated as current vessel-wait information.
{
"success": true,
"data": {
"results": [
{
"port": "Shekou (Shenzhen)",
"locode": null,
"country": "China",
"activity": "moderate",
"congestion": "moderate",
"as_of": "2026-11-20",
"metrics": {
"recent_avg_portcalls_per_day": 7.9,
"baseline_avg_portcalls_per_day": 8.1,
"ratio_vs_baseline": 0.97
}
}
],
"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": "cff9756c-ad5d-4c70-a220-6fa5b9b84ed4"
}
}
Check success before reading data.results. Within a result, as_of is the date associated with the observation, while activity is the preferred label and congestion is its deprecated alias. The sample’s locode is null, so do not require that field to be populated to display the result.
recent_avg_portcalls_per_day and baseline_avg_portcalls_per_day are averages in port calls per day. ratio_vs_baseline is a unitless comparison: in the sample, the reported ratio is 0.97. Use the returned ratio rather than recalculating it from displayed averages, which may be rounded.
The data.meta fields describe the source, lag and methodology. The separate top-level meta.request_id can help identify a particular request when investigating a response. The sample also contains global_summary; for a Shekou display, read the port-level result rather than substituting summary counts for the port’s own fields.
Call the API from Python
This example uses Python’s standard library, checks the response envelope, and reads both the preferred activity field and the deprecated congestion alias. It handles an empty result and preserves the reported date rather than assigning an assumed timezone.
import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = "https://freightpulsehq.com/api/v1/port-congestion?port=Shekou"
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("API request failed with HTTP status " + str(exc.code))
except URLError as exc:
raise SystemExit("API request could not be completed: " + str(exc.reason))
except json.JSONDecodeError:
raise SystemExit("API response was not valid JSON")
if payload.get("success") is not True:
raise SystemExit("API response did not report success")
data = payload.get("data") or dict()
results = data.get("results") or list()
if not results:
raise SystemExit("No port result was returned")
result = results[0]
metrics = result.get("metrics") or dict()
metadata = data.get("meta") or dict()
print("Port:", result.get("port"))
print("Activity:", result.get("activity"))
print("Congestion alias:", result.get("congestion"))
print("As of:", result.get("as_of"))
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"))
print("Source:", metadata.get("source"))
print("Data lag:", metadata.get("data_lag_days"))
print("Methodology:", metadata.get("methodology"))
Replace the key before running the example. In a deployed service, load it from your secret configuration rather than committing it to source control, and choose an appropriate request timeout and retry policy for your environment.
The code selects the first result for this port-specific request. If your application needs a stricter match, check the returned port before presenting the result, and treat missing fields as unavailable rather than converting them into zeroes.
Use the result safely in an integration
Display the observation date alongside the activity label and ratio. A useful description is “port-call activity relative to the port’s baseline,” with the date and source visible nearby. Avoid wording such as “current wait” or “live congestion,” because neither is measured by this response.
The sample’s as_of value is a calendar date, not a timestamp with a documented timezone. Store it as returned and avoid presenting it as a precise update time. Compare it with the date your application fetched the response so operators can distinguish the age of the source observation from the age of your local copy.
Cache the response if multiple users or jobs need the same Shekou observation. Since the upstream series is republished weekly and can be several days behind, frequent requests should not be assumed to produce fresher source data. Choose a cache lifetime for your application, retain as_of with the cached value, and make stale or unavailable data visible instead of silently presenting it as current.
For alerts, use the ratio and activity label as signals about port-call volume, not as proof of a queue. The methodology notes that low activity can have different explanations, including a closure or ships waiting offshore. An operational decision about an actual vessel delay needs supporting information beyond this endpoint.
FAQ
Is Shekou congestion available in real time?
No. The IMF PortWatch series is typically lagged by about six to seven days, and the response describes a possible four-to-eleven-day lag. Check as_of for the observation being displayed.
Does the API return vessel wait times?
No. It compares recent port-call activity with a 90-day baseline; it does not measure vessel wait or anchorage time. The congestion label is a deprecated alias of activity.
What does ratio_vs_baseline represent?
It is the unitless ratio of recent average daily port calls to the port’s baseline average. Keep it with the date and activity label, and do not convert it into a wait-time estimate.
Can I test the endpoint without an API key?
Yes. Guest requests without a key are limited to 100 per day per IP. Authenticated requests use the X-API-Key header shown above.
What should I do if the result is missing or old?
Handle an empty results list and missing fields explicitly, and show the last observation date when serving cached data. Because the source is lagged and republished weekly, a recent fetch does not necessarily mean a recent observation.
Register to obtain an API key, then use the Shekou request and response fields above to add a dated port-activity signal to your integration.