Prey icon

Prey

Manage devices and account data in Prey

Device → Get Device Location History

AI-generated

Summary

Retrieve the location history of a specified device in either JSON (structured data) or CSV (binary file) format.

Inputs

  • API Key Permission — Select 'Read-Only' or 'Read & Write' to match the API key permission level; 'Read-Only' is default to enable fetching location history.
  • Device (required) — Choose the device by selecting from a searchable list or specifying the device ID directly.
  • Location History Format — Select the format of the location history data: JSON provides structured location data under the 'latest_locations' property; CSV provides a binary CSV file.
  • Request Options — Optional settings including batching, ignoring SSL issues, proxy configuration, and request timeout in milliseconds.

Output shape

Either structured JSON object or binary file depending on selected location format.

Outputs JSON containing a 'latest_locations' array if 'JSON' is selected. If 'CSV' is selected, outputs a binary CSV file under the 'data' property. The request uses a GET method to the endpoint /devices/{deviceId}/location_activity, with an optional .csv suffix for CSV output.

Examples

Example 1: Get device location history in JSON

Provide a device, select JSON as the location history format, and the node returns structured location data under 'latest_locations' property.

Example 2: Get device location history as CSV

Provide a device, select CSV as the location history format, and the node returns a binary CSV file containing location history, accessible in 'data' binary property.

Links

Discussion