API to Track a LNG Carrier

API to Track a LNG Carrier

You need to track a liquefied natural gas (LNG) carrier in real time, compute ETAs against port congestion, and roll it up into a fleet dashboard with ESG visibility. By the end of this guide you will query live AIS for an LNG carrier, extract voyage context (route, last ports, ETA), monitor multiple LNG tankers at once, and pull port and emissions intelligence using a single REST API.

Why LNG carrier tracking needs the right API

LNG carriers run tight schedules and strict safety envelopes. Miss a weather window or a congestion spike and boil-off management, tug bookings, berth slots, and custody transfers start to slip. To be useful, tracking data must be fresh, consistent across endpoints, and trivial to integrate into TMS/port-call tooling.

Illustration: API to Track a LNG Carrier

vessels-api.com exposes 18 REST endpoints that share one authentication model and one JSON envelope, with global AIS coverage and near real-time refresh. It is designed so developers can compose live positioning, voyage analytics, fleet status, port snapshots, and IMO CII scoring in a few HTTP calls.

How the API works (base URL, auth, envelope)

  • Base URL: https://vessels-api.com/api/V1
  • Authentication: X-API-Key header. Example: X-API-Key: YOUR_API_KEY
  • HTTP methods: GET for most endpoints; POST for /vessels/fleet
  • Response envelope on every request: {"status", "success", "message", "data"}
  • Units: distances in nautical miles (nm), speed in knots, positions lat/lon in decimal degrees, times in UTC (ISO 8601)

Step 1 — Find your LNG carrier (search by name/IMO/MMSI)

Start by resolving a candidate vessel. LNG carriers often get referenced by IMO (preferred for stability), MMSI, or a fuzzy name in job tickets. Use the search endpoint with optional filters like ship_type, flag, or build year.

cURL

curl -H "X-API-Key: YOUR_API_KEY" "https://vessels-api.com/api/V1/vessels/track?mmsi=258785000&hours=48"

Key fields you’ll use from data.vessels[]:

  • imo, mmsi, name — identifiers you’ll pass to tracking and analytics
  • vessel_type (LNG carrier), flag — useful for filtering and localization
  • length_m, width_m — operational constraints for berth/lock/tug

Pagination: per_page max is 100; inspect data.pagination for current_page, total, and last_page when building dropdowns or typeahead results.

JavaScript (Node.js) — find an LNG carrier by fuzzy name

import fetch from "node-fetch";

const API_KEY = process.env.VESSELS_API_KEY;

