(GET) Historical Data | Sofar API

For the complete documentation index, see llms.txt. This page is also available as Markdown.

GET https://api.sofarocean.com/api/wave-data?spotterId=:spotterId

Returns waves and sensor data collected by the specified Spotter between startDate and endDate.

For Spotters shared, but not registered, to your account, you can only retrieve data collected within the past 30 days.

Query Parameters

Name Type Description
spotterId string The identifier of the device you wish to retrieve data from.
limit number Default: 20 Maximum: 500 * The maximum amount of data to be included in the response.
*100 if frequencyData is included in the response
startDate string Default: null ISO 8601-formatted timestamp indicating the start date for data inclusion.
endDate string Default: now() ISO 8601-formatted timestamp indicating the end date for data inclusion.
includeWaves boolean Default: true Set false to omit waves data.
includeWindData boolean Default: false Set true to return wind data.
includeSurfaceTempData boolean Default: false Set true to return surface temperature data from Spotters equipped with SST sensors.
includeTrack boolean Default: false Set true to return location tracking data.
includeFrequencyData boolean Default: false Set true to return frequency data for samples collected in Waves: Spectrum mode or HDR mode*.
* In combination with processingSources set to hdr or all.
includeDirectionalMoments boolean Default: false Set true to return directional moments data for samples collected in Waves: Spectrum mode. includeFrequencyData must also be set to true.
includePartitionData boolean Default: false Set true to return partition data from Spotters in Waves: Partition mode or HDR mode.
includeBarometerData boolean Default: false Set true to return barometer data from Spotters equipped with barometers.
processingSources string Default: embedded The data processing source, which can be embedded, hdr*, or all.
*hdr is only applicable to Spotters in HDR mode with cellular enabled.

Response Description

For more information on the data collected by Spotters, see the product documentation.

Name Description Units
significantWaveHeight meters
peakPeriod seconds
meanPeriod seconds
varianceDensity m2/Hz
windSpeed m/s

Examples

Example Request

Copy

curl "https://api.sofarocean.com/api/wave-data?spotterId=SPOT-0222&limit=20" -H 'token: YOUR_API_TOKEN'

Example Response

200

Copy

{
  "data": {
    "spotterId": "SPOT-0222",
    "limit": 20,
    "waves": [
      {
        "significantWaveHeight": 1.91,
        "peakPeriod": 10.24,
        "meanPeriod": 7.72,
        "peakDirection": 302.735,
        "peakDirectionalSpread": 55.142,
        "meanDirection": 279.846,
        "meanDirectionalSpread": 70.635,
        "timestamp": "2020-01-08T00:24:31.000Z",
        "latitude": 34.64697,
        "longitude": -159.877,
        "processing_source": "embedded"
      },
      {...}
    ],
    "track": [
      {
        "timestamp": "2017-09-27T22:41:27.000Z",
        "latitude": 34.777083,
        "longitude": -120.7396172,
        "processing_source": "embedded"
      },
      {
        "timestamp": "2017-09-27T22:44:27.000Z",
        "latitude": 34.7769077,
        "longitude": -120.7390585,
        "processing_source": "embedded"
      },
      ...
    ],
    "frequencyData": [...],
    "wind": [...],
    "partitionData": [...]
  }
}