API Consumers who require high rates of requests against our APIs should contact Tuxy Fluffyclaws, Kat_pw, Krashnz and J-M with a rationale and contact email for high-rate usage.
For documentation on v1 of the API click here.

Lookup player information

https://api.truckersmp.com/v2/player/{id}

Parameters:

Name Type Description
id integer Steam ID or TruckersMP ID

Properties:

Name Type Description
error boolean If any error occurred during the request.
id integer The ID of the user requested.
name string The name of the user.
avatar string URL to image for the avatar used on the website.
joinDate datetime The date and time the user registered in UTC.
steamID64 integer The 64bit Steam ID of the user.
groupName string The name of the group the user belongs to.
groupID integer The ID of the group the user belongs to.
isGameAdmin boolean If the user is an admin in-game or not.
showDetailedOnWebMaps boolean Always false.

Example request:

https://api.truckersmp.com/v2/player/76561198057763917

Example response:

{
    "error": false,
    "response": {
        "id": 1,
        "name": "RootKiller",
        "avatar": "https:\/\/static.truckersmp.com\/avatars\/defaultavatar.png",
        "joinDate": "2014-07-24 17:57:28",
        "steamID64": 76561198057763917,
        "groupName": "Retired team member",
        "groupID": 9,
        "permissions": {
            "isGameAdmin": false,
            "showDetailedOnWebMaps": false
        }
    }
}

Latest 5 bans for a selected user

https://api.truckersmp.com/v2/bans/{id}

Parameters:

Name Type Description
id integer Steam ID or TruckersMP ID

Properties:

Name Type Description
error boolean If any error occurred during the request.
expiration datetime or null The time the ban will expire.
timeAdded datetime The time the ban was issued.
active boolean If the ban is still active.[1]
reason string The reason for the ban.
adminName string Name of the admin that banned the user.
adminID integer TruckersMP ID for the admin that banned the user.

[1] For the user to be banned the expiration date has to be passed or active has to be false.

Example request:

https://api.truckersmp.com/v2/bans/8

Example response:

{
    "error": false,
    "response": [
        {
            "expiration": "2014-12-05 18:58:12",
            "timeAdded": "2014-12-05 18:57:12",
            "active": true,
            "reason": "test",
            "adminName": "RootKiller",
            "adminID": 1
        },
        {
            "expiration": "2014-12-05 18:50:48",
            "timeAdded": "2014-12-05 18:49:48",
            "active": true,
            "reason": "test",
            "adminName": "RootKiller",
            "adminID": 1
        },
        {
            "expiration": null,
            "timeAdded": "2014-09-27 19:22:27",
            "active": false,
            "reason": "test permban",
            "adminName": "mwl4",
            "adminID": 2
        },
        {
            "expiration": "2014-09-27 19:23:00",
            "timeAdded": "2014-09-27 19:18:00",
            "active": false,
            "reason": "tescik",
            "adminName": "mwl4",
            "adminID": 2
        }
    ]
}

List of available TruckersMP servers and their status

https://api.truckersmp.com/v2/servers

Properties:

Name Type Description
error boolean If any error occurred during the request.
id integer The ID given to the server.
game string (ETS2 or ATS) What game the server is for.
ip string The server ip address.
port integer The port that the server runs on.
name string Name of the server.
shortname string Shortname for the server.
online boolean If the server is online or not.
players integer How many players are currently on the server.
queue integer Amount of players waiting in the queue to join the server.
maxplayers integer The max amount of players allowed on the server at once.
speedlimiter integer If the speed limiter is enabled on the server (110kmh for ETS2 and 67mph for ATS).
collisions boolean If server wide collisions is enabled.
carsforplayers boolean If cars are enabled for players.
policecarsforplayers boolean If police cars can be driven by players.
afkenabled boolean If AFK kick is enabled for players.
syncdelay boolean Server tick rate.

Example request:

https://api.truckersmp.com/v2/servers

Example response:

{
    "error": "false",
    "response": [
        {
            "id": 3,
            "game": "ETS2",
            "ip": "191.101.3.39",
            "port": 42860,
            "name": "United States",
            "shortname": "US 1",
            "online": true,
            "players": 20,
            "queue": 0,
            "maxplayers": 512,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 100
        },
        {
            "id": 4,
            "game": "ETS2",
            "ip": "37.187.170.151",
            "port": 42880,
            "name": "Europe 2",
            "shortname": "EU #2",
            "online": true,
            "players": 2055,
            "queue": 0,
            "maxplayers": 2300,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 100
        },
        {
            "id": 10,
            "game": "ATS",
            "ip": "167.114.245.202",
            "port": 42850,
            "name": "Europe 2",
            "shortname": "EU 2",
            "online": true,
            "players": 0,
            "queue": 0,
            "maxplayers": 2000,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 100
        },
        {
            "id": 11,
            "game": "ATS",
            "ip": "191.101.3.39",
            "port": 42850,
            "name": "United States",
            "shortname": "US 1",
            "online": true,
            "players": 3,
            "queue": 0,
            "maxplayers": 2000,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 100
        },
    ]
}

The current in-game time.
Game time is expressed in minutes, where 10 real seconds is 1 minute of in-game time. It is number of minutes since 2015-25-10 15:48:32 CET.
Note: Game time may not be exact as time will drift.

https://api.truckersmp.com/v2/game_time

Properties:

Name Type Description
error boolean If any error occurred during the request.
game_time integer Game time returned in minutes (10 real seconds is 1 minute in-game).

Example request:

https://api.truckersmp.com/v2/game_time

Example response:

{
    "error": false,
    "game_time": 4618084
}

Information about the current TruckersMP version for ETS2 and ATS

https://api.truckersmp.com/v2/version

Properties:

Name Type Description
name string Name of the current version.
numeric string Numeric name of the current version.
stage string Current stage in the development process.
dll string Checksum of core.dll
adb string Checksum of data1.adb
time datetime The time that the version was released.
supported_game_version integer ETS2 version that is supported.
supported_ats_game_version integer ATS version that is supported.

Example request:

https://api.truckersmp.com/v2/version

Example response:

{
    "name": "0.2.1.6.4",
    "numeric": 21064,
    "stage": "Alpha",
    "ets2mp_checksum":
    {
        "dll": "321d5ef7f45a2f7f5d519ad69b573cf8",
        "adb": "8873c6a76ceefd824230308256d0676c"
    },
    "atsmp_checksum":
    {
        "dll": "98ee5696dd87d2e785019578011d9249",
        "adb": "942da29cebe153621056123ef229e738"
    },
    "time": "2017-03-28 16:00:00",
    "supported_game_version": "1.27.1.1s",
    "supported_ats_game_version": "1.6.1.3s"
}

Current in-game rules.

https://api.truckersmp.com/v2/rules

Properties:

Name Type Description
error boolean If any error occurred during the request.
rules string Markdown of the current in-game rules.
revision integer Version number.

Example request:

https://api.truckersmp.com/v2/rules