async function findLngCarrier(query = "Q-FLEX") {
const url = new URL("https://vessels-api.com/api/V1/vessels/search");
url.searchParams.set("query", query);
url.searchParams.set("ship_type", "LNG");
url.searchParams.set("per_page", "25");
const res = await fetch(url, { headers: { "X-API-Key": API_KEY } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const payload = await res.json();

if (!payload.success || !payload.data?.vessels?.length) {
return null;
}
// Choose best match (first for demo). Prefer IMO to track.
const vessel = payload.data.vessels[0];
return {
imo: vessel.imo,
mmsi: vessel.mmsi,
name: vessel.name,
length_m: vessel.length_m,
width_m: vessel.width_m,
};
}

findLngCarrier().then(console.log).catch(console.error);

Step 2 — Live AIS tracking with route and ETA

Once you have IMO or MMSI, pull a live fix, recent history, active route, predicted ETA, and last port calls. This is the backbone for your LNG carrier dashboard (map, speed/course, laytime counters, and notifications).

Official sample — cURL

The following request and JSON are the official sample for a documented track (MMSI 258785000, 48 hours of history):

Official sample — JSON

{
"status": 200,
"success": true,
"message": "OK",
"data": {
"vessel": {
"imo": "9122556",
"mmsi": "258785000",
"name": null
},
"current_position": {
"latitude": 53.33708,
"longitude": 7.17993,
"speed_knots": 0,
"course_degrees": 212,
"heading_degrees": null,
"navigational_status": 5,
"timestamp_utc": "2017-01-24T04:07:35+00:00",
"age_minutes": 5109740,
"destination": null,
"eta": null
},
"predicted_eta": null,
"position_history": [],
"route": {
"departure_port": "HERACLIO",
"departure_time": "2026-04-27T21:35:36+00:00",
"destination_port": "HERACLIO",
"eta": "2026-04-30T09:00:00+00:00",
"distance_nm": null,
"avg_speed_knots": 17.1
},
"last_port_visits": [
{
"port_id": "156",
"port_name": "EMDEN",
"arrival_time": "2026-07-30T13:00:10+00:00",
"departure_time": null,
"duration_hours": null
},
{
"port_id": "10",
"port_name": "HERACLIO",
"arrival_time": "2026-04-20T12:00:00+00:00",
"departure_time": "2026-04-23T08:00:00+00:00",
"duration_hours": 68
}
],
"weather": null
}
}

What to read for LNG operations:

  • data.current_position.latitude/longitude, speed_knots, course_degrees — plot the vessel and drive speed-based alerts.
  • timestamp_utc — UTC ISO 8601; combine with age_minutes to guard against stale AIS.
  • route.departure_port, destination_port, eta, avg_speed_knots — voyage context for laytime, tug scheduling, and terminal readiness.
  • last_port_visits[] — validate the last load/discharge cycle and compute berth-to-berth KPIs.

Optional parameters to enrich the payload when applicable:

  • hours (default 24, max 168) — request up to 7 days of track history for speed profiles.
  • include_route=true — explicit in case you are toggling footprint in a mobile client.
  • include_predicted_eta=true — when you want model-computed ETA alongside AIS-reported ETA.
  • include_weather=true — for weather-aware speed/ETA decisions.

Python — fetch and normalize LNG carrier position and route

import os
import requests
from datetime import datetime, timezone

API_KEY = os.getenv("VESSELS_API_KEY")
BASE = "https://vessels-api.com/api/V1"

def track_lng_carrier(mmsi="258785000", hours=48):
url = f"{BASE}/vessels/track"
params = {"mmsi": mmsi, "hours": str(hours)}
r = requests.get(url, headers={"X-API-Key": API_KEY}, params=params, timeout=20)
r.raise_for_status()
payload = r.json()
if not payload.get("success"):
raise RuntimeError(payload.get("message", "API error"))

d = payload["data"]
vessel = d.get("vessel", {})
pos = d.get("current_position", {}) or {}
route = d.get("route", {}) or {}

# Normalize useful fields
out = {
"imo": vessel.get("imo"),
"mmsi": vessel.get("mmsi"),
"lat": pos.get("latitude"),
"lon": pos.get("longitude"),
"speed_knots": pos.get("speed_knots"),
"course": pos.get("course_degrees"),
"nav_status": pos.get("navigational_status"), # integer code
"fix_time_utc": pos.get("timestamp_utc"),
"destination": pos.get("destination") or route.get("destination_port"),
"eta_utc": pos.get("eta") or route.get("eta"),
"route_avg_speed_knots": route.get("avg_speed_knots"),
"last_port_calls": d.get("last_port_visits", []),
}
# Example: derive staleness in minutes from timestamp_utc
if out["fix_time_utc"]:
fix_dt = datetime.fromisoformat(out["fix_time_utc"].replace("Z", "+00:00"))
out["age_minutes_computed"] = int((datetime.now(timezone.utc) - fix_dt).total_seconds() / 60)

return out

if __name__ == "__main__":
data = track_lng_carrier()
print(data)

Step 3 — Monitor multiple LNG carriers in one call

Use the fleet endpoint to consolidate positions and route context across all your LNG carriers without n requests. This is ideal for a wallboard, scheduled job, or webhook fan-out.

cURL (POST /vessels/fleet)

What to use from data:

  • data.fleet.vessels_at_sea, vessels_in_port — quick status KPIs for LNG fleet control.
  • data.vessels[] each with position and route — drive per-vessel cards with ETA badges and off-course alerts.

Implementation tip: throttle your refresh by using UI polling at 30–120 seconds for dashboard views and longer for background jobs. Cache responses per-vessel for a short TTL to decouple UI from bursty AIS updates.

Step 4 — Port intelligence around congestion and arrivals

LNG carrier schedules are extremely sensitive to congestion at discharge/load terminals. Tie live tracking with a port snapshot and expected arrivals to refine ETAs and berth planning.

Real-time congestion snapshot

Query by UN/LOCODE (e.g., ARBUE for Buenos Aires) and choose a period to compute wait-time statistics. Do not hardcode any values; always read the returned fields per request.

Fields to read:

  • data.snapshot.vessels_in_anchorage, vessels_at_berth — supply/demand picture for tug/pilot windows.
  • data.statistics.avg_wait_time_hours_last_7d, max_wait_time_hours_last_7d — guide ETA buffers and demurrage risk.
  • data.statistics.port_calls_count — expected activity volume.

Expected arrivals at a port

Pull the flow of inbound vessels to anticipate berth overlap with your LNG carrier.

Use data.expected_arrivals[]: each item returns mmsi/imo/name, vessel_type, eta, and departure_port. Join on MMSI/IMO to compare your carrier’s ETA to peers competing for the same waterfront.

Step 5 — ESG and compliance: IMO CII for LNG voyages

Compliance teams tracking LNG shipments need an objective CII signal tied to voyage activity. The green endpoint computes IMO CII ratings (A → E) aligned to MEPC.339(76), with distances and estimated CO₂.

Fields to wire into your ESG dashboard:

  • data.estimated_emissions.co2_tons, co2_per_nm — rolling emissions estimates.
  • data.cii.score, data.cii.rating, data.cii.year — the compliance signal for reports and alerts.
  • data.period and distance_nm — sanity checks for the aggregation window.

Practical use: run this nightly across your LNG fleet and track CII against actual route choices and speed regimes from /vessels/track. For alerts, flag any transition from C to D/E or a sudden jump in co2_per_nm.

Putting it together — a minimal LNG carrier dashboard flow

  • Resolve vessel identity via /vessels/search to get IMO/MMSI.
  • Fetch live position and route via /vessels/track (hours=48, include_route=true).
  • Overlay expected port pressure via /ports/congestion and /port/expected-arrivals.
  • Compute and surface emissions via /vessels/green, storing daily snapshots for trend charts.
  • At fleet scale, poll /vessels/fleet for top-line statuses while lazy-loading per-vessel tracks on demand.

Implementation details that save time:

  • All timestamps are UTC ISO 8601 — no local time conversion ambiguity. For UI, display both UTC and local port time using data.timezone from /ports or /ports/data.
  • Distances are in nautical miles and speeds are in knots — keep units consistent through your ETA math.
  • Use per_page up to 100 for search pagination; cache immutable vessel particulars client-side to reduce calls.
  • Handle errors using status and message: 400 for bad params, 401 for auth, 404 not found, 422 out-of-range, 429 rate limit, 500 server error.

Additional endpoints worth wiring for LNG transportation

  • /vessels/nearby — alert if other tankers or tugs are within a NM radius of a sensitive approach channel. Useful for channel occupancy views.
  • /vessels/analytics — run 7d or 30d aggregates for distance, speed, and port calls per LNG carrier to benchmark operations.
  • /ports and /ports/data — list ports and pull a single port’s live vessel counts to support network planning pages.
  • Legacy endpoints — /vessel/position and /vessel/route if you need a minimal payload for embedded systems. Prefer /vessels/track for richer context.

End-to-end example: track, compare ETA, and guard against congestion

  1. Call /vessels/track with mmsi=258785000 and hours=48 to get live fix and route. Use route.eta if present; otherwise, rely on predicted_eta when requested.
  2. Call /port/expected-arrivals for your destination port and sort by ETA to spot collisions with other tankers arriving near the same window.
  3. Call /ports/congestion for a 7d period to adjust buffers when avg_wait_time_hours_last_7d is rising.
  4. Render status chips using current_position.navigational_status (keep it numeric if you don’t map codes) and speed_knots to separate drifting, anchored, and underway.

Common architecture patterns for transportation apps

  • Server-side cache with short TTLs (e.g., 30–120 seconds for /vessels/track, 5–10 minutes for /ports/congestion) to smooth AIS bursts and user spikes.
  • Webhooks/cron for nightly ESG: batch over LNG MMSIs via /vessels/fleet or loop /vessels/green per vessel.
  • Event-driven UX: if position age_minutes exceeds a threshold, dim map markers and display “awaiting fresh AIS.”

FAQ

Q: Do I need different auth for each endpoint?
A: No. All endpoints use the same X-API-Key header and the same base URL.

Q: Are times returned in local port time?
A: No. All timestamps are UTC ISO 8601. For local displays, combine UTC times with the port timezone from /ports or /ports/data.

Q: What’s the max history I can request from /vessels/track?
A: Use hours up to 168 (7 days). The default is 24 hours if you omit the parameter.

Q: Can I get a single call for many LNG carriers?
A: Yes. Use POST /vessels/fleet with an array of {imo, mmsi}. Include include_positions and include_routes to shape the payload.

Q: How do I detect stale AIS?
A: Check current_position.age_minutes and timestamp_utc. If age exceeds your tolerance, flag the marker or pause ETA alerts.

Start building

Spin up a test, paste the official track cURL above, and wire the JSON fields into your LNG dashboard. When you’re ready to extend to fleets, ports, and ESG, the same request shape and envelope carry across all endpoints.

Register and get a key, read the Documentation, and explore live data in the MCP to validate routes, ETAs, and congestion against your LNG lanes.

Ready to get started?

Get your API key and start tracking vessels in minutes.

Get API Key

Related posts