# (GET) Sensor Data

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

Returns Smart Mooring sensor data collected and transmitted by a Spotter, specified by `spotterId`, between `startDate` and `endDate`.

## Query Parameters

<table><thead><tr><th width="275.57421875">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>spotterId</code></td><td>string</td><td>The Spotter ID of the device you wish to retrieve information from.</td></tr><tr><td><code>startDate</code></td><td>string</td><td><p>Default: 24 hours ago</p><p></p><p>ISO 8601-formatted timestamp indicating the start date for data inclusion.<br><br>e.g., <code>2021-01-01T07:00:00Z</code></p></td></tr><tr><td><code>endDate</code></td><td>string</td><td><p>Default: <code>now()</code></p><p></p><p>ISO 8601-formatted timestamp indicating the end date for data inclusion.<br><br>e.g.,  <code>2021-01-02T07:00:00Z</code></p></td></tr><tr><td><code>includeSoundPressureReadings</code></td><td>boolean</td><td><p>Default: <code>false</code><br></p><p>Set <code>true</code> to return sound pressure level (SPL) readings (i.e., 1-second resolution raw data) from Spotters with hydrophones transmitting via cellular*.<br><br>*Spotters with hydrophones transmitting via satellite will only return aggregated SPL samples.</p></td></tr></tbody></table>

## Response Description

The response body consists of a flat (uncategorized) data stream of transmissions by the Spotter’s Smart Mooring sensors during the specified time window, ordered by timestamp. These timestamps, while ordered, are not necessarily unique. It is possible for two or more sensors to send different values at the same time, resulting in identical timestamps.

If the Spotter is configured to send multiple samples in a single transmission (e.g., to save on data telemetry costs), multiple samples in the response will have the same location data. To review a Spotter's (read-only) subsurface data transmission settings, 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 Subsurface data transmission section.

{% hint style="info" %}
For more information about [Smart Mooring](https://www.notion.so/Smart-Mooring-Product-Documentation-Onboarding-557d26176ca6422fab42c879b2093d92?source=copy_link) sensors and data, please refer to the [Sensors & Payloads guide](https://sofarocean.notion.site/Sensors-Payloads-a26e005cc5374a7eb6a1e64a3b54b7de?pvs=74).
{% endhint %}

| Name                     | Type                     | Description                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `latitude`               | number                   | The Spotter's latitude when the report was encoded and transmitted.                                                                                                                                                                                                                                                                                                                                                       |
| `longitude`              | number                   | The Spotter's longitude when the report was encoded and transmitted.                                                                                                                                                                                                                                                                                                                                                      |
| `timestamp`              | string                   | ISO 8601-formatted timestamp indicating the end of a sample collection period.                                                                                                                                                                                                                                                                                                                                            |
| `sensorPosition`         | integer                  | The sensor's physical position in the Smart Mooring relative to the Spotter, with `1` being closest to the Spotter.                                                                                                                                                                                                                                                                                                       |
| `units`                  | string                   | <p>The units of measurement.<br><br>e.g., <code>°C</code></p>                                                                                                                                                                                                                                                                                                                                                             |
| `value`                  | object, string or number | The measured value.                                                                                                                                                                                                                                                                                                                                                                                                       |
| `unit_type`              | string                   | <p>A contextual description of what is being measured.<br><br>e.g., <code>temperature</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\_temperature\_12bits</code></p>                                                                                                                                                                                                                                                                                       |
| `configuration_checksum` | string                   | <p>A unique identifier for the Smart Mooring configuration. Can be cross-referenced with the configurations returned by the <a href="https://docs.sofarocean.com/~/revisions/i4w2YzZYZxcM4UMsnSvX/spotter-and-smart-mooring/smart-mooring/sensor-configuration-history">Configuration History endpoint</a> to determine the sensor configuration at the time of data collection.<br><br>e.g., <code>0xb6929687</code></p> |

## Examples

### Example Request

```bash
curl "https://api.sofarocean.com/api/sensor-data?spotterId=SPOT-0222&startDate=2021-12-01T00:00:00Z&endDate=2021-12-02T00:00:00Z" -H 'token: YOUR_API_TOKEN'
```

### Example Responses

{% tabs %}
{% tab title="200" %}
**Sensor data:**

{% code expandable="true" %}

```json
{
    "status": "success",
    "spotterId": "SPOT-31082C",
    "data": [
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:14:01.000Z",
            "sensorPosition": 1,
            "units": "hex",
            "value": "84011a69b1f40f821901c8186ca2051901c811186c",
            "unit_type": "binary",
            "data_type_name": "binary_hex_encoded",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:14:01.000Z",
            "sensorPosition": 1,
            "units": "unitless",
            "value": 0,
            "unit_type": "spectral_entropy",
            "data_type_name": "bm_borealis_entropy_8bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:14:01.000Z",
            "sensorPosition": 1,
            "units": "dB re µPa²",
            "value": 0.75,
            "unit_type": "interquartile_range",
            "data_type_name": "bm_borealis_max_iqr_8bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:14:01.000Z",
            "sensorPosition": 1,
            "units": "unitless",
            "value": 16,
            "unit_type": "index",
            "data_type_name": "bm_borealis_max_iqr_band_number_6bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:14:01.000Z",
            "sensorPosition": 1,
            "units": "dB re µPa²",
            "value": {
                "mean": [94.892,94.142,93.392,...],
                "frequency": [40,50,63,...],
                "band_number": [16,17,18,...],
                "25th_percentile": [93.392,92.642,91.892,...],
                "50th_percentile": [94.142,93.392,91.892,...],
                "75th_percentile": [94.892,94.142,92.642,...]
            },
            "unit_type": "borealis_sound_pressure_level_stats",
            "data_type_name": "bm_borealis_spl_band_stats",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:14:01.000Z",
            "sensorPosition": 1,
            "units": "dB re µPa²",
            "value": 102.392,
            "unit_type": "sound_pressure_level",
            "data_type_name": "bm_borealis_spl_broadband_8bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:44:01.000Z",
            "sensorPosition": 1,
            "units": "hex",
            "value": "84011a69b1fb16821901c8186ca4051901c811186912031603",
            "unit_type": "binary",
            "data_type_name": "binary_hex_encoded",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:44:01.000Z",
            "sensorPosition": 1,
            "units": "unitless",
            "value": 0,
            "unit_type": "spectral_entropy",
            "data_type_name": "bm_borealis_entropy_8bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:44:01.000Z",
            "sensorPosition": 1,
            "units": "dB re µPa²",
            "value": 0.75,
            "unit_type": "interquartile_range",
            "data_type_name": "bm_borealis_max_iqr_8bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:44:01.000Z",
            "sensorPosition": 1,
            "units": "unitless",
            "value": 17,
            "unit_type": "index",
            "data_type_name": "bm_borealis_max_iqr_band_number_6bits",
            "configuration_checksum": "0x03696310"
        },
        {
            "latitude": 37.78845,
            "longitude": -122.38695,
            "timestamp": "2026-03-11T23:44:01.000Z",
            "sensorPosition": 1,
            "units": "dB re µPa²",
            "value": 101.642,
            "unit_type": "sound_pressure_level",
            "data_type_name": "bm_borealis_spl_broadband_8bits",
            "configuration_checksum": "0x03696310"
        }
    ]
}
```

{% endcode %}

**No sensor data:**

```json
{
    "status": "success",
    "spotterId": "SPOT-30973C",
    "data": []
}
```

{% 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 %}
