Sofar API
Search…
Marine Weather
Gives access to our advanced Marine Weather data.
Restful endpoints in the Marine Weather API provide a few different types of information:
Data type
Description
These endpoints provide information about currently available models, variables, and categories of data that can be used throughout the Weather API.
These endpoints can be used to retrieve forecast output for specific times and locations.
Hindcast data
These endpoints can be used to retrieve hindcast output for specific times and locations.
Tile Server
These endpoints return raster tiles (images) of our weather data

Available Variables

More metadata on each model and variable is available using the Weather Object Metadata endpoints.
Sofar Waves
Variable
Significant Wave Height
SofarOperationalWaveModel-significantWaveHeight
Mean Wave Direction
SofarOperationalWaveModel-meanDirection
Mean Wave Directional Spread
SofarOperationalWaveModel-meanDirectionalSpread
Mean Wave Period
SofarOperationalWaveModel-meanPeriod
Peak Wave Frequency
SofarOperationalWaveModel-peakFrequency
Peak Wave Direction
SofarOperationalWaveModel-peakDirection
Significant Wind Wave Height
SofarOperationalWaveModel-significantWaveHeightWindWaves
Mean Wind Wave Direction
SofarOperationalWaveModel-meanDirectionWindWaves
Mean Wind Wave Directional Spread
SofarOperationalWaveModel-meanDirectionalSpreadWindWaves
Peak Wind Wave Period
SofarOperationalWaveModel-peakPeriodWindWaves
Significant First Swell Wave Height
SofarOperationalWaveModel-significantWaveHeightFirstSwell
Mean First Swell Direction
SofarOperationalWaveModel-meanDirectionFirstSwell
Mean First Swell Directional Spread
SofarOperationalWaveModel-meanDirectionalSpreadFirstSwell
Peak First Swell Period
SofarOperationalWaveModel-peakPeriodFirstSwell
Significant Second Swell Wave Height
SofarOperationalWaveModel-significantWaveHeightSecondSwell
Mean Second Swell Direction
SofarOperationalWaveModel-meanDirectionSecondSwell
Mean Second Swell Directional Spread
SofarOperationalWaveModel-meanDirectionalSpreadSecondSwell
Peak Second Swell Period
SofarOperationalWaveModel-peakPeriodSecondSwell
Significant Third Swell Wave Height
SofarOperationalWaveModel-significantWaveHeightThirdSwell
Mean Third Swell Direction
SofarOperationalWaveModel-meanDirectionThirdSwell
Mean Third Swell Directional Spread
SofarOperationalWaveModel-meanDirectionalSpreadThirdSwell
Peak Third Swell Peak Period
SofarOperationalWaveModel-peakPeriodThirdSwell
Winds
Variable
Wind Velocity
GFS-magnitude10MeterWind
Wind Direction
GFS-direction10MeterWind
Eastward Wind Velocity
GFS-windVelocity10MeterEastward
Northward Wind Velocity
GFS-windVelocity10MeterNorthward

How to get a current marine weather forecast

Retrieving a current marine weather forecast is as simple as making a HTTP GET request to the correct URL with a valid API token. Here's an example:
An example request in Python might look like:
get_forecast.py
1
import requests
2
params = {
3
'token': 'YOUR_API_TOKEN',
4
'longitude': -152.0001,
5
'latitude': 37.0001,
6
'variableIDs': ['SofarOperationalWaveModel-significantWaveHeight', 'SofarOperationalWaveModel-meanDirection']
7
}
8
response = requests.get(
9
url='https://api.sofarocean.com/marine-weather/v1/models/SofarOperationalWaveModel/forecast/point',
10
params=params )
11
data = response.json()
12
print(data)
Copied!
Last modified 2mo ago