> ## 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 Device Trips

> Get trips and stops for a single device within a date range.

Returns computed trips and stops for a single 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="from" type="string" required>
  ISO 8601 date string (start of time range).
</ParamField>

<ParamField query="to" type="string" required>
  ISO 8601 date string (end of time range). Max range: 31 days.
</ParamField>

<ParamField query="speedThreshold" type="number" default="3">
  km/h — below this speed is considered stopped.
</ParamField>

<ParamField query="minimalTripDuration" type="number" default="300">
  Seconds — minimum moving time to count as a trip.
</ParamField>

<ParamField query="minimalTripDistance" type="number" default="500">
  Meters — minimum distance to count as a trip.
</ParamField>

<ParamField query="minimalParkingDuration" type="number" default="180">
  Seconds — minimum stopped time to end a trip.
</ParamField>

<ParamField query="minimalNoDataDuration" type="number" default="1800">
  Seconds — data gaps longer than this are treated as stops.
</ParamField>

<ParamField query="minimalAvgSpeed" type="number" default="1">
  km/h — minimum average speed to count as a trip.
</ParamField>

<ParamField query="maxAcceleration" type="number" default="10">
  m/s² — filter GPS spikes exceeding this value.
</ParamField>

## Response

Same shape as [Get Trips](/api-reference/user/get-trips) (without `devicesQueried` in summary).

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

<ResponseExample>
  ```json theme={null}
  {
    "trips": [
      {
        "hardware_id": "ABC123",
        "startTime": "2025-12-17T08:00:00.000Z",
        "endTime": "2025-12-17T08:45:00.000Z",
        "startLocation": { "lat": 37.7749, "long": -122.4194 },
        "endLocation": { "lat": 37.7899, "long": -122.401 },
        "distance": 5234,
        "duration": 2700,
        "maxSpeed": 45.2,
        "avgSpeed": 6.9,
        "pointCount": 54
      }
    ],
    "stops": [
      {
        "startTime": "2025-12-17T08:45:00.000Z",
        "endTime": "2025-12-17T09:30:00.000Z",
        "location": { "lat": 37.7899, "long": -122.401 },
        "duration": 2700
      }
    ],
    "summary": {
      "totalTrips": 1,
      "totalStops": 1,
      "totalDistance": 5234,
      "totalDuration": 2700,
      "totalStopDuration": 2700,
      "positionsAnalyzed": 120,
      "configUsed": {
        "speedThreshold": 3,
        "minimalTripDuration": 300,
        "minimalTripDistance": 500,
        "minimalParkingDuration": 180,
        "minimalNoDataDuration": 1800,
        "minimalAvgSpeed": 1,
        "maxAcceleration": 10
      }
    }
  }
  ```
</ResponseExample>
