# (GET) Latest Data

<mark style="color:blue;">`GET`</mark> `https://api.sofarocean.com/api/latest-data?spotterId=:spotterId`

Returns the most recently transmitted device, waves and sensor data from a Spotter, specified by `spotterId`.&#x20;

## Query Parameters

| Name                        | Type    | Description                                                                                                                                                                       |
| --------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `spotterId`                 | string  | The identifier of the device you wish to retrieve information from.                                                                                                               |
| `includeWindData`           | boolean | <p>Default: <code>false</code><br></p><p>Set <code>true</code> to return wind data.</p>                                                                                           |
| `includeSurfaceTempData`    | boolean | <p>Default: <code>false</code><br></p><p>Set <code>true</code> to return surface temperature data from </p><p>Spotters equipped with SST sensors.</p>                             |
| `includeDirectionalMoments` | boolean | <p>Default: <code>false</code><br></p><p>Set <code>true</code> to return directional moments data from Spotters in <strong>Waves: Spectrum (Full)</strong> mode.</p>              |
| `includePartitionData`      | boolean | <p>Default: <code>false</code><br></p><p>Set <code>true</code> to return partition data from Spotters in <strong>Waves: Partition</strong> mode or <strong>HDR</strong> mode.</p> |
| `includeBarometerData`      | boolean | <p>Default: <code>false</code><br></p><p>Set <code>true</code> to return barometer data from Spotters equipped with barometers.</p>                                               |

## Response Description

The response body includes general device information, the device status and data transmission details, and a data stream of the most recently transmitted samples, grouped by data type and ordered by timestamp.

