Skip to main content
GET
/
trips
/
{id}
/
active
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://your-api-host/trips/ABC123/active?maxAgeSeconds=180"
{
  "hardware_id": "ABC123",
  "active": true,
  "activeTrip": {
    "hardware_id": "ABC123",
    "speed": 19.6,
    "last_position_at": "2025-12-17T10:30:00.000Z",
    "last_position_age_seconds": 24,
    "location": { "lat": 37.7749, "long": -122.4194 },
    "trip": {
      "startTime": "2025-12-17T09:50:00.000Z",
      "endTime": "2025-12-17T10:30:00.000Z",
      "startLocation": { "lat": 37.7601, "long": -122.4312 },
      "endLocation": { "lat": 37.7749, "long": -122.4194 },
      "distance": 5234,
      "duration": 2400,
      "maxSpeed": 45.2,
      "avgSpeed": 7.8,
      "pointCount": 54
    }
  },
  "summary": {
    "configUsed": {
      "speedThreshold": 3,
      "minimalTripDuration": 300,
      "minimalTripDistance": 500,
      "minimalParkingDuration": 180,
      "minimalNoDataDuration": 1800,
      "minimalAvgSpeed": 1,
      "maxAcceleration": 10
    },
    "maxAgeSeconds": 180,
    "lookbackSeconds": 14400
  }
}
Returns active trip status for a single device based on its latest GPS sample. The id path parameter accepts either short_id or hardware_id.

Path parameters

id
string
required
Device identifier — either short_id or hardware_id.

Query parameters

maxAgeSeconds
number
default:"300"
Maximum age of latest GPS sample in seconds.
lookbackSeconds
number
default:"14400"
How far back to load GPS history for trip detection.
speedThreshold
number
default:"3"
km/h — below this speed is considered stopped.
minimalTripDuration
number
default:"300"
Seconds — minimum moving time to count as a trip.
minimalTripDistance
number
default:"500"
Meters — minimum distance to count as a trip.
minimalParkingDuration
number
default:"180"
Seconds — minimum stopped time to end a trip.
minimalNoDataDuration
number
default:"1800"
Seconds — data gaps longer than this are treated as stops.
minimalAvgSpeed
number
default:"1"
km/h — minimum average speed to count as a trip.
maxAcceleration
number
default:"10"
m/s² — filter GPS spikes exceeding this value.

Response

hardware_id
string
required
Device hardware ID.
active
boolean
required
Whether the device is currently in motion.
activeTrip
object
Present when active is true. Contains hardware_id, speed, last_position_at, last_position_age_seconds, location, and trip data.
summary
object
required
Configuration and parameters used for detection.
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://your-api-host/trips/ABC123/active?maxAgeSeconds=180"
{
  "hardware_id": "ABC123",
  "active": true,
  "activeTrip": {
    "hardware_id": "ABC123",
    "speed": 19.6,
    "last_position_at": "2025-12-17T10:30:00.000Z",
    "last_position_age_seconds": 24,
    "location": { "lat": 37.7749, "long": -122.4194 },
    "trip": {
      "startTime": "2025-12-17T09:50:00.000Z",
      "endTime": "2025-12-17T10:30:00.000Z",
      "startLocation": { "lat": 37.7601, "long": -122.4312 },
      "endLocation": { "lat": 37.7749, "long": -122.4194 },
      "distance": 5234,
      "duration": 2400,
      "maxSpeed": 45.2,
      "avgSpeed": 7.8,
      "pointCount": 54
    }
  },
  "summary": {
    "configUsed": {
      "speedThreshold": 3,
      "minimalTripDuration": 300,
      "minimalTripDistance": 500,
      "minimalParkingDuration": 180,
      "minimalNoDataDuration": 1800,
      "minimalAvgSpeed": 1,
      "maxAcceleration": 10
    },
    "maxAgeSeconds": 180,
    "lookbackSeconds": 14400
  }
}