Skip to main content

Traccar

Traccar is an open source GPS tracking platform. Colota supports two Traccar protocols:

  • OsmAnd (GET) - sends location as HTTP GET query parameters. Works with all Traccar versions.
  • Traccar JSON (POST) - sends a structured JSON body. Requires Traccar 6.7.0+.

Prerequisites

  1. Install Traccar - follow the Traccar documentation
  2. Enable the OsmAnd protocol in Traccar - both GET and POST use port 5055 via the OsmAnd listener. In your traccar.xml config, ensure the OsmAnd port is active (it is by default on standard installs)
  3. Create a device in the Traccar web interface - the Identifier you enter must match what Colota sends (see below)

Setup in Colota

  1. Go to Settings > API Settings
  2. Select the Traccar template
  3. Choose your HTTP method:
    • GET - OsmAnd protocol, compatible with all Traccar versions
    • POST - Traccar JSON format, requires Traccar 6.7.0+
  4. Set your endpoint:
    http://traccar.yourdomain.com:5055

Device Identifier

Traccar identifies devices by a unique identifier. Add a custom field with key id and set it to your Traccar device identifier - this is used for both GET and POST.

MethodField sent to TraccarSource
GETid query parametercustom field id
POSTdevice_id in JSON bodycustom field id (or device_id if set, otherwise colota)

The current value is visible in the example payload on the API Settings screen.

In Traccar, open Settings > Devices, create a new device, and set the Identifier to the same value Colota is sending.

Request Format

GET (OsmAnd)

GET http://traccar.yourdomain.com:5055/?id=my-phone&lat=52.12345&lon=-2.12345&accuracy=15&altitude=380&speed=5&batt=85&charge=2&timestamp=1739362800&bearing=180.0

POST (Traccar JSON)

{
"location": {
"timestamp": "2025-02-12T13:00:00Z",
"coords": {
"latitude": 52.12345,
"longitude": -2.12345,
"accuracy": 15,
"altitude": 380,
"speed": 5,
"heading": 180
},
"battery": {
"level": 0.85,
"is_charging": false
}
},
"device_id": "colota"
}

Field Mapping

GET

Traccar parameterDescription
idDevice identifier
latLatitude
lonLongitude
accuracyGPS accuracy (meters)
altitudeAltitude (meters)
speedSpeed (m/s)
battBattery level (0-100)
chargeCharging status
timestampUnix timestamp
bearingBearing (degrees)

POST

JSON fieldDescription
device_idDevice identifier
location.timestampISO 8601 UTC timestamp
location.coords.latitudeLatitude
location.coords.longitudeLongitude
location.coords.accuracyGPS accuracy (meters)
location.coords.altitudeAltitude (meters)
location.coords.speedSpeed (m/s)
location.coords.headingBearing (degrees)
location.battery.levelBattery level (0-1)
location.battery.is_chargingCharging state