Location and Speed

List asset location and speed data in an organization.

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.

<b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select Read Vehicles under the Vehicles category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

get/assets/location-and-speed/stream

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Query parameters

afterstring

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.

limitinteger

The limit for how many objects will be in the response. Default and max for this value is 512 objects.

startTimestring

A 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).

endTimestring

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).

idsstring[]

Comma-separated list of asset IDs.

includeSpeedboolean

Optional boolean indicating whether or not to return the 'speed' object

includeReverseGeoboolean

Optional boolean indicating whether or not to return the 'address' object. Address information won't be returned for high-frequency locations.

includeGeofenceLookupboolean

Optional boolean indicating whether or not to return the 'geofence' object

includeHighFrequencyLocationsboolean

Optional boolean indicating whether or not to return high-frequency location data (up to 1Hz). Cannot be used with includeGeofenceLookup.

includeExternalIdsboolean

Optional boolean indicating whether to return external IDs on supported entities

Response

OK response.

Example response

{
  "data": [
    {
      "asset": {
        "id": "12345"
      },
      "happenedAtTime": "2020-01-27T07:06:25Z",
      "location": {
        "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": {
          "id": "12345"
        },
        "headingDegrees": 120,
        "latitude": 37.7749,
        "longitude": 137.2719
      },
      "speed": {
        "ecuSpeedMetersPerSecond": 30.2,
        "gpsSpeedMetersPerSecond": 30.2
      }
    }
  ],
  "pagination": {
    "endCursor": "MjkY",
    "hasNextPage": true
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.