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 stitching them together for every vessel or port you care about turns into its own small project.
A maritime weather API worth using should collapse that into one call. Give it a location, get back both marine conditions (wave height, swell, sea surface temperature, ocean currents) and general atmospheric conditions (wind, visibility, precipitation, pressure) for that same point, without juggling two integrations.
Here’s the direct answer: Datalastic’s weather endpoint takes a location specified one of three ways, coordinates, a vessel, or a port, and returns current conditions by default, with optional 7-day daily and 7-day hourly forecasts available in the same call. Below is what that actually looks like in practice.
How do you specify a location for the weather API endpoint?
You give it exactly one of three things:
– lat and lon together, for an arbitrary point on the map.
– A vessel identifier (mmsi, imo, or the Datalastic uuid), which returns weather near that vessel’s last known position.
– A port identifier (port_unlocode or port_uuid), for weather at a specific port.
That vessel-centric option is the one people usually don’t expect from a weather API. Instead of geocoding a ship’s position yourself and passing coordinates, you just pass its MMSI or IMO number and the endpoint resolves the location internally. Useful if you’re already tracking a fleet and want weather layered on top without an extra lookup step.
The weather API request:
A minimal request for current conditions at a port, using Busan’s UN/LOCODE as an example:
curl "https://api.datalastic.com/api/v0/weather?api-key=YOUR_KEY&port_unlocode=KRPUS"Or centered on a specific vessel by MMSI, requesting both current conditions and a 7-day forecast in one call:
import requests
response = requests.get(
"https://api.datalastic.com/api/v0/weather",
params={
"api-key": "YOUR_KEY",
"mmsi": "356123000",
"mode": ["current", "daily"],
},
)
data = response.json()The mode parameter is where this gets flexible. Leave it off and you get current conditions. Pass daily for a 7-day daily forecast, hourly for a 7-day hourly forecast, or combine them, [“current”, “daily”, “hourly”], to get everything in a single response instead of three separate requests.
The returned data through the API:
The response separates marine conditions from atmospheric conditions, and pairs every measurement with a matching entry in a *_units object, so you’re never guessing whether wave height came back in meters or feet.
Data fields include wave height, wave direction, wave period, swell, sea surface temperature, ocean currents, and sea level. Atmospheric fields include air temperature, precipitation, wind speed, wind direction, wind gusts, humidity, cloud cover, visibility, pressure, and a weather code. A trimmed example, shaped to match the actual field groups the endpoint returns:
{
"location": { "lat": 35.0951, "lon": 129.0756 },
"current": {
"marine": {
"wave_height": 0.8,
"wave_direction": 145,
"wave_period": 6,
"sea_surface_temperature": 21.4
},
"atmospheric": {
"air_temperature": 24.1,
"wind_speed": 12,
"wind_direction": 200,
"visibility": 10000,
"pressure": 1013
}
},
"current_units": {
"wave_height": "m",
"sea_surface_temperature": "C",
"wind_speed": "kn",
"visibility": "m",
"pressure": "hPa"
}
}Field values above are illustrative, to show the response shape. Actual figures depend on real-time conditions at query time.
Why build weather data into a tracking workflow instead of checking it separately?
So why not just pull weather from a general-purpose weather API and vessel positions from a tracking API, and combine them yourself? You can. Plenty of teams do exactly that, and there’s nothing wrong with it.
The friction shows up at scale. If you’re monitoring conditions for a fleet of vessels or a list of ports, resolving each one’s coordinates and making a separate weather call for each is extra code you have to write, test, and maintain, and it’s an extra external dependency in your stack. Passing a vessel’s MMSI or a port’s UN/LOCODE directly into the weather call skips that step entirely, since the location resolution happens on the API side instead of yours.
There’s also a practical benefit for anything near a port specifically: pairing marine conditions with vessel or port position data in one workflow makes it straightforward to flag, say, wave height above a threshold at a berth where a smaller vessel is scheduled to dock.
Frequently Asked Questions:
Q: Can I get a forecast, or only current conditions?
A: Both. The mode parameter accepts current, daily (7-day daily forecast), and hourly (7-day hourly forecast), and you can request more than one at once in the same call.
Q: Do I need a vessel’s exact coordinates to get weather for it?
A: No. Pass the vessel’s MMSI, IMO, or Datalastic UUID directly and the endpoint resolves weather near its last known position for you.
Q: What units does the response use?
A: Every measurement field has a matching entry in a *_units object (for example, wave_height paired with its unit in current_units), so unit conversion logic lives in your code, not guesswork.
Q: Can I query weather for a port without knowing its exact coordinates?
A: Yes. Pass port_unlocode (the port’s UN/LOCODE) or port_uuid, and the endpoint looks up the port’s location for you.
Read Other Maritime Articles
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...
Monitor Vessel Transits With an API: A Hormuz Playbook
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...
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)
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,...
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?
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...
Recent Comments