Get Location and Speed
Retrieve current location and speed data for one or more vehicles from Samsara.
Operation
Section titled “Operation”getLocationAndSpeed
Resource
Section titled “Resource”location
Parameters
Section titled “Parameters”This operation has no required parameters.
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
| Vehicle IDs | string | - | Comma-separated list of vehicle IDs to filter by. Leave empty to get all vehicles. |
| Tag IDs | string | - | Comma-separated list of tag IDs to filter vehicles by |
Response
Section titled “Response”Success
Section titled “Success”Returns an array of location records:
{ "id": "281474976710655", "name": "Truck 001", "location": { "latitude": 32.7767, "longitude": -96.7970, "heading": 180, "speed": 55.5, "time": "2024-01-15T14:30:00Z" }, "reverseGeo": { "formattedLocation": "123 Main St, Dallas, TX 75201" }}{ "success": false, "error": "API rate limit exceeded"}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
| id | string | Vehicle ID |
| name | string | Vehicle name |
| location.latitude | number | GPS latitude |
| location.longitude | number | GPS longitude |
| location.heading | number | Direction in degrees |
| location.speed | number | Current speed in mph |
| location.time | string | Timestamp of the reading |
| reverseGeo.formattedLocation | string | Human-readable address |
Error Handling
Section titled “Error Handling”- Missing API Token: Samsara credential is missing apiToken
- Invalid Vehicle ID: One or more vehicle IDs not found
- Rate Limiting: API rate limit exceeded