SweTrack - GPS tracking

SweTrack is a Service and Company located in Sweden. They deliver several GPS-Tracing devices (Light version to an Extreme version) with a integrated Cloud service. (The Extreme version can be configured to use your own server). The tracking devices can be used for asset tracking (cars, bikes, gods, … ).

SweTrack website: https://swetrack.com/

Currently there is no public API. But the SweTrack Live Tracking website https://swetrack.com/weblive/start.html reveals the simple communication protocol over HTTPS.

A user registration is required to use the service, I do not know if an account can be created without having a SweTrack tracking device.

A simple python API implementation can also be found at my GitHub https://github.com/oeysteinhansen/pyswetrack

+1 for this feature

Very nice to see that you already made a python library! I actually just emailed SweTrack asking about documentation for their API without checking here first. They replied that there is currently no documentation available for the consumer API but if/when they create one they will let me know (will probably never happen).

Are there any downsides with your python library or does it work as expected?

I like the idea of Scandinavians tracking their gods. I’m adding a new HA zone for Asgard - just let me find the coordinates…

:slight_smile:

2 Likes

The downside is that the API is reverse engendered and can change.

Any news regarding this? I see that they offer api now.

I tried to use the integration mentioned in this tread but I can’t seem to get it installed, link in the code is dead but I home there might be a way to get this to work?

I realize this is s pretty inactive thread, but I thought I’d add some info.

I asked their support about two months ago if they had an API for private use, and they replied with a “no”, but that they have one planned. No clue when they will release it though.

However, yesterday I was on their web application, and when inspecting the site, and in the network tab, I noticed that it used an API with an auth token to get all the data it needed.

So I just copied the token and used curl on another computer, and lo and behold, it spat out some info about my device, including the coordinates.
I’m not sure if this token is a temporary one, but it still works after 24h.

I didn’t dive too deep into the API, but if anyone else wants to try it, here’s how I got it (Chrome);

  • Go to SweTrack Web App and sign in.
  • Press Ctrl+Shift+I to open the inspect menu.
  • Go to the Network tab.
  • Press the Clear button (next to the red button at the top left corner).
  • Select your device.
  • Click on a getDevices item in the Name list.
  • Scroll down to the Request Headers.
  • Right click on “authorization” and Copy value.

Now with curl;

curl -XGET -H "Content-type: application/json" -H "authorization: YourAuthToken" "https://cloudappapi.com/api/getDevices"

Example output:

[[{"id":xxxxx,"name":"xxxxx","uniqueid":"xxxxxxxxxxx","description":" ","attributes":"{\"speedLimit\":\"32\"}","category":"Car_Red","lastupdate":"2023-01-23T09:07:34.000Z","battery":50,"latitude":xx.xxxxxxxxxxxxxx,"longitude":xx.xxxxxxxxxxxxxxxx,"speed":2,"positionsattributes":"{\"sat\":x,\"ignition\":false,\"upload_mode\":4,\"realtime_data\":0,\"distance\":x.xx,\"totalDistance\":xxxxxx.xx,\"motion\":true,\"batteryLevel\":20,\"charge\":false,\"GSM_Signal\":100}","PhotoLink":"https://swetrack.com/inapp-image/maxitracker.png","model":"MaxiTracker","externalpowerrange":"not-supported","currentpowersavingmode":"off","newpowersavingmode":null,"currentpowerswich":"not-supported","settingsattributes":null,"status":"online","speedLimit":51,"ignition":false,"charge":false,"externalpowerpercent":"not-supported","externalpowervolt":"not-supported"}],[]]

Hopefully this token will stay the same.
With this, it should be pretty simple to implement.
I’ve already made a simple test with this on my Android with Tasker to open up Google Maps and pin the location of the tracker.

That was some good info :slight_smile: I’ve done a simple NodeRED flow that publishes location and some small stuff from the tracker in my bike to MQTT, we’ll see how well it work.

Would you mind sharing your flow?

Jan 14 2024 update:

They’ve changed some stuff, so in order to get the new token you need to select “compactinfo” instead of “getDevices”, and the URL has changed to “https://api.cloudappapi.com/swetrack/devices/compactinfo”.

2 Likes

Any news regarding Swetrack API?

I’m also looking to get this integrated into Home Assistant. Can’t get the above guide to work.