Monitor Vessel Transits a map visual

Monitor Vessel Transits With an API: A Hormuz Playbook

AIS Tracking

Every ops team watching the Strait of Hormuz right now is asking some version of the same question. How many tankers actually went through today, and did any of them go quiet on the way? Monitor vessel transits with an API and you can answer both, without waiting for a news summary to catch up.

This post walks through a practical pattern for counting traffic through a chokepoint and flagging the AIS-dark legs that go with it. It uses Datalastic’s Location traffic tracking endpoint and vessel history endpoint. The pattern is written against the Hormuz shuttle, where tankers transit with AIS switched off before a ship-to-ship transfer elsewhere.

The same code works for the Bab-el-Mandeb, the Bosphorus, or any other strait you need eyes on.

Here’s the direct answer, before the code: Scan a radius around the chokepoint on a schedule. Log every vessel you see, with its heading and navigational status. Then diff consecutive scans to spot who entered, who left, and who should have shown up again but didn’t. That last group is where position history earns its keep.

What does the vessels-in-radius endpoint give you?

A GET request to vessels_in_radius returns every vessel currently within a radius, in nautical miles, of a center point. You can center it on coordinates, a port, or another vessel. You can also filter by type or navigational status:

GET https://api.datalastic.com/api/v0/vessels_in_radius?api-key={API_KEY}&lat=26.566&lon=56.25&radius=30&type=Tanker

The response is a list of vessels, each with its distance from the center:

{
 "data": {
 "vessels": [
 {
 "uuid": "a1b2c3d4-...",
 "name": "KAZIMAH III",
 "mmsi": 447123456,
 "type": "Tanker",
 "lat": 26.52,
 "lon": 56.31,
 "course": 118,
 "speed": 11.2,
 "nav_status": "Under way using engine",
 "distance": 7.4
 }
 ]
 }
}

A single call gives you a snapshot, up to 500 vessels per page, with a pagination token if there are more. Run it on a schedule. Every 15 or 30 minutes works well for a chokepoint this size, and you’ve got the raw material for a transit count.

How to monitor vessel transits through a chokepoint over time?

A “transit” isn’t a field in the response. You have to derive it from consecutive scans. The simplest version keeps a set of vessel UUIDs seen in the last scan, compares it to the current one, and logs new arrivals and departures.

python
import requests
def scan(lat, lon, radius, api_key):
 resp = requests.get(
 "https://api.datalastic.com/api/v0/vessels_in_radius",
 params={"api-key": api_key, "lat": lat, "lon": lon, "radius": radius},
 )
 return {v["uuid"]: v for v in resp.json()["data"]["vessels"]}
def diff_scans(previous, current):
 arrived = [v for uuid, v in current.items() if uuid not in previous]
 departed = [v for uuid, v in previous.items() if uuid not in current]
 return arrived, departed 

Tag each arrival with its course. Course tells you eastbound from westbound without any extra lookups. That single field is how this month’s Hormuz traffic numbers, more eastbound transits, fewer westbound, get built in the first place. It’s just a count of arrivals bucketed by rough heading.

Flagging the AIS-dark “shuttle” leg:

Here’s the harder, more interesting problem. A tanker that disables AIS mid-transit won’t show up as a clean departure in your scan. It’ll just vanish from the radius results. It might reappear somewhere unexpected hours later, or not reappear in your watch area at all. Catching that means pairing the radius scan with vessel_history, on anything that departed your zone without a clean exit heading toward open water.

python
def check_for_gap(mmsi, api_key, threshold_minutes=90):
 resp = requests.get(
 "https://api.datalastic.com/api/v0/vessel_history",
 params={"api-key": api_key, "mmsi": mmsi, "days": 2},
 )
 positions = resp.json()["data"]["positions"]
 for prev, curr in zip(positions, positions[1:]):
 gap = (parse(curr["last_position_UTC"]) - parse(prev["last_position_UTC"])).total_seconds() / 60
 if gap > threshold_minutes:
 return prev, curr
 return None

