This endpoint will return asset locations and speed data that has been collected for your organization based on the time parameters passed in. Results are paginated. If you include an endTime, the endpoint will return data up until that point. If you don’t include an endTime, you can continue to poll the API real-time with the pagination cursor that gets returned on every call. The endpoint will only return data up until the endTime that has been processed by the server at the time of the original request. You will need to request the same [startTime, endTime) range again to receive data for assets processed after the original request time. This endpoint sorts the time-series data by device.
Rate limit: 10 requests/sec (learn more about rate limits here).
To use this endpoint, select Read Vehicles under the Vehicles category when creating or editing an API token. Learn More.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
curl --request GET \
--url https://api.samsara.com/assets/location-and-speed/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"asset": {
"id": "12345",
"externalIds": {}
},
"happenedAtTime": "2020-01-27T07:06:25Z",
"location": {
"headingDegrees": 120,
"latitude": 37.7749,
"longitude": 137.2719,
"accuracyMeters": 5.801,
"address": {
"city": "New York",
"country": "USA",
"neighborhood": "Mission District",
"pointOfInterest": "The Eiffel Tower",
"postalCode": "10010",
"state": "New York",
"street": "Main Street",
"streetNumber": "16"
},
"geofence": {
"externalIds": {},
"id": "12345"
}
},
"speed": {
"ecuSpeedMetersPerSecond": 30.2,
"gpsSpeedMetersPerSecond": 30.2
}
}
],
"pagination": {
"hasNextPage": true,
"endCursor": "MjkY"
}
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
The limit for how many objects will be in the response. Default and max for this value is 512 objects.
1 <= x <= 512A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
An end time in RFC 3339 format. Defaults to never if not provided; if not provided then pagination will not cease, and a valid pagination cursor will always be returned. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
Comma-separated list of asset IDs.
Optional boolean indicating whether or not to return the 'speed' object
Optional boolean indicating whether or not to return the 'address' object. Address information won't be returned for high-frequency locations.
Optional boolean indicating whether or not to return the 'geofence' object
Optional boolean indicating whether or not to return high-frequency location data (up to 1Hz). Cannot be used with includeGeofenceLookup.
Optional boolean indicating whether to return external IDs on supported entities
curl --request GET \
--url https://api.samsara.com/assets/location-and-speed/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"asset": {
"id": "12345",
"externalIds": {}
},
"happenedAtTime": "2020-01-27T07:06:25Z",
"location": {
"headingDegrees": 120,
"latitude": 37.7749,
"longitude": 137.2719,
"accuracyMeters": 5.801,
"address": {
"city": "New York",
"country": "USA",
"neighborhood": "Mission District",
"pointOfInterest": "The Eiffel Tower",
"postalCode": "10010",
"state": "New York",
"street": "Main Street",
"streetNumber": "16"
},
"geofence": {
"externalIds": {},
"id": "12345"
}
},
"speed": {
"ecuSpeedMetersPerSecond": 30.2,
"gpsSpeedMetersPerSecond": 30.2
}
}
],
"pagination": {
"hasNextPage": true,
"endCursor": "MjkY"
}
}