Lurker News
I built this because I was interested in the data. Didn't fully get it to what I wanted, but thought I'd share it nonetheless. Maybe someone has better data sources they could share!

Turns out live ship tracking APIs are expensive so I manually just copied the json from https://www.marinetraffic.com/en/ais/home/centerx:57.4/cente... I'll probably have an ai agent do the same thing on some cron interval, if this gets any fanfare.
To actually know if the port is open without live ship tracking I found https://portwatch.imf.org/pages/cb5856222a5b4105adc6ee7e880a... which was perfect, except it has 4 day lag!
I also thought of adding news feed parsing or prediction market data to get a more definitive answer on if it's open right when you load it, but I spent a few hours and am gonna move on for now.

Comments (209) 45 threads

gloosx3 replies#
Hello OP, I think using an ai agent to fetch the JSON is a bit of an overkill

Here is a node.js script for you which will fetch the data and save it to the file:

  import fs from 'fs'
  import puppeteer from 'puppeteer-extra'
  import StealthPlugin from 'puppeteer-extra-plugin-stealth'
  puppeteer.use(StealthPlugin())

  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  async function fetchCoords(x, y, z = 8, station = 0) {
    await  page.goto(`https://www.marinetraffic.com/getData/get_data_json_4/z:${z}/X:${x}/Y:${y}/station:${station}`);

    const jsonRaw = await page.evaluate(() => document.body.innerText);

    const json = JSON.parse(jsonRaw)

    return json
  }

  const data8353 = await fetchCoords(83, 53)

  const data8453 = await fetchCoords(84, 53)

  const data8354 = await fetchCoords(83, 54)

  const data8454 = await fetchCoords(84, 54)

  const fullData = { ...data8353, ...data8453, ...data8354, ...data8454 }

  fs.writeFileSync('data.json', JSON.stringify(fullData, null, 2))

  console.log('done!')

  process.exit(0)

Just like this, no need to spend a cent on expensive APIs or tokens
anonfunction#
Take your upvote, love the old school hn spirit.

Reminds me of when I was speaking at a conference back in the mid 2010's with a presentation titled "Join the dark side of APIs" or something akin to that, where I showed many of the newly popularized "single page apps (SPAs)" relied on undocumented and public APIs, often without any authorization. Immediately followed by a talk by a business type guy on API copyright or something or other.

TomasBM#
If I had to pick one thing I like about software devs as a group, it's this: you find a problem, you solve it, you share the solution.
ericmcer1 reply#
What is the AI agent doing in this interaction? This is a public API exposed to any browser...
gloosx#
Well, not to every every browser, there is some cloudflare bs preventing simple curling and you actually need a stealth-mode puppeteer to go around it.
Jeremy10262 replies#
The data being ~4 days delayed does kind of make this less useful. It is a nice concept and cool to see the historical data though. Just think the domain and the large "NO" doesn't really fit with the lack of current data.
anonfunction2 replies#
Totally agree, I put some text and tried to make it clear. My first intention was to find some live ship tracking API and see how many ships cross the strait, but they were all hundreds of dollars a month, and behind enterprise contact forms.
Jeremy1026#
I've done some small scale ship tracking in the past, and yeah, anything beyond finding a specific ship while it is near the shore is stupid expensive.
baq3 replies#
You need to send an analyst there with binoculars, a box of cigars and $15k in cash to get realtime trustworthy data
golem146 replies#
Do these ships not use transponders? E.g., in the US you can use a SDR dongle and a RPI to read local updates. The straight isn't very wide.

Seems cheaper than the cigars and cash.

Continue this thread — 6 replies

jojobas#
The strait is wider than horizon distance from reasonable heights. Also that's how you don't hear back from the analyst in many different ways.
numpad0#
or just a cubesat on a polar orbit with a Nikon Z9 inside
anonfunction1 reply#
What do you think of adding prediction market data to the indication? So basically there's this:

