Restful endpoints in the Marine Weather API provide a few different types of information:
Data type | Description |
​Weather object metadata​ | These endpoints provide information about currently available models, variables, and categories of data that can be used throughout the Weather API. |
​Forecast data​ | 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 |
More metadata on each model and variable is available using the Weather Object Metadata endpoints.
Sofar Waves | Variable |
Significant Wave Height |
|
Mean Wave Direction |
|
Mean Wave Directional Spread |
|
Mean Wave Period |
|
Peak Wave Frequency |
|
Peak Wave Direction |
|
Significant Wind Wave Height |
|
Mean Wind Wave Direction |
|
Mean Wind Wave Directional Spread |
|
Peak Wind Wave Period |
|
Significant First Swell Wave Height |
|
Mean First Swell Direction |
|
Mean First Swell Directional Spread |
|
Peak First Swell Period |
|
Significant Second Swell Wave Height |
|
Mean Second Swell Direction |
|
Mean Second Swell Directional Spread |
|
Peak Second Swell Period |
|
Significant Third Swell Wave Height |
|
Mean Third Swell Direction |
|
Mean Third Swell Directional Spread |
|
Peak Third Swell Peak Period |
|
NOAA Waves | Variable |
Significant Wave Height |
|
Wave Direction |
|
Peak Wave Period |
|
Significant Wind Wave Height |
|
Mean Wind Wave Period |
|
Mean Wind Wave Direction |
|
Sea Surface Temperature | Variable |
Sea Surface Temperature |
|
Currents | Variable |
Surface Current Velocity |
|
Surface Current Velocity Direction |
|
Eastward Surface Current Velocity |
|
Westward Surface Current Velocity |
|
Winds | Variable |
Wind Velocity |
|
Wind Direction |
|
Eastward Wind Velocity |
|
Northward Wind Velocity |
|
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.pyimport requestsparams = {'token': 'YOUR_API_TOKEN','longitude': -152.0001,'latitude': 37.0001,'variableIDs': ['SofarOperationalWaveModel-significantWaveHeight', 'SofarOperationalWaveModel-meanDirection']}response = requests.get(url='https://api.sofarocean.com/marine-weather/v1/models/SofarOperationalWaveModel/forecast/point',params=params )data = response.json()print(data)
​