Traccar API

Starting from version 3.0 Traccar server includes web API to access GPS tracking data from your own applications. Version 3.3 and all later versions are using REST API. Documentation for the API can be found in the swagger.json file and API Reference. There are a lot of tools available to automatically generate client from Swagger format. For more information about Swagger see official website - http://swagger.io/.

There are two authorization options:

View API documentation:

Access token

As an alternative to email and password login, there is an option to use account token for authorization. Token can be set in the corresponding field of the user model. Token can only be used to create a session. It can not be used for basic authorization option.

To create a token use "token" query parameter in session get request:

/api/session?token=USER_TOKEN

WebSocket API

In addition to Traccar REST API, we provide access to a WebSocket endpoint for live location updates and events. URL for the connection:

/api/socket

Session cookie is the only authorization option for WebSocket connection.

Each message in WebSocket communication uses same universal JSON format:

{
  "devices": [...],
  "positions: [...],
  "events": [...]
}

Each array contains corresponding standard models:

If message does not contain objects of one of the types, the key would not be included in the JSON structure. Most of the time messages contain a single type of objects.