Run that against any vessel that disappeared from your chokepoint scan. A gap matching the timing of its disappearance is a strong candidate for the shuttle pattern, rather than a receiver dropout. Pair it with distance, too. If the position before the gap and the position after it are consistent with a Gulf-to-Arabian-Sea run, you’ve likely found a real AIS-dark leg, not just a coverage hole.

Putting transit monitoring and congestion data together:

Once you’re logging arrivals, departures, and gaps over weeks rather than hours, three numbers fall out almost for free. Transit count per direction per week is the first. Average dwell time for vessels loitering near the strait, rather than transiting straight through, is the second. The share of departures that later show a history gap is the third.

Tracked against each other, those three are a rough proxy for exactly the “attacks are up but transits aren’t dropping” pattern in this month’s news coverage. And you’re building it from raw position data, not someone else’s summary of it.

Honest limits of monitoring vessel transits this way:

None of this proves intent, and it shouldn’t be treated as if it did. A vessel vanishing from your radius scan could mean it genuinely left your watch area on a normal course, not that it went dark on purpose. Datalastic’s position data comes from a terrestrial AIS receiver network, so a ship that’s simply out of range of any coastal station produces the exact same gap shape as one that switched its transponder off deliberately. Course and speed alone can’t tell you cargo, ownership, or who’s responsible for an attack near the chokepoint you’re watching. Treat this pipeline as triage. It tells you where to look closer, not what you’ll find when you do.

Frequently Asked Questions:

Q: How often should I poll vessels_in_radius to monitor vessel transits?

Every 15 to 30 minutes works for a strait-sized area. Polling more often mostly adds API calls without meaningfully improving your transit counts, since a tanker transiting a chokepoint takes hours, not minutes.

Q: Can I monitor transits across a whole fleet watch list instead of an area?

Yes. Swap the radius scan for repeated get_vessel calls against your MMSI list, or use find_vessels to build that list by type, flag, or size first.

Q: What’s the maximum radius for vessels_in_radius?

50 nautical miles per call. For a wider corridor, run several overlapping scans along the route and merge the results by vessel UUID.

Q: Does a history gap always mean AIS was switched off deliberately?

No. It can also mean the vessel left terrestrial AIS receiver range. Pairing the gap with plausible route geometry, not the gap alone, is what makes a flag worth a human review.

Read Other Maritime Articles 

Vessel Flag Type VS Country Name

Vessel Flag Type VS Country Name

At 07:04 UTC on 2 November 2026, the tanker GREAT FORTUNE was making 11.3 knots northeast through the Singapore Strait. Pull her record and you get a small geography lesson. The country name says Marshall Islands. Her home port field still says Bari, Italy, and the...

Track Vessel MMSI Changes With an API in Python

Track Vessel MMSI Changes With an API in Python

A vessel can appear in your tracking system under one MMSI and later return under another. If your database uses MMSI as its only identifier, that update can split one ship into two records. Your dashboard may show a new vessel while the original record stops...

Why Do Some Vessels Share the Same MMSI? (It’s Not a Bug)

Why Do Some Vessels Share the Same MMSI? (It’s Not a Bug)

Look up Symphony of the Seas in a vessel tracking database and you might notice something odd. There's the ship itself, all 228,000 gross tons of it, and then there are a handful of much smaller entries nearby carrying the exact same nine-digit MMSI. Same number,...

Maritime Weather API: Current and Hourly Data

Maritime Weather API: Current and Hourly Data

If you've ever tried to bolt weather data onto a shipping or logistics tool, you know the annoying part isn't the weather data itself. It's that marine conditions and atmospheric conditions usually come from two different providers with two different schemas, and...

AIS Spoofing in the Red Sea: What’s Really Happening

AIS Spoofing in the Red Sea: What’s Really Happening

A cargo ship off Yanbu suddenly reports a position it couldn’t possibly have reached. Its speed jumps to 45 knots, far beyond what a loaded tanker can realistically do. Minutes later, the signal disappears. Hours after that, the vessel reappears somewhere else...

How To Use ChatGPT To Track Ships in Real Time?

How To Use ChatGPT To Track Ships in Real Time?

Tracking ships using ChatGPT is possible and an easy process when it is connected to a live maritime data source such as Datalastic. On its own, ChatGPT does not maintain a live database of ship positions. It may know general information about vessels, shipping...