API Consumers who require high rates of requests against our APIs should contact HumaneWolf, Krashnz, J-M and Kat_pw with a rationale and contact email for high-rate usage.
For documentation on v1 of the API click here.
For access to the Traffic and/or ETS2Map API contact Krashnz on the TruckersMP Forums or Discord (Krashnz#3549).

Lookup player information

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

Parameters:

Name Type Description
id integer SteamID64 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 the avatar used on the website
joinDate datetime The date and time the user registered (UTC)
steamID64 integer The SteamID64 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
banned boolean If the user is currently banned
bannedUntil datetime or null The date and time the ban will expire (UTC) or null if not banned or ban is permanent
isGameAdmin boolean If the user has Game Moderator permissions
showDetailedOnWebMaps boolean Always false

Example requests:

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

Example response:

{
    "error": false,
    "response": {
        "id": 1,
        "name": "RootKiller",
        "avatar": "https:\/\/www.gravatar.com\/avatar\/9269ffc05a3a1c7899b708015d3d66a2?s=260",
        "joinDate": "2014-07-24 17:57:28",
        "steamID64": 76561198057763917,
        "groupName": "Retired Legend Team Member",
        "groupID": 23,
        "banned": false,
        "bannedUntil": null,
        "permissions": {
            "isGameAdmin": false,
            "showDetailedOnWebMaps": false
        }
    }
}

Latest 5 bans for a selected user if bans are not hidden or user has no bans. Use player lookup to check if user is currently banned

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

Parameters:

Name Type Description
id integer SteamID64 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 string 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.96.43.82",
            "port": 42860,
            "name": "United States",
            "shortname": "US",
            "online": true,
            "players": 30,
            "queue": 0,
            "maxplayers": 1500,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 150
        },
        {
            "id": 4,
            "game": "ETS2",
            "ip": "151.80.230.152",
            "port": 49200,
            "name": "Europe 2",
            "shortname": "EU #2",
            "online": true,
            "players": 483,
            "queue": 0,
            "maxplayers": 4200,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 250
        },
        {
            "id": 10,
            "game": "ATS",
            "ip": "163.172.64.173",
            "port": 42850,
            "name": "Europe",
            "shortname": "EU",
            "online": true,
            "players": 37,
            "queue": 0,
            "maxplayers": 2000,
            "speedlimiter": 0,
            "collisions": true,
            "carsforplayers": true,
            "policecarsforplayers": false,
            "afkenabled": true,
            "syncdelay": 100
        },
        {
            "id": 11,
            "game": "ATS",
            "ip": "191.96.43.82",
            "port": 42850,
            "name": "United States",
            "shortname": "US",
            "online": true,
            "players": 189,
            "queue": 0,
            "maxplayers": 1500,
            "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": 9066730
}

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.2.4.1",
    "numeric": 22041,
    "stage": "Alpha",
    "ets2mp_checksum": {
        "dll": "000000000000000000000000000000",
        "adb": "000000000000000000000000000000"
    },
    "atsmp_checksum": {
        "dll": "000000000000000000000000000000",
        "adb": "000000000000000000000000000000"
    },
    "time": "2018-05-17 16:00:00",
    "supported_game_version": "1.31.2.1s",
    "supported_ats_game_version": "1.31.2s"
}

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