- 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
by Jeremy1026
2 subcomments
- 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.
by foresterre
3 subcomments
- 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...
by elSidCampeador
5 subcomments
- 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
- I work for a consultancy that does vessel tracking as one of its main products, and yeah it's expensive! afaik they have remote teams with sensors at key points and a bunch of people using AI/software to manage things like GPS spoofing. So it's all pretty guarded proprietary stuff.
Great bit of topical datavis here.
by namewithhe1d
3 subcomments
- OP, DM me and I'll get you a persistent key for this data. Not from MarineTraffic
by bl4ckneon
1 subcomments
- Very cool! I love one off intresting sites like this. Thanks for building it and talking a little bit about where the data comes from etc.
On the note of Ai agent getting the data for you, could you not just build a chrome extention that intercepts/read the api response and then uploads it to whatever ingest endpoint you have? You could probably just call their api end points they use on the page as well but not sure what protections they have so might be a bit tricky. A custom chrome extention could do it though if they have protections.
by tomtomtom777
5 subcomments
- This is a nice overview, but please remove the PolyMarket indicator. It is an obscene prediction mechanism as it creates horrible financial incentives to a war situation. Its degenerate effects have been featured here before. [1]
Let's not condone "measurements" that are effectively ways for people to gain money on important political decisions, affecting the lives of many people.
(1) https://news.ycombinator.com/item?id=47397822
- Maps can be so misleading. It looks like a dredging operation in Omani waters could alleviate this, if we'd started decades ago.
Moving to a topographic view, it becomes clear the neck of land at "two seas view" is narrow, but tall. It would literally be moving a mountain.
Panamax and suezmax boats are smaller than ULCC supertankers.
Ferdinand De Lesseps time has passed. This would be ruinously expensive. Better to negotiate with rational intent.
- Really liked this. Made me laugh even if not intentionally funny.
Also, given how markets and news cycles are moved with words not actions these days, I really like this site.
There are still so many misaligned interests; this is a much tougher situation that may get some local stability for a period, but will likely return to chaos again.
by SomaticPirate
0 subcomment
- This website is down now for me
- You might want to rethink scraping marinetraffic before you get a call from their lawyers?
https://www.marinetraffic.com/en/p/terms
by mohavinash
0 subcomment
- That's really cool. I tried to blog about it in the early days of the war and tried to show it in realtime as well. As you discovered, it's really expensive to get ship tracking APIs. So I also did something similar, where I took the JSON from Marine Traffic and mapped it onto a Mapbox map. I did a very rudimentary-ish job — I think what you created is much more refined.
- If this is using OpenStreetMap data, you should add attribution.
- I like how this already includes the Polymarket estimate. Maybe there should be another category "new accounts on Polymarket that bet some suspiciously high amounts on those specific dates"...
- Very cool! Thanks for sharing.
There is also this one- https://hormuzstraitmonitor.com/
by frogperson
1 subcomments
- https://warescalation.com/ is also a good source of info.
- Very cool, thanks for sharing!
What's the threshold function? Do you have graduating `No --> Partially --> Mostly --> Open`?
Also what's the update cadence?
by dogscatstrees
1 subcomments
- I don't understand why ships can't just run on Oman's side of the strait, isn't there a dash-line down the middle for territorial waters integrity?
by MiSeRyDeee
2 subcomments
- This will be inherently inaccurate because data was based on public AIS signal, but ships are turning off their AIS to avoid detection.
> In an attempt to evade detection, many ships appear to be deliberately switching off their tracking system - known as AIS (Automatic Identification System).
https://www.bbc.com/news/articles/c4geg0eeyjeo
- Is it also possible to show similar movements for ships in the Red Sea, and make the types of ships colour coded?
by spaghetdefects
3 subcomments
- It was mentioned in this thread and quickly flagged, but Israel broke the ceasefire today by attacking civilians in Lebanon so Iran closed the straight. It was open prior to the ceasefire violation.
France's Macron actually just commented on this: https://x.com/EmmanuelMacron/status/2041990505760772551
by dr_robert
2 subcomments
- What did you use for the map ? Mapbox ??
- Open to whom? AFAIK some nationalities can cross freely.
by luxuryballs
2 subcomments
- So apparently the reason they don’t just go for it is due to insurance. Because Iran technically isn’t suppose to just sink a civilian vessel, but the risk is there so the ships are ordered by the owner/stakeholder not to go due to the insurance coverage. Kind of interesting, they could technically call Iran’s bluff but it would mean, they violate the insurance contract and lose coverage? I’m just reading about this so probably not the full picture.
by ananandreas
0 subcomment
- May be possible to improve the delay by reviewing ship geolocation data. Those are open to public and there is probably many apis for it
by anonfunction
1 subcomments
- Another funny thing about this was this morning I checked if the domain isthestraitofhormuzopenyet.com was available and it was, and by the time I made the site locally, put it on vercel I went to buy the domain to point DNS to it someone had bought it! I renamed it to the current site url / repo which i think might be a little nicer to type, but crazy that we had same idea on apparently the same day. I was also just telling a friend about simultaneous invention aka multiple discover[1] a few days ago, so another case of the Baader-Meinhof phenomenon[2]!
1. https://en.wikipedia.org/wiki/Multiple_discovery
2. https://en.wikipedia.org/wiki/Frequency_illusion
by amusingimpala75
0 subcomment
- Missed opportunity for “arewehormuzyet.com”
- Obviously the situation has significantly improved since then, your website is given outdated information.
https://www.vesselfinder.com/?p=OMKHS001 (click on map, zoom out). At this moment ~18 ships transiting. Not sure what the normal capacity is, and I think it's probably a bit more than this ... but it's at least mostly open.
by insane_dreamer
0 subcomment
- Very cool. I agree with some others that the YES/NO is confusing since we actually don't know due to the lag.
And wtf is a _fishing_ ship from Panama doing in the middle of the straight?
by seattle_spring
1 subcomments
- Cool! Heads up, you're probably running afoul of some TOS by hiding the map data attributions.
by goodluckchuck
1 subcomments
- I think there’s difference between A) whether ships are traversing the straight, and B) whether the straight is open / closed / could be traversed.
It’s very well possible that the straight is safe, but the vessels are unnecessarily cautious.
- I'm not really very up to speed on this, can someone explain how the strait is actually closed? Are the Iranians threatening to sink any ships that pass by, or what? How come any ships don't turn their transponders off and try to make a run for it?
by davidguetta
0 subcomment
- 4 day delay kinda kills the point of the map no?
- IRGC targeting systems have entered the chat.
by einpoklum
1 subcomments
- Iran (and various news sources) have claimed that the straights are not now, and in fact never have been, closed - provided the relevant ship was not involved/linked to the attacks on Iran, and that it coordinated with Iranian authorities.
So, it could be that:
* Iran is lying and that has not actually been an option.
* A lot of the ships which would otherwise have transitioned are involved with the war somehow.
* The relevant parties have decided not to coordinate transitions with Iran, for various reasons
* The data displayed at the link is partial for some reason.
- [dead]
by sidraarifali
0 subcomment
- [dead]
by cramsession
1 subcomments
- [flagged]
- It doesn't matter - Israel was able to ethnically cleanse and occupy large parts of Southern Lebanon, without undue Iranian interference. Mission accomplished for MIGA.
The "Israel First" administration of the US will happily trade Iran's permanent control of an international waterway for the expansion of Israel.