Devices and tracking

Positions

Retrieving raw location information

Fetch a list of Positions

GET
https://demo.traccar.org/api/positions

We strongly recommend using Traccar WebSocket API instead of periodically polling positions endpoint. Without any params, it returns a list of last known positions for all the user's Devices. from and to fields are not required with id.

Parameters

deviceIdintegerquery

deviceId is optional, but requires the from and to parameters when used

fromstring<date-time>query

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

tostring<date-time>query

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

idintegerquery

To fetch one or more positions. Multiple params can be passed like id=31&id=42

Response

OK

Response fields application/json, text/csv, application/gpx+xml
Show child attributes
idinteger<int64>

Unique position record identifier

deviceIdinteger<int64>

Identifier of the device that reported this position

protocolstring

Device protocol name that produced the message

deviceTimestring<date-time>

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

fixTimestring<date-time>

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

serverTimestring<date-time>

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

validboolean

Indicates whether the position was marked as valid by the device

latitudenumber

Latitude in decimal degrees

longitudenumber

Longitude in decimal degrees

altitudenumber

Altitude above sea level in meters

speednumber

in knots

coursenumber

Heading in degrees (0-360) where 0 is true north

addressstring

Resolved reverse-geocoded address if available

accuracynumber

Estimated positional accuracy in meters when provided

networkobject

Network metadata (e.g. cell or Wi‑Fi data) supplied by the device

geofenceIdsArray<integer>

List of geofence ids applicable to this position

attributesobject

Custom key-value attributes sent by the device or enrichments

401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Deletes all the Positions of a device in the time span specified

DELETE
https://demo.traccar.org/api/positions

Parameters

deviceIdintegerrequiredquery
fromstring<date-time>requiredquery

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

tostring<date-time>requiredquery

in ISO 8601 format. eg. 1963-11-22T18:30:00Z

Response

204No Content

No Content

400Bad Request

Bad request

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Delete a Position

DELETE
https://demo.traccar.org/api/positions/{id}

Parameters

idintegerrequiredpath

Response

204No Content

No Content

404Not Found

Not found

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Export Positions as KML

GET
https://demo.traccar.org/api/positions/kml

Parameters

deviceIdintegerrequiredquery
fromstring<date-time>requiredquery
tostring<date-time>requiredquery

Response

200OKstring<binary>

OK

Response fields application/vnd.google-earth.kml+xml
string<binary>
401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Export Positions as CSV

GET
https://demo.traccar.org/api/positions/csv

Parameters

deviceIdintegerrequiredquery
geofenceIdintegerquery
fromstring<date-time>requiredquery
tostring<date-time>requiredquery

Response

200OKstring<binary>

OK

Response fields text/csv
string<binary>
401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)

Export Positions as GPX

GET
https://demo.traccar.org/api/positions/gpx

Parameters

deviceIdintegerrequiredquery
fromstring<date-time>requiredquery
tostring<date-time>requiredquery

Response

200OKstring<binary>

OK

Response fields application/gpx+xml
string<binary>
401Unauthorized

Unauthorized

Authorization

BasicAuthhttp (basic)
ApiKeyhttp (bearer)