https://polymarket.com/event/strait-of-hormuz-traffic-return...
My approach would be if that jumps up to 75%+ it would change to YES. And if we get into May they have one for then too:
https://polymarket.com/event/strait-of-hormuz-traffic-return...
You can actually see in the last 24 hours it jumped up with the ceasefire and Iran saying they would open it and fell back with reports it's been shut down again easlier today.
Edit: I added this, I can see a few downvotes, happy to discuss here or in the github repo if anyone has strong feelings on it!

killingtime741 reply#
i didnt downvote you but why wouldn't i just go to Polymarket directly for this
anonfunction1 reply#
I mean you obviously could, the url is a little harder to remember and it doesn't have crossing data. This was just a small fun project I did, so you're free to do whatever you like. The reason I thought of using polymarket data is I didn't have live ship tracking data which is what I originally intended to use.

Continue this thread — 1 reply

elSidCampeador5 replies#
I believe NASA / EU provide daily satellite imagery for free (which is of relatively high quality too). I wonder if there's a way to take that data, and training some kind of image recognition model that figures out "movement" or something to the same end? Would be cool to see
anonfunction3 replies#
Funnily enough, I did find a few satellite sources at the beginning for the map background and noticed that all the ships seemed to be scrubbed from the image. It's an interesting idea, thanks for the comment!

The sources I used were:
- ESRI World Imagery[1] — free satellite tiles, high-res, but ships are stripped out from the imagery
- NASA GIBS - VIIRS[2] — near real-time daily satellite imagery from NASA, but resolution is ~375m so ships aren't visible anyway
- Mapbox Satellite[3] — high-res and looks great, but same deal — ships are scrubbed from the composited imagery
1. https://server.arcgisonline.com/ArcGIS/rest/services/World_I... 2. https://earthdata.nasa.gov/engage/open-data-services-softwar... 3. https://www.mapbox.com

letcree1 reply#
Ai2 has vessel detection models for Sentinel-1 and Sentinel-2 (ESA) along with Landsat 8, Landsat 9, and VIIRS Nighttime Lights (NASA/USGS/NOAA):

- Sentinel-2 (10 m/pixel): https://github.com/allenai/rslearn_projects/blob/master/docs...
- Landsat (15-30 m/pixel): https://github.com/allenai/rslearn_projects/blob/master/docs...
- VIIRS Nighttime Lights: https://github.com/allenai/vessel-detection-viirs
I think you can see these vessel detections at https://app.skylight.earth/ ("Try out a limited version as a guest") but they seem to be delayed by 48 hours.
VIIRS is very low resolution but you can make out vessels with reasonable accuracy in the night-time images.
VIIRS covers most locations at least once per day, but the other sensors capture a given location only once per 5-10 days (although when combined, Sentinel-1/Sentinel-2/Landsat should provide close-to-daily coverage).

colechristensen1 reply#
It turns out during a war having real time satellite imagery of shipping would be a poor choice.
lukewarm7072 replies#
but what about other experiments, just saying, it's subjective

you could, presumably, mess up other instruments than visual to interfere with enemy countries

Continue this thread — 2 replies

lukewarm7071 reply#
modifying the data is crazy

doesn't this sort of thing invalidate any kind of experiment because the instrument is no longer trustworthy

lazide#
Most of them remove clouds for similar reasons - moving/temporary stuff in individual images makes the underlying data useless.
barchar#
I think sentinel-1 has a SAR instrument, it's very easy to see ships with that data
000ooo000#
Read somewhere once that trading firms use satellite imagery of shipping to inform trading strategy. Don't know any more about it unfortunately but it sounds interesting.
creatonez1 reply#
Public satellite imagery is heavily censored these days.
kzrdude1 reply#
Tangential, but I was wondering if it's maybe related: why doesn't google maps and google earth want to show satellite images of the ocean? It just overlays those areas with blue color.
creatonez#
Part of it is just because the ocean is difficult to photograph. The parts of coastline that do have ocean surface imagery have crazy artifacting from the sun reflection, and the color is inconsistent from constantly changing sediment and algae levels.

