Forecast Data

This endpoint can be used to retrieve forecast output for specific times and locations.

get
Get Point Forecast

https://api.sofarocean.com/marine-weather/v1/models/:model_id/forecast/point
Returns forecast data from the specified model at a single latitude and longitude point. Variables and model IDs used as parameters in the endpoint can be queried from the metadata endpoints described in the Weather Object Metadata section. The endpoint will return the output of the specified operational forecast model and variables for the next 7 days.
Request
Response
Request
Path Parameters
model_id
required
string
The ID of the model from which you want to retrieve forecast data
Query Parameters
token
required
string
A valid API token
variableIDs
required
array
An array of comma separated strings containing variable IDs which you want to retrieve as part of the forecast data. A list of valid variable IDs for any given model can be retrieved from the /weather/v1/models/:model_id endpoint.
longitude
required
number
The longitude of the requested forecast point. Can be positive or negative.
latitude
required
number
The latitude of the requested forecast point. Must be between -90 and 90 degrees.
Response
200: OK
Forecast data successfully retrieved.
{
"modelID": "SofarOperationalWaveModel",
"requestTime": "2020-03-07T00:08:17.965Z",
"requestLocation": {
"latitude": 37.0001,
"longitude": -152.0001
},
"forecastVariables": [
{
"variableID": "SofarOperationalWaveModel-significantWaveHeight",
"variableName": "significantWaveHeight",
"dataCategory": "surfaceWaves",
"physicalUnit": "m",
"values": [
{
"timestamp": "2020-03-07T00:00:00.000Z",
"value": 3.28,
"leadTimeHours": 6
},
{
"timestamp": "2020-03-07T01:00:00.000Z",
"value": 3.23,
"leadTimeHours": 7
},
{
"timestamp": "2020-03-07T02:00:00.000Z",
"value": 3.1799998,
"leadTimeHours": 8
}
]
}
]
}
400: Bad Request
The request parameters were invalid.
{ "message": "\"longitude\" is required" }
403: Forbidden
A valid API token was not provided or you do not have access to the weather API.
{ "message": "Invalid API token" }
404: Not Found
The model with the specified ID does not exist or the specified variables do not exist on the model.
{ "message": "Model 'not-a-real-model' does not exist." }
{ "message": "Variable 'not-a-real-variable' does not exist on model 'SofarOperationalWaveModel'" }
422: Unprocessable Entity
Used when an invalid value was provided for latitude.
{ "message": "Latitude 180 is invalid. Latitude must be between -90 and 90 degrees" }