Cross-border freight operations succeed or stall on the back of a thousand small handoffs. One of the most consequential is customs clearance: the exact moment a shipment flips from “inbound pending clearance” to “released” determines when drayage can stage, when a long-haul tender is sent, and how you avoid per diem and demurrage. Too often, those triggers are stitched together manually from emails, terminal PDFs, multiple data vendors, and time-consuming follow-ups — creating lags that ripple through docks, yards, and driver schedules.
This post shows how to automate those clearance-adjacent triggers with a single API that brings the key signals into one programmable surface. Using FreightPulse, you can combine lagged-but-actionable port throughput signals, live over-the-road (OTR) rate quotes, national and regional fuel indices, carrier verifications, and natural-disruption alerts to determine — with code — when to advance a shipment to the next step. Whether you are a freight forwarder, a 3PL, or a supply chain SaaS building visibility workflows, your app can shift from “waiting for an email” to “streaming decision signals” in hours, not months.
The goal is not to replace the filing of customs entries or manifest submissions, but to automate the downstream handoffs that follow once clearance is imminent or complete. We will design clearance triggers that account for:
- Port congestion trend at the destination terminal (to anticipate berth and yard throughput)
- Weather and natural-disaster risk around the port (to prevent bad handoff timing)
- Carrier vetting for the dray or linehaul leg (to ensure compliance and safety)
- Live FTL rates and dates for the inland move (to lock pricing and ETA windows as soon as clearance status is known)
- Fuel indices that shape your surcharge models (so quotes stay within policy)
All of that comes from one REST API surface, which means fewer brittle integrations and less vendor management. Let’s build it.
Why FreightPulse
Handoffs are fundamentally orchestration problems. They require data that usually lives in different places and updates on different cadences. FreightPulse consolidates the logistics intelligence most teams need to automate those decisions — with consistent JSON shapes and practical defaults — so you can ship production features faster.
- One surface, five signal types. Instead of integrating EIA for fuel, Warp for OTR quotes, IMF PortWatch for portcalls, FMCSA/FMC directories for carriers, and GDACS/USGS/NOAA for disruptions, your app queries a single REST API. That eliminates normalization work, mismatched timestamps, and error handling across unrelated SDKs — the easiest path from prototype to production.
- Operational context, not just point measurements. Port congestion is delivered as a 7-day average vs a 90-day baseline, which is the metric that informs how quickly cargo clears the quay and rolls inland. Live trucking quotes come packaged with transit-day estimates and dates, ready to present to operators. Fuel prices include national and PADD-region breakouts for surcharge policies — all retrievable on the same screen and in the same response shape.
- Developer ergonomics by default. All responses share a unified envelope and predictable fields, simplifying clients, validation, and telemetry. Many endpoints work without required parameters for lightweight exploration workflows, and error responses remain machine-friendly. This reduces time spent writing glue code and increases time spent delivering value.
- Production-oriented reliability patterns. The API is straightforward to call from any stack, enabling you to add retries, backoff, circuit breakers, and health checks in your own edge layers. That keeps your ops workflows resilient to transient failures without coupling you to heavyweight SDKs or vendor-specific patterns.
Quick Start
Base URL for all endpoints:
https://freightpulsehq.com/api/v1
Authentication is sent via the X-API-Key header when needed. Many endpoints allow unauthenticated exploration. All responses follow the envelope:
{
"success": true | false,
"data": { ... },
"error": "message" // present if success=false
}
First request: national and regional fuel indices. These power surcharge rules that often gate a post-clearance tender release.
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/fuel-prices"
Sample response:
{
"success": true,
"data": {
"timestamp": "2026-07-30T12:00:00Z",
"source": "EIA (U.S. Energy Information Administration)",
"currency": "USD",
"unit": "gallon",
"data": {
"diesel": {
"national_average": 3.847,
"change_week": -0.023,
"change_percent": -0.6,
"regions": {
"east_coast": 3.912,
"midwest": 3.756,
"gulf_coast": 3.623,
"rocky_mountain": 3.891,
"west_coast": 4.456,
"california": 4.892
},
"historical": {
"30d_avg": 3.82,
"90d_avg": 3.75,
"yoy_change_percent": -8.2
}
},
"gasoline": {
"national_average": 3.156,
"historical": {
"30d_avg": 3.1,
"90d_avg": 3.05,
"yoy_change_percent": 1.1
}
}
}
}
}
Key fields you can wire to clearance triggers:
- data.diesel.national_average: feed your baseline surcharge percent for inland tenders released post-clearance.
- data.diesel.regions.gulf_coast, west_coast, etc.: refine surcharges by PADD region of pickup/delivery to keep quotes policy-compliant.
- historical.*: detect fuel trend direction to pre-approve rate locks or prompt re-quoting when fuel shifts beyond a threshold.
Core Endpoints for Clearance-Driven Handoffs
1) Port Congestion: 7-day average vs 90-day baseline
Why it matters: Even when customs clears the entry, cargo cannot roll inland if the terminal is backed up. FreightPulse provides a lagged congestion proxy using IMF PortWatch AIS-derived portcalls: a 7-day average relative to a 90-day baseline. The data has a ~6–7 day lag and is ideal for proactive planning (e.g., schedule drayage a day later or request extended free time) — it is not a live vessel wait-time feed. Use this to conditionally schedule drayage pickups and inland pickups upon clearance.
Endpoint:
GET /port-congestion
Key parameters:
- port: name or LOCODE (e.g., USLAX)
- country: name or ISO3
- region: continent
- congestion: optional filter (low | moderate | high)
Example request:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/port-congestion?port=USLAX"
Response:
{
"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
}
}
]
}
}
How to use:
- congestion: map to “green/yellow/red” readiness states for your post-clearance scheduling bot.
- ratio_vs_baseline: if below a threshold (e.g., 0.7), assume slower yard throughput; consider delaying dray pickup to minimize dry runs.
- as_of: remember the lag; combine with disruption signals for a more current risk picture.
2) Disruption Alerts: Cyclones, earthquakes, severe weather near a port
Why it matters: Natural hazards are decisive for ground operations the moment a container is released. Before you dispatch drayage or final-mile, check for storms, severe weather, or seismic events near the relevant port. FreightPulse aggregates alerts from GDACS, USGS, and NOAA/NWS and lets you filter by port radius. Use this as a required “green-light” check on your clearance trigger workflow.
Endpoint:
GET /disruptions
Key parameters:
- type: cyclone | earthquake | flood | volcano | drought | wildfire | severe_weather
- severity: low | moderate | high
- country: optional filter
- port: filters by distance (300 km for global hazards; 100 km for US weather)
Example request:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/disruptions?port=USLAX&severity=high"
Response:
{
"success": true,
"data": {
"results": [
{
"id": "gdacs:TC:1001305",
"type": "cyclone",
"severity": "moderate",
"title": "Tropical Cyclone SAUDEL-26",
"country": "Japan",
"starts_at": "2026-08-18T12:00:00+00:00",
"source": "GDACS"
}
]
}
}
How to use:
- Filter by port to guard the exact handoff. If results exist with severity=moderate or high, require manual review before triggering pickups.
- Use starts_at to sequence alerts against your release ETA and dray appointment window.
- Integrate with port-congestion lag data: if congestion is moderate but weather is clear, you might proceed; if both are negative, delay or re-slot.
3) Live US FTL Freight Quotes: Inland legs ready to go when clearance hits
Why it matters: As soon as a container clears, a well-timed inland tender can beat other shippers to scarce capacity — especially during peak season. FreightPulse proxies live US full-truckload quotes (via Warp) and unifies the data with the rest of your logistics signals so you can immediately propose a rate and ETA to your consignee.
Endpoint:
GET /freight-rates
Key parameters (trucking mode):
- mode: trucking (default)
- origin_zip and destination_zip: required for trucking
- pickup_date: date string for the requested pickup
- qty, total_weight_lb: optional but recommended for accurate quoting
Example request:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/freight-rates?mode=trucking&origin_zip=90802&destination_zip=85001&pickup_date=2026-08-24&qty=1&total_weight_lb=38000"
Sample response:
{
"success": true,
"data": {
"mode": "trucking",
"service": "FTL (53' dry van)",
"source": "Warp",
"price_usd": 2895.40,
"transit_days": 2,
"pickup_date": "2026-08-24",
"delivery_date": "2026-08-26"
}
}
How to use:
- price_usd: feed your quote generator; combine with fuel indices to verify within-margin rules.
- transit_days and delivery_date: compute downstream appointment windows and expected consignee notifications automatically.
- Missing required params return available: false — build a fallback UI prompt rather than erroring the whole workflow.
4) Carrier Verification: FMCSA trucking and FMC ocean directories
Why it matters: A clearance workflow often culminates in dispatching a carrier. Before you release a load, verify the carrier’s authority, name, and safety rating. FreightPulse normalizes FMCSA (trucking) and FMC (ocean NVOCC/OTI) lookups under one endpoint, so compliance checks are cheap to add and easy to automate.
Endpoint:
GET /carriers
Key parameters:
- q: required for trucking or ocean lookups (DOT number, legal name, or FMC org number)
- type: trucking (default) | ocean | air (air returns available:false)
Example request (trucking by DOT number):
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/carriers?q=54283"
Response:
{
"success": true,
"data": {
"type": "trucking",
"query": "54283",
"results": [
{
"dot_number": 54283,
"legal_name": "SWIFT TRANSPORTATION COMPANY OF ARIZONA LLC",
"status": "active",
"safety_rating": "S",
"drivers": 12883,
"address": {
"city": "Phoenix",
"state": "AZ",
"country": "US"
}
}
]
}
}
How to use:
- status and safety_rating: block release to carriers failing your compliance policy.
- drivers: proxy for scale; helpful when allocating surge volumes.
- address: cross-check for consistency in your TMS records.
5) Fuel Prices and Historical Series: Surcharge logic and trend gating
Why it matters: Your clearance-triggered quotes must respect surcharge policy, and many shippers also gate rate locks on recent fuel trends. FreightPulse offers both current indices and historical series in consistent shapes, making it trivial to codify your rules.
Endpoints:
- GET /fuel-prices: snapshot across national and PADD regions
- GET /historical?metric=fuel_price_diesel_national: weekly historical series
Example historical request:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/historical?metric=fuel_price_diesel_national&period=90d"
Response:
{
"success": true,
"data": {
"metric": "fuel_price_diesel_national",
"period": "90d",
"series": [
{ "date": "2026-06-01", "value": 3.73 },
{ "date": "2026-06-08", "value": 3.76 },
{ "date": "2026-06-15", "value": 3.79 },
{ "date": "2026-06-22", "value": 3.81 },
{ "date": "2026-06-29", "value": 3.83 }
]
}
}
How to use:
- series[].value: compute moving averages; gate “auto-lock” quotes if 2-week average rises above a threshold.
- Combine snapshot and historical to present both “rate today” and “trend last quarter” to your operators.
6) Historical Port Congestion Series: Trend visualization for ETA buffers
Why it matters: Trends help operators calibrate buffer days between clearance and pickup. Use the historical series to power dashboards and automated ETA deltas for specific ports.
Endpoint:
GET /historical?metric=port_congestion:<portid>
Example request (Los Angeles-Long Beach):
curl -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/historical?metric=port_congestion:USLAX&period=1y"
Sample response:
{
"success": true,
"data": {
"metric": "port_congestion:USLAX",
"period": "1y",
"series": [
{ "date": "2025-09-01", "value": 0.92 },
{ "date": "2025-09-08", "value": 0.88 },
{ "date": "2025-09-15", "value": 0.85 }
]
}
}
How to use:
- value represents a ratio vs baseline. Map ranges to “add 0/1/2 buffer days” policies in inland dispatch post-clearance.
- Display trend to operators to justify why your automation held or released a tender.
Designing Clearance Triggers that Actually Work
A practical clearance trigger is not a single condition but a compact decision tree that considers clearance status, port throughput, weather risk, carrier compliance, inland rate availability, and surcharge policy. Below is a canonical sequencing pattern:
- When an entry status changes to “cleared” in your TMS, fetch port congestion for the destination port to establish a throughput baseline. If the ratio_vs_baseline < 0.7 and labeled “high” congestion, insert a 24–48 hour buffer before dray appointment creation.
- Query disruptions by port. If severity is moderate or high for cyclones or severe_weather overlapping your next 48 hours, block auto-dispatch and request operator review.
- Request live FTL quotes from the port ZIP to the consignee ZIP for the earliest feasible pickup date. Validate price against policy and current fuel indices, checking your surcharge matrix with national or PADD-region diesel.
- Verify the chosen carrier’s DOT number and safety rating before finalizing the tender. If status != active or rating violates your rule, cycle to the next option.
- Record every decision with timestamps and raw JSON responses for audit and explainability. If anything fails, backoff and retry with exponential delays, and log soft-fail states to your observability tooling.
The result is a reliable, explainable, and fast handoff orchestration that turns clearance into predictable inland movements.
End-to-End Examples in Code
cURL workflow: from congestion and disruption checks to a rate quote
# 1) Check port congestion for Los Angeles-Long Beach (USLAX)
curl -s -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/port-congestion?port=USLAX"
# 2) Check high-severity disruptions near the same port
curl -s -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/disruptions?port=USLAX&severity=high"
# 3) Get an inland FTL quote from Long Beach (90802) to Phoenix (85001)
curl -s -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/freight-rates?mode=trucking&origin_zip=90802&destination_zip=85001&pickup_date=2026-08-24&qty=1&total_weight_lb=38000"
# 4) Fetch current fuel indices for surcharge validation
curl -s -H "X-API-Key: YOUR_API_KEY" \
"https://freightpulsehq.com/api/v1/fuel-prices"
Python: clearance trigger decision function
import os
import time
import requests
BASE = "https://freightpulsehq.com/api/v1"
HEADERS = {"X-API-Key": os.getenv("FREIGHTPULSE_API_KEY", "")}
def get_json(path, params=None, retries=3, backoff=0.5):
for attempt in range(retries):
resp = requests.get(f"{BASE}{path}", headers=HEADERS, params=params, timeout=15)
data = resp.json()
if data.get("success"):
return data["data"]
# Soft error: backoff and retry
time.sleep(backoff * (2 ** attempt))
raise RuntimeError(f"Failed to get {path}: {data.get('error')}")
def should_release_inland_tender(port_locode, origin_zip, dest_zip, pickup_date):
pc = get_json("/port-congestion", {"port": port_locode})
disruptions = get_json("/disruptions", {"port": port_locode, "severity": "high"})
# Basic congestion rule
ratio = None
if pc.get("results"):
ratio = pc["results"][0]["metrics"]["ratio_vs_baseline"]
if ratio is not None and ratio < 0.7:
return {"release": False, "reason": "High congestion, add buffer", "ratio": ratio}
# Disruption rule
if disruptions.get("results"):
return {"release": False, "reason": "Severe disruption near port", "events": disruptions["results"]}
# Live rate
rate = get_json("/freight-rates", {
"mode": "trucking",
"origin_zip": origin_zip,
"destination_zip": dest_zip,
"pickup_date": pickup_date
})
# Fuel index for surcharge check
fuel = get_json("/fuel-prices")
diesel = fuel["data"]["diesel"]["national_average"]
return {
"release": True,
"reason": "Conditions normal",
"congestion_ratio": ratio,
"rate": rate,
"diesel": diesel
}
# Example call:
# result = should_release_inland_tender("USLAX", "90802", "85001", "2026-08-24")
# print(result)
JavaScript/Node: carrier verification before dispatch
import fetch from "node-fetch";
const BASE = "https://freightpulsehq.com/api/v1";
const HEADERS = { "X-API-Key": process.env.FREIGHTPULSE_API_KEY || "" };
async function fpGet(path, params) {
const url = new URL(BASE + path);
if (params) Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
const res = await fetch(url.toString(), { headers: HEADERS });
const body = await res.json();
if (body.success) return body.data;
throw new Error(body.error || "FreightPulse error");
}
export async function verifyCarrier(dotOrName) {
const data = await fpGet("/carriers", { q: String(dotOrName), type: "trucking" });
const match = (data.results || [])[0];
if (!match) return { ok: false, reason: "No match" };
const { status, safety_rating } = match;
const ok = status === "active" && ["S", "None"].includes(safety_rating);
return { ok, match };
}
// Usage:
// const check = await verifyCarrier(54283);
// if (!check.ok) throw new Error("Carrier blocked by compliance");
Real-World Use Cases
1) Customs-to-Dray Automation for a Freight Forwarder
When ACE/ABI indicates “released,” the forwarder’s TMS runs a congestion check for the terminal using GET /port-congestion and a disruption sweep with GET /disruptions?port=USLAX. If congestion is moderate and no high-severity events exist, the system requests an FTL quote via GET /freight-rates for the inland leg and calculates a fuel surcharge with GET /fuel-prices. The workflow then verifies the intended dray or linehaul partner with GET /carriers before auto-creating the appointment. Operators only step in when conditions fail rules.
2) SaaS Visibility Platform: Predictive Buffer Days
A visibility app layers GET /historical?metric=port_congestion:USLAX with the latest GET /port-congestion snapshot to compute a dynamic buffer applied at “release” time. The UI shows a rolling 90-day congestion trend and recommends adding 0–2 days to inland pickups; the engine also queries GET /disruptions by port to warn of incoming storms that override the statistical buffer. The result is fewer missed gates and more realistic appointment windows surfaced to consignees.
3) 3PL Rate Desk: Surcharge-Aware, Live Tendering
A 3PL embeds GET /freight-rates in its tender bot to price and propose the inland movement immediately after clearance. Before confirming, the bot calls GET /fuel-prices and GET /historical?metric=fuel_price_diesel_national to enforce a cap-if-rising rule for volatile weeks. Finally, GET /carriers ensures the selected motor carrier meets the compliance bar. The operator receives a compiled decision including raw JSON, keeping the process auditable and fast.
FAQ
How often do FreightPulse fuel prices update?
Fuel price data is sourced from EIA and reflects their official publication cadence. FreightPulse normalizes the latest available figures and includes regional PADD breakdowns plus historical averages, allowing you to apply surcharge rules with consistent fields across updates.
Can I look up ocean carriers as well as trucking carriers?
Yes. Use GET /carriers with type=ocean to query the FMC directory for NVOCC/OTI entities, and with type=trucking (default) to query FMCSA SAFER records. Return fields are normalized where sensible, and air currently returns available:false.
Does the port congestion data reflect real-time vessel wait times?
No. Port congestion uses IMF PortWatch AIS-derived portcall activity and is provided as a 7-day average relative to a 90-day baseline with a roughly 6–7 day lag. It’s excellent for trend-aware planning and buffer policies, but it is not a live AIS vessel queue metric.
How should I handle missing parameters on GET /freight-rates?
When required parameters are missing, the endpoint returns HTTP 200 with indicators such as available: false in the data rather than an error. Code your client to detect availability and surface a helpful prompt (e.g., “origin_zip required”) instead of failing the workflow.
What is the response envelope shape and how do I handle errors?
Every endpoint returns { success, data, error }. When success=false, error contains a human-readable message. Handle 4xx/5xx HTTP codes with retries and backoff when appropriate, and use the envelope to log and branch decisions without crashing user flows.
Implementation Guidance, Reliability, and Observability
Building production-grade clearance triggers is less about complex algorithms and more about predictable, explainable decisions that remain stable through network hiccups and upstream variability. The practices below help you maintain resilience as you integrate multiple signals.
- Unified client wrapper: Centralize GET logic and the success/data/error envelope handling. This reduces duplication and makes it easy to add retry/backoff, timeouts, and structured logging in one place.
- Retries with jitter: Transient failures happen. Use exponential backoff with jitter for idempotent GETs. Cap retries to a small number (3–4) with cumulative timing below your SLA for dispatch decisions.
- Circuit breakers and health checks: If repeated errors exceed a threshold, open a breaker to protect your app. Periodically ping a lightweight endpoint (like /fuel-prices) from a health worker to verify availability, logging latency and status.
- Observability and audit trails: Persist the raw JSON responses alongside your computed decisions (e.g., why the tender was delayed: congestion ratio=0.62, as_of=2026-08-14). This enables faster operator trust and compliance reviews.
- Schema evolution: Since all responses share a consistent envelope, add defensive parsing. Treat unexpected fields as optional and default to safe values, so your automation doesn’t break on additive improvements.
- Regional and policy alignment: Use PADD-region diesel from /fuel-prices when your surcharge policy depends on regional indices. Map consignee or pickup ZIPs to regions consistently before computing margins.
- Lag-aware planning: Port congestion is lagged. Combine it with real-time-like disruptions and your proprietary terminal updates (if any) to avoid overreliance on a single metric. If congestion trend is favorable but a severe storm is forecast within 24 hours, prefer the disruption signal and hold dispatch.
- Time normalization: Stick to UTC for timestamps in your processing pipeline. FreightPulse responses include clear timestamps; convert once, early, and store in a normalized format for downstream systems.
Endpoint-by-Endpoint Deep Dive and Field Interpretation
GET /fuel-prices
Purpose: Provide current national and regional diesel/gasoline indices for surcharge rules and pricing transparency. Every customs clearance-triggered tender should check these before price presentation.
Key fields:
- data.diesel.national_average: baseline per-gallon index used in surcharge tables.
- data.diesel.regions.{east_coast,midwest,gulf_coast,rocky_mountain,west_coast,california}: regional overrides.
- data.diesel.historical: rolling averages and YoY to judge volatility.
- data.gasoline.*: relevant for last-mile or LTL policies that reference gasoline indices.
Performance tips:
- Cache for a few minutes; indices don’t change minute-to-minute.
- Validate numeric fields and default to last-known-good on parse errors.
GET /freight-rates
Purpose: Retrieve live truckload quotes that you can present the moment clearance occurs, avoiding delays that cede capacity to faster rivals.
Parameters and impact:
- origin_zip and destination_zip: critical for pricing accuracy; ensure valid 5-digit ZIPs.
- pickup_date: informs feasibility and transit estimate; always pass your earliest workable date post-clearance/buffer.
- qty, total_weight_lb: include when known to refine pricing.
Response fields:
- price_usd: the quoted linehaul price you can surface in your TMS/portal.
- transit_days: feed ETA windows; combine with appointment booking logic.
- delivery_date: immediately viewable by consignee teams downstream.
Error handling:
- If params are incomplete, you may get available:false; prompt for missing inputs without blowing up the user flow.
GET /port-congestion
Purpose: Provide an actionable proxy for terminal throughput that lets you algorithmically decide whether to auto-dispatch or delay post-clearance.
Field meanings:
- congestion: coarse category (low/moderate/high) to gate workflows.
- metrics.ratio_vs_baseline: continuous metric for policy thresholds and dashboards.
- as_of: data date; remember the ~6–7 day lag.
Best practices:
- Use thresholds like 0.7 or 1.2 to bracket “slowdown” vs “surge.”
- Combine with historical series to reduce whiplash from week-to-week noise.
GET /carriers
Purpose: Prevent non-compliant dispatches by verifying authority and safety.
Field meanings:
- status: “active” indicates operating authority is in force.
- safety_rating: “S” or “None” typically indicates acceptable risk; codify your policy.
- drivers: scale proxy; helps allocate volume dynamically.
Tips:
- Prefer exact DOT lookups to reduce false positives from fuzzy name matches.
- Log snapshots before and after you assign loads for audit trails.
GET /disruptions
Purpose: Avoid preventable bad dispatches by screening for severe weather or hazards near the port or route.
Field meanings:
- type and severity: quickly route to policy-specific actions (e.g., cyclones block auto-dispatch; earthquakes might trigger engineering checks for specific facilities).
- starts_at: helps sequence decisions over the next 24–72 hours.
Tips:
- Always filter by port when validating the clearance handoff; it keeps checks localized.
- Use different severities for warning vs blocking actions to avoid unnecessary holds.
GET /historical
Purpose: Trend analysis for buffer policies and surcharge stability. Two primary families: fuel price series and port congestion series.
Parameters:
- metric: fuel_price_diesel_national | fuel_price_gasoline_national | port_congestion:<portid>
- period: 30d | 90d | 1y
How to use:
- Compute moving averages to detect trend shifts and preemptively adapt policies.
- Visualize lines in dashboards for operator context.
Error Scenarios and Defensive Patterns
Robust automation anticipates and calmly handles the unexpected. FreightPulse exposes explicit error messages while keeping the envelope shape stable.
- Validation shortfalls: /carriers requires q; /freight-rates requires certain parameters for trucking mode. Your client should validate inputs and either short-circuit with friendly messaging or proceed with a safe branch (e.g., set available:false UI).
- HTTP statuses: When the HTTP response signals an error, parse the body and log { success:false, error } for diagnostics. Only retry idempotent operations; do not retry faster than your backoff plan.
- Timeouts and partial failures: Set server and client timeouts. If one signal (e.g., disruptions) lags, proceed with degraded mode (e.g., allow dispatch with a human confirmation) rather than stalling the entire flow.
- Data freshness: Verify timestamps such as as_of for congestion. If the data age exceeds your tolerance, flag the automation as “needs review” and notify an operator.
Performance Tuning and Operational Excellence
- Client-side caching: Cache read-mostly data like /fuel-prices for short durations to reduce latency and improve perceived responsiveness.
- Batching: When evaluating multiple ports or lanes post-clearance, parallelize safe GETs and then reconcile with your decision function.
- Regional routing: Host your middleware near your users and data consumers to reduce round-trip latency. Keep observability on p95 and p99 latencies for your most frequent endpoints.
- Provider overrides: For inland quotes, keep a fallback logic that gracefully handles available:false by prompting for corrected ZIPs or adjusted pickup dates.
- Auditability: Store the exact JSON payloads used for a decision in your TMS — this is critical when customers ask “why did we delay this pickup by one day?” or “why did we lock this rate?”.
Putting It All Together: A Reference JSON Decision Record
Below is a representative composite record you might store each time your system decides to auto-release or hold an inland tender after customs clearance. It combines inputs from multiple FreightPulse endpoints and your own computed verdict.
{
"shipment_id": "FF-123456",
"decision_at": "2026-08-20T14:22:10Z",
"port": "USLAX",
"inputs": {
"port_congestion": {
"as_of": "2026-08-14",
"congestion": "moderate",
"ratio_vs_baseline": 0.85
},
"disruptions": {
"high_severity_count": 0,
"events": []
},
"freight_rate": {
"mode": "trucking",
"price_usd": 2895.4,
"transit_days": 2,
"pickup_date": "2026-08-24",
"delivery_date": "2026-08-26"
},
"fuel": {
"diesel_national": 3.847,
"region": "west_coast",
"diesel_region_value": 4.456
},
"carrier_verification": {
"dot_number": 54283,
"status": "active",
"safety_rating": "S"
}
},
"policy_evaluations": {
"congestion_threshold": "ratio >= 0.7: PASS",
"weather_block": "no high-severity within 300km: PASS",
"fuel_surcharge_within_bounds": "PASS",
"carrier_compliance": "PASS"
},
"verdict": {
"release_inland_tender": true,
"notes": "Proceed with pickup on 2026-08-24; congestion moderate but acceptable."
}
}
Developer Checklist for Launch
- Implement a shared FreightPulse client with retry/backoff and structured logging.
- Map destination port or terminal to a known port ID/LOCODE for /port-congestion and historical metrics.
- Gate release on disruption checks filtered by port; set severity thresholds by mode (dray vs linehaul).
- Integrate /freight-rates for inland legs and verify quotes against /fuel-prices index rules.
- Automate /carriers verification at dispatch-time and on any carrier profile changes.
- Persist all input JSONs and the final decision outcome for auditability.
- Add monitoring for API latency and non-success envelopes, with alerts tied to your on-call rotations.
Conclusion + CTA
Customs clearance should be a springboard, not a bottleneck. When your system can independently verify port conditions, screen for weather, fetch a live inland quote, check the carrier’s credentials, and validate surcharge policy, “released” becomes a reliable signal to move — confidently and quickly. FreightPulse brings those signals together in one API, with consistent fields and practical semantics that match how logistics really runs.
The fastest path from a spreadsheet-and-email workflow to an automated, explainable clearance trigger is to ship code against unified logistics intelligence. You can assemble these workflows in days, not months, and give operators both speed and context without burying them under vendor sprawl.
Start building your clearance-triggered handoffs with FreightPulse. Explore the endpoints, wire the decision tree, and turn every “released” into an orchestrated inland move. Try FreightPulse for free and see how quickly your team can go from idea to production-grade automation.