{% hint style="info" %}
For more information on the data collected by Spotters, refer to the [product documentation](https://www.sofarocean.com/posts/spotter-product-documentation).
{% endhint %}

| Name             | Type   | Description                                                                                                                                                                                                                                                                |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `spotterId`      | string | The Spotter's identifier.                                                                                                                                                                                                                                                  |
| `spotterName`    | string | The Spotter's display name, as configured in the [Spotter Dashboard](https://spotter.sofarocean.com/). Returns `""` if no display name has been set.                                                                                                                       |
| `payloadType`    | string | The type of payload. Can be `waves` (standard or partitioned), `sensorData` (Smart Mooring), `full` (full wave spectrum) or `track` (Track mode).                                                                                                                          |
| `batteryVoltage` | number | <p>The Spotter's battery voltage level in volts. <br><br>Full battery: <code>3.8</code> - <code>4.1</code><br>Mid-level capacity: <code>3.6</code>-<code>3.7</code></p><p>Low: <code>3.5</code><br>Critically low: <code>3.3</code><br>Empty battery: <code>3.0</code></p> |
| `batteryPower`   | number | <p>The Spotter's battery power level in watts. <br><br>A negative value indicates the battery is supplying power to the system. A positive value indicates the solar system is recharging the battery.</p>                                                                 |
| `solarVoltage`   | number | The Spotter's measured solar-panel voltage in volts.                                                                                                                                                                                                                       |
| `humidity`       | number | <p>The Spotter's internal relative humidity as a percentage (%).<br><br>Sharp increases in absolute humidity (accounting for temperature) may indicate a leak. If relative humidity is greater than 70%, we recommend replacing the desiccant.</p>                         |
| `waves`          | array  | Waves data.                                                                                                                                                                                                                                                                |
| `wind`           | array  | Wind data if `includeWindData` is set to `true`.                                                                                                                                                                                                                           |
| `surfaceTemp`    | array  | Surface temperature data from Spotters equipped with SST sensors if `includeSurfaceTempData` is set to `true`.                                                                                                                                                             |
| `frequencyData`  | array  | Frequency data from Spotters in **Waves: Spectrum (Full)** mode.                                                                                                                                                                                                           |
| `partitionData`  | array  | Partition data from Spotters in **Waves: Partition** mode or **HDR** mode if `includePartitionData` is set to `true`.                                                                                                                                                      |
| `barometerData`  | array  | Barometer data from Spotters equipped with barometers if `includeBarometerData` is set to `true`.                                                                                                                                                                          |
| `track`          | array  | The Spotter's position at given timestamps.                                                                                                                                                                                                                                |
| `commSource`     | string | <p>The telemetry source used to transmit the data. </p><p></p><p>Can be <code>cellular</code> or <code>satellite</code>.</p>                                                                                                                                               |

### Data Samples

The returned data types depend on your set query parameters as well as your Spotter's configured [data mode](https://sofarocean.notion.site/Spotter-Data-Modes-e78a76f5f94e49f58bfd68845113c4a7) at the time of collection.

Regardless, all data sample arrays include the location (`latitude`, `longitude`) when the report was encoded and transmitted as well as an ISO 8601-formatted `timestamp`, indicating the end of the sample collection period. Differences in transmission times are likely due to differences in sampling cadences.

Your Spotter's configured data mode and update rate will also impact the amount of samples included in a single data transmission. A Spotter with default settings (Waves: Standard and hourly update rate), for example, will include two 30-minute samples in an hourly update. To review or change your Spotter's data mode and update rate, open the [Spotter Dashboard](https://spotter.sofarocean.com/), find its Spotter card in the Map View, click the Gear icon to open the Settings tab, and scroll down to the Satellite data and Cellular data sections.

<details>

<summary><code>waves</code></summary>

| Name                    | Type   | Description                                     |
| ----------------------- | ------ | ----------------------------------------------- |
| `significantWaveHeight` | number | Bulk significant wave height in meters (m).     |
| `peakPeriod`            | number | Peak wave period in seconds (s).                |
| `meanPeriod`            | number | Mean wave period in seconds (s).                |
| `peakDirection`         | number | Peak wave direction in degrees (°).             |
| `peakDirectionalSpread` | number | Peak wave directional spreading in degrees (°). |
| `meanDirection`         | number | Mean wave direction in degrees (°).             |
| `meanDirectionalSpread` | number | Mean wave directional spreading in degrees (°). |

</details>

<details>

<summary><code>wind</code></summary>

| Name                | Type    | Description                                                                                            |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------ |
| `speed`             | number  | Wind speed in meters per second (m/s).                                                                 |
| `direction`         | number  | Wind direction in degrees (°).                                                                         |
| `seasurfaceId`      | integer | Classification of the sea surface, with `1` meaning glassy, `2` meaning choppy, and `3` meaning rough. |
| `algorithm_version` | integer | The wind algorithm version, with `1` indicating version 1 and `2` indicating version 2.                |

</details>

<details>

<summary><code>surfaceTemp</code></summary>

| Name      | Type   | Description                             |
| --------- | ------ | --------------------------------------- |
| `degrees` | number | The surface temperature in degrees (°). |

</details>

<details>

<summary><code>frequencyData</code></summary>

| Name                | Type  | Description                                                                                             |
| ------------------- | ----- | ------------------------------------------------------------------------------------------------------- |
| `frequency`         | array | Center frequency in hertz (Hz).                                                                         |
| `df`                | array | Spectral width in hertz (Hz).                                                                           |
| `a1`                | array | First component of first directional movement. Returned if `includeDirectionalMoments`is set to true.   |
| `b1`                | array | Second component of first directional movement. Returned if `includeDirectionalMoments`is set to true.  |
| `a2`                | array | First component of second directional movement. Returned if `includeDirectionalMoments`is set to true.  |
| `b2`                | array | Second component of second directional movement. Returned if `includeDirectionalMoments`is set to true. |
| `varianceDensity`   | array | Surface variance density in meters squared per hertz (m<sup>2</sup>/Hz).                                |
| `direction`         | array | Wave direction.                                                                                         |
| `directionalSpread` | array | Wave directional spread.                                                                                |

</details>

<details>

<summary><code>partitionData</code></summary>

| Name                    | Type   | Description                                                   |
| ----------------------- | ------ | ------------------------------------------------------------- |
| `startFrequency`        | number | Starting frequency of the partition in hertz (Hz).            |
| `endFrequency`          | number | Ending frequency of the partition in hertz (Hz).              |
| `significantWaveHeight` | number | Significant wave height of the partition in meters (m).       |
| `meanPeriod`            | number | Mean wave period of the partition in meters (m).              |
| `meanDirection`         | number | Mean wave direction of the partition in degrees (°).          |
| `meanDirectionalSpread` | number | Mean wave directional spread of the partition in degrees (°). |

</details>

<details>

<summary><code>barometerData</code></summary>

| Name             | Type   | Description                                                                                                                              |
| ---------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `value`          | number | The measured value.                                                                                                                      |
| `units`          | string | <p>The units of measurement.<br><br>e.g., <code>hPa</code></p>                                                                           |
| `unit_type`      | string | <p>A contextual description of what is being measured.<br><br>e.g., <code>barometric\_pressure</code></p>                                |
| `data_type_name` | string | <p>The type of information being sent by a sensor, as ingested by the API.<br><br>e.g., <code>sofar\_meanbaropressure\_13bits</code></p> |

</details>

<details>

<summary> <code>track</code></summary>

The `track` array only contains the location (`latitude`, `longitude`) when the report was encoded and transmitted as well as an ISO 8601-formatted `timestamp`, indicating the end of the sample collection period.

</details>

## Examples

### Example Request

```bash
curl "https://api.sofarocean.com/api/latest-data?spotterId=SPOT-0018" -H 'token: YOUR_API_TOKEN'
```

### Example Response

{% tabs %}
{% tab title="200" %}
{% hint style="info" %}
`frequencyData` is only transmitted in **Waves: Spectrum** mode or **HDR** mode, and `partitionData` is only transmitted in **Waves: Partition** mode or **HDR** mode.
{% endhint %}

{% code expandable="true" %}

```json
{
    "data": {
        "spotterId": "SPOT-010423",
        "spotterName": "",
        "payloadType": "full",
        "batteryVoltage": 4.01,
        "batteryPower": -0.1,
        "solarVoltage": 0,
        "humidity": 75.2,
        "track": [
            {
                "latitude": -37.4935167,
                "longitude": 32.9982667,
                "timestamp": "2026-03-11T19:06:01.000Z"
            },
            {
                "latitude": -37.5133667,
                "longitude": 33.00605,
                "timestamp": "2026-03-11T19:26:01.000Z"
            },
            {
                "latitude": -37.5337333,
                "longitude": 33.0134333,
                "timestamp": "2026-03-11T19:46:01.000Z"
            }
        ],
        "waves": [
            {
                "significantWaveHeight": 2.347,
                "peakPeriod": 10.24,
                "meanPeriod": 8.996,
                "peakDirection": 208.988,
                "peakDirectionalSpread": 41.774,
                "meanDirection": 187.491,
                "meanDirectionalSpread": 47.082,
                "timestamp": "2026-03-11T19:46:01.000Z",
                "latitude": -37.53373,
                "longitude": 33.01343
            }
        ],
        "wind": [
            {
                "speed": 4.4,
                "direction": 137,
                "location": {
                    "latitude": -37.5337333,
                    "longitude": 33.0134333,
                    "timestamp": "2026-03-11T19:46:01.000Z"
                },
                "seasurfaceId": 1,
                "algorithm_version": 1
            }
        ],
        "surfaceTemp": [
            {
                "degrees": 22.04,
                "location": {
                    "latitude": -37.4935167,
                    "longitude": 32.9982667,
                    "timestamp": "2026-03-11T19:06:01.000Z"
                }
            },
            {
                "degrees": 22.02,
                "location": {
                    "latitude": -37.5133667,
                    "longitude": 33.00605,
                    "timestamp": "2026-03-11T19:26:01.000Z"
                }
            },
            {
                "degrees": 22.02,
                "location": {
                    "latitude": -37.5337333,
                    "longitude": 33.0134333,
                    "timestamp": "2026-03-11T19:46:01.000Z"
                }
            }
        ],
        "partitionData": [
            {
                "partitions": [
                    {
                        "startFrequency": 0.025,
                        "endFrequency": 0.078125,
                        "significantWaveHeight": 0.69,
                        "meanPeriod": 15.38,
                        "meanDirection": 240.014,
                        "meanDirectionalSpread": 29.828
                    },
                    {
                        "startFrequency": 0.078125,
                        "endFrequency": 0.8,
                        "significantWaveHeight": 0.97,
                        "meanPeriod": 8.58,
                        "meanDirection": 251.647,
                        "meanDirectionalSpread": 29.645
                    }
                ],
                "location": {
                    "latitude": -37.5337333,
                    "longitude": 33.0134333,
                    "timestamp": "2026-03-11T19:46:01.000Z"
                }
            }
        ],
        "frequencyData": [
            {
                "frequency": [0.0293,0.03906,0.04883,...],
                "df": [0.00977,0.00977,0.00977,...],
                "a1": [-0.018573,-0.043988,-0.292278,...],
                "b1": [0.100684,0.147605,0.587488,...],
                "a2": [-0.143695,-0.148583,-0.27566,...],
                "b2": [-0.186706,-0.174976,-0.319648,...],
                "varianceDensity": [0.003497984,0.01050112,0.29932134400000004,...],
                "direction": [169.54824416491098,163.4053337896601,153.54944229298735,...],
                "directionalSpread": [76.76853080901289,74.52769022723301,47.512177743358464,...],
                "timestamp": "2026-03-11T19:46:01.000Z",
                "latitude": -37.53373,
                "longitude": 33.01343
            }
        ],
        "barometerData": [
            {
                "units": "hPa",
                "value": 1029.5,
                "unit_type": "barometric_pressure",
                "data_type_name": "sofar_meanbaropressure_13bits",
                "latitude": -37.4935167,
                "longitude": 32.9982667,
                "timestamp": "2026-03-11T19:06:01.000Z"
            },
            {
                "units": "hPa",
                "value": 1029.5,
                "unit_type": "barometric_pressure",
                "data_type_name": "sofar_meanbaropressure_13bits",
                "latitude": -37.5133667,
                "longitude": 33.00605,
                "timestamp": "2026-03-11T19:26:01.000Z"
            },
            {
                "units": "hPa",
                "value": 1029.4,
                "unit_type": "barometric_pressure",
                "data_type_name": "sofar_meanbaropressure_13bits",
                "latitude": -37.5337333,
                "longitude": 33.0134333,
                "timestamp": "2026-03-11T19:46:01.000Z"
            }
        ],
        "commSource": "satellite"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="400" %}

```json
{
    "status": "error",
    "message": "Device not found"
}
```

{% endtab %}

{% tab title="401" %}
**Incorrect token:**

```json
{
    "message": "Authentication Failed"
}
```

**Missing token:**

```json
{
    "message": "No token provided"
}
```

{% endtab %}
{% endtabs %}
