> This page is for Firmware, version 4.0 (default).
> For other versions, use one of these documentation indexes:
> - 4.0 (default): https://docs.ouster.com/sensor-docs/firmware/4.0/llms.txt
> - 3.2: https://docs.ouster.com/sensor-docs/firmware/3.2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ouster.com/sensor-docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ouster.com/sensor-docs/_mcp/server.

# Get the time information

GET http://os-992244000006.local/api/v1/time/sensor

Get the sensor time information

Reference: https://docs.ouster.com/sensor-docs/firmware/api-reference/ouster-http-api/time/get-time-sensor

## Response

### 200

Sensor time information

- `multipurpose_io` (TimeSensorMultipurposeIo, optional)
- `sync_pulse_in` (TimeSensorSyncPulseIn, optional)
- `timestamp` (TimeSensorTimestamp, optional)

## Types

### TimeSensorMultipurposeIo

- `mode` (string, optional)
- `sync_pulse_out` (TimeSensorMultipurposeIoSyncPulseOut, optional)
- `nmea` (TimeSensorMultipurposeIoNmea, optional)

### TimeSensorSyncPulseIn

- `diagnostics` (TimeSensorSyncPulseInDiagnostics, optional)
- `locked` (double, optional)
- `polarity` (enum, optional) — Signal polarity type
  - Allowed values: `ACTIVE_HIGH`, `ACTIVE_LOW`

### TimeSensorTimestamp

- `mode` (enum, optional, default: TIME_FROM_INTERNAL_OSC) — Timestamp mode for sensor time synchronization
  - Allowed values: `TIME_FROM_INTERNAL_OSC`, `TIME_FROM_SYNC_PULSE_IN`, `TIME_FROM_PTP_1588`
- `time` (float, optional)
- `time_options` (TimeSensorTimestampTimeOptions, optional)

### TimeSensorMultipurposeIoSyncPulseOut

- `polarity` (enum, optional) — Signal polarity type
  - Allowed values: `ACTIVE_HIGH`, `ACTIVE_LOW`
- `frequency_hz` (double, optional)
- `angle_deg` (double, optional)
- `pulse_width_ms` (double, optional)

### TimeSensorMultipurposeIoNmea

- `baud_rate` (enum, optional, default: BAUD_9600)
  - Allowed values: `BAUD_9600`, `BAUD_115200`
- `diagnostics` (TimeSensorMultipurposeIoNmeaDiagnostics, optional)
- `ignore_valid_char` (double, optional)
- `leap_seconds` (double, optional)
- `locked` (double, optional)
- `polarity` (enum, optional) — Signal polarity type
  - Allowed values: `ACTIVE_HIGH`, `ACTIVE_LOW`

### TimeSensorSyncPulseInDiagnostics

- `count` (double, optional)
- `count_unfiltered` (double, optional)
- `last_period_nsec` (double, optional)

### TimeSensorTimestampTimeOptions

- `internal_osc` (double, optional)
- `ptp_1588` (double, optional)
- `sync_pulse_in` (double, optional)

### TimeSensorMultipurposeIoNmeaDiagnostics

- `decoding` (TimeSensorMultipurposeIoNmeaDiagnosticsDecoding, optional)
- `io_checks` (TimeSensorMultipurposeIoNmeaDiagnosticsIoChecks, optional)

### TimeSensorMultipurposeIoNmeaDiagnosticsDecoding

- `date_decoded_count` (double, optional)
- `last_read_message` (string, optional)
- `not_valid_count` (double, optional)
- `utc_decoded_count` (double, optional)

### TimeSensorMultipurposeIoNmeaDiagnosticsIoChecks

- `bit_count` (double, optional)
- `bit_count_filtered` (double, optional)
- `char_count` (double, optional)
- `start_char_count` (double, optional)

## Examples

**Response**

```json
{
  "multipurpose_io": {
    "mode": "SYNC",
    "sync_pulse_out": {
      "polarity": "ACTIVE_HIGH",
      "frequency_hz": 10,
      "angle_deg": 90,
      "pulse_width_ms": 5
    },
    "nmea": {
      "baud_rate": "BAUD_115200",
      "diagnostics": {
        "decoding": {
          "date_decoded_count": 1500,
          "last_read_message": "$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A",
          "not_valid_count": 3,
          "utc_decoded_count": 1497
        },
        "io_checks": {
          "bit_count": 120000,
          "bit_count_filtered": 119500,
          "char_count": 15000,
          "start_char_count": 15000
        }
      },
      "ignore_valid_char": 0,
      "leap_seconds": 18,
      "locked": 1,
      "polarity": "ACTIVE_HIGH"
    }
  },
  "sync_pulse_in": {
    "diagnostics": {
      "count": 5000,
      "count_unfiltered": 5050,
      "last_period_nsec": 100000000
    },
    "locked": 1,
    "polarity": "ACTIVE_HIGH"
  },
  "timestamp": {
    "mode": "TIME_FROM_INTERNAL_OSC",
    "time": 1672531199.123,
    "time_options": {
      "internal_osc": 0.9999,
      "ptp_1588": 0.0001,
      "sync_pulse_in": 0.00005
    }
  }
}
```

**SDK Code**

```python
import requests

url = "http://os-992244000006.local/api/v1/time/sensor"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://os-992244000006.local/api/v1/time/sensor';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://os-992244000006.local/api/v1/time/sensor"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://os-992244000006.local/api/v1/time/sensor")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://os-992244000006.local/api/v1/time/sensor")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://os-992244000006.local/api/v1/time/sensor');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://os-992244000006.local/api/v1/time/sensor");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://os-992244000006.local/api/v1/time/sensor")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```