> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iotee.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Get GPS History

> Query GPS telemetry history for a device.

Returns GPS telemetry records for a device. The `id` path parameter accepts either `short_id` or `hardware_id`.

## Path parameters

<ParamField path="id" type="string" required>
  Device identifier — either `short_id` or `hardware_id`.
</ParamField>

## Query parameters

<ParamField query="limit" type="number" default="100">
  Max records to return. Ignored when `from`/`to` are provided.
</ParamField>

<ParamField query="from" type="string">
  ISO 8601 date string (start of range). Required together with `to`.
</ParamField>

<ParamField query="to" type="string">
  ISO 8601 date string (end of range). Required together with `from`.
</ParamField>

## Response

Returns an array of GPS telemetry records.

<ResponseField name="[]" type="object[]">
  <Expandable title="GPS record">
    <ResponseField name="_id" type="string" required>Record identifier.</ResponseField>
    <ResponseField name="hardware_id" type="string" required>Hardware identifier.</ResponseField>
    <ResponseField name="timestamp" type="string" required>ISO 8601 timestamp.</ResponseField>
    <ResponseField name="lat" type="number" required>Latitude.</ResponseField>
    <ResponseField name="long" type="number" required>Longitude.</ResponseField>
    <ResponseField name="speed" type="number">Speed in km/h.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Latest 50 records theme={null}
  curl -H "X-API-Key: YOUR_API_KEY" \
    "https://your-api-host/devices/ABC123/gps?limit=50"
  ```

  ```bash Date range query theme={null}
  curl -H "X-API-Key: YOUR_API_KEY" \
    "https://your-api-host/devices/ABC123/gps?from=2025-12-01T00:00:00Z&to=2025-12-17T00:00:00Z"
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "_id": "...",
      "hardware_id": "ABC123",
      "timestamp": "2025-12-17T10:30:00.000Z",
      "lat": 37.7749,
      "long": -122.4194,
      "speed": 15.5
    }
  ]
  ```
</ResponseExample>