By not providing imagery of the ocean surface, it also gets to display ocean floor topography data it wouldn't otherwise get to show without having to add another mode.
I assume another reason is that it reduces the total size of the imagery, which would have been a plus on the 2001 computers that Google Earth was originally developed on.
I believe you can get this imagery from other sources (aside from things that are government-censored), but you face the same problem Google did in how to stitch it together without it being a patchwork of different moments in time.

tgsovlerkhgsel1 reply#
The ESA (Sentinel) data is somewhat delayed and has a low revisit period (AFAIK 6 days, although you might get lucky and get more due to overlap the further away from the equator you get) and low resolution. The Sentinel-1 data (SAR, synthetic aperture radar) might be somewhat useful for this as ships should be more easily identifiable on it and you don't have to worry about cloud cover, but probably still less useful than the delayed crossing data.

Ships don't move that quickly; AIS data refreshed once every few hours would probably be more than good enough.

baq#
AIS over there is jammed and spoofed. Nobody wants to get bombed and certain Greek and Chinese owners run the strait dark with their crews apparently very happy about the danger pay.
foresterre4 replies#
According to the Financial Times (1), the straight is "open" but Iran is extorting fees for passing ships.

> "Iran will demand that shipping companies pay tolls in cryptocurrency for oil tankers passing through the Strait of Hormuz, as it seeks to retain control over passage through the key waterway during the two-week ceasefire."
If they really will start doing so for all shipping, that would be odd since the straight itself is in Oman's territorial waters. Even so, the UNCLOS convention (2) requires free transit:
> Article 44 > Duties of States bordering straits > > States bordering straits shall not hamper transit passage and shall give appropriate publicity to any danger to navigation or overflight within or over the strait of which they have knowledge. There shall be no suspension of transit passage.
It would be unprecedented and unlawful, but I guess previous actions of Israel, the US and Iran have shown our world is beyond adhering to laws and agreements now.
(1) https://www.ft.com/content/02aefac4-ea62-48db-9326-c0da373b1... (2) United Nations Convention on Law of the Sea: https://www.un.org/depts/los/convention_agreements/texts/unc...

femiagbabiaka2 replies#
Oman and Iran are splitting the fees RE: the statements by Iran.
AnimalMuppet#
But collected by Iran, not by Oman. Which is weird, if it's really Oman's territorial waters.
FrustratedMonky2 replies#
And Trump.

Didn't Trump float the Idea of a joint venture with Iran on the Fees?
Amazing, that once you could make money on a toll, Trump was "there is profit in peace? lets get this peace thing going"

hattmall#
Trump and the US effectively control the commerce because they are the only source of insurance. Even with payments and promises from Iran, no ship is sailing without insurance coverage. There is no one insuring the ships other than the US program Trump created.
bawana#
Maybe we can get israel to pay some of our billion dollars a day military costs. Adelson gave stump 750 million for campaign. There must be a lot of wallets in the us that will open for israel. Maybe a synagogue tax?
anonfunction1 reply#
It's super hard to tell what's actually happening. Because I've seen other reports that Iran state media halted traffic earlier today, as reported by Washington Post[1]:

> With Trump and Iran each claiming victory, but still far apart on key issues, traffic in the Strait of Hormuz remained at a standstill Wednesday.
1. https://www.washingtonpost.com/world/2026/04/08/trump-iran-w...

femiagbabiaka1 reply#
That's because Israel killed hundreds of civilians in Lebanon today.
spiderfarmer6 replies#
It's only hard to tell if you rely on the US billionaire controlled media.

Continue this thread — 6 replies

foxglacier11 replies#
Iran hasn't ratified it and is not a party to that agreement. You can't really fault a country for not complying with an extraterritorial law made by and for other countries.

Continue this thread — 11 replies

Continue this thread — 1 more reply

Load more comments