API Consumers who require high rates of requests against our APIs should contact Krashnz, ShawnCZek, J-M & Kat_pw with a rationale and contact email for high-rate usage.
For access to the TruckersMP Traffic and/or TruckersMP Map API, contact Krashnz on the TruckersMP Forums.
Check out the TruckersMP PHP API library on GitHub for convenient access to the TruckersMP API for applications written in the PHP language.
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 |
smallAvatar |
string | URL to the avatar used on the website (32px x 32px) |
joinDate |
datetime | The date and time the user registered (UTC) |
steamID64 |
integer | The SteamID64 of the user |
steamID |
string | The SteamID64 of the user |
discordSnowflake |
string or null | The Discord account linked to the user or null if not linked or private |
groupName |
string | The name of the group the user belongs to |
groupColor |
string | The color of the group |
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 |
bansCount |
integer or null | The number of active bans a user has or null if staff |
displayBans |
boolean | If the user has their bans hidden |
patreon |
||
isPatron |
boolean | If the user has donated or is currently donating via Patreon |
active |
boolean | If the user has an active Patreon subscription |
color |
string or null | HEX code for subscribed tier |
tierId |
integer or null | The tier ID of current pledge |
currentPledge |
integer or null | Current pledge in cents |
lifetimePledge |
integer or null | Lifetime pledge in cents |
nextPledge |
integer or null | Next pledge in cents |
hidden |
boolean or null | If user has their Patreon information hidden |
permissions |
||
isStaff |
boolean | If the user is a TruckersMP staff member |
isUpperStaff |
boolean | If the user is part of upper staff within the TruckersMP team |
isGameAdmin |
boolean | If the user has Game Moderator permissions |
showDetailedOnWebMaps |
boolean | Always false |
vtc |
||
id |
integer | ID of the VTC the user belongs to or 0 if not in a VTC |
name |
string | Name of the VTC the user belongs to or empty if not in a VTC |
tag |
string | Tag of the VTC the user belongs to or empty if not in a VTC |
inVTC |
boolean | If the user is in a VTC |
memberID |
integer | VTC member ID or 0 if not in a VTC |
Example requests:
https://api.truckersmp.com/v2/player/6818
https://api.truckersmp.com/v2/player/76561198046080290
Example response:
{ "error": false, "response": { "id": 6818, "name": "Krashnz", "avatar": "https:\/\/static.truckersmp.com\/avatarsN\/6818.1538179228.png", "smallAvatar": "https:\/\/static.truckersmp.com\/avatarsN\/small\/6818.1538179228.png", "joinDate": "2014-11-14 01:33:03", "steamID64": 76561198046080290, "steamID": "76561198046080290", "discordSnowflake": "97936586632622080", "groupName": "Developer", "groupColor": "#673ab7", "groupID": 2, "banned": false, "bannedUntil": null, "bansCount": null, "displayBans": false, "patreon": { "isPatron": false, "active": false, "color": null, "tierId": null, "currentPledge": null, "lifetimePledge": null, "nextPledge": null, "hidden": null }, "permissions": { "isStaff": true, "isUpperStaff": true, "isGameAdmin": true, "showDetailedOnWebMaps": false }, "vtc": { "id": 1, "name": "TruckersMP Developers", "tag": "TMP-DEV", "inVTC": true, "memberID": 1579 } } }
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 |
idprefix |
nullable string | Shown in-game in front of a player's ID |
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 |
mapid |
integer | The map ID given to the server used by ETS2Map |
displayorder |
integer | Determines the order in which servers are displayed |
speedlimiter |
integer | If the speed limiter is enabled on the server (110 kmh for ETS2 and 80 mph 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 |
event |
boolean | If the server is an event server |
specialEvent |
boolean | Determine whether the server hosts special event files (e.g. map edits, special cargos or new paint jobs) |
promods |
boolean | Determine whether the server hosts ProMods |
syncdelay |
integer | Server tick rate |
Example request:
https://api.truckersmp.com/v2/servers
Example response:
{ "error": "false", "response": [ { "id": 4, "game": "ETS2", "ip": "145.239.131.35", "port": 42700, "name": "Simulation 1", "shortname": "EU SIM 1", "idprefix": null, "online": true, "players": 701, "queue": 0, "maxplayers": 4500, "mapid": 2, "displayorder": 10, "speedlimiter": 1, "collisions": true, "carsforplayers": true, "policecarsforplayers": false, "afkenabled": true, "event": false, "specialEvent": false, "promods": false, "syncdelay": 250 }, { "id": 8, "game": "ETS2", "ip": "37.187.170.151", "port": 42820, "name": "Arcade", "shortname": "EU ARC", "idprefix": "A", "online": true, "players": 81, "queue": 0, "maxplayers": 2000, "mapid": 7, "displayorder": 21, "speedlimiter": 0, "collisions": false, "carsforplayers": true, "policecarsforplayers": false, "afkenabled": true, "event": false, "specialEvent": false, "promods": false, "syncdelay": 150 }, { "id": 11, "game": "ATS", "ip": "158.69.120.230", "port": 42060, "name": "[US] Simulation", "shortname": "US SIM", "idprefix": null, "online": true, "players": 209, "queue": 0, "maxplayers": 1500, "mapid": 10, "displayorder": 120, "speedlimiter": 1, "collisions": true, "carsforplayers": true, "policecarsforplayers": false, "afkenabled": true, "event": false, "specialEvent": false, "promods": false, "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": 11092084 }
Events index page information
https://api.truckersmp.com/v2/events
Example request:
https://api.truckersmp.com/v2/events
Specific event information
https://api.truckersmp.com/v2/events/{id}
Example request:
https://api.truckersmp.com/v2/events/315
VTC index page information
https://api.truckersmp.com/v2/vtc
Example request:
https://api.truckersmp.com/v2/vtc
Specific VTC information
https://api.truckersmp.com/v2/vtc/{id}
Example request:
https://api.truckersmp.com/v2/vtc/1
List of specific VTC news
https://api.truckersmp.com/v2/vtc/{id}/news
Example request:
https://api.truckersmp.com/v2/vtc/17/news
Specific VTC news post
https://api.truckersmp.com/v2/vtc/{id}/news/{news_id}
Example request:
https://api.truckersmp.com/v2/vtc/17/news/121
List of specific VTC roles
https://api.truckersmp.com/v2/vtc/{id}/roles
Example request:
https://api.truckersmp.com/v2/vtc/1/roles
Specific VTC role
https://api.truckersmp.com/v2/vtc/{id}/role/{role_id}
Example request:
https://api.truckersmp.com/v2/vtc/1/role/668
List of specific VTC members
https://api.truckersmp.com/v2/vtc/{id}/members
Example request:
https://api.truckersmp.com/v2/vtc/1/members
Specific VTC member
https://api.truckersmp.com/v2/vtc/{id}/member/{member_id}
Example request:
https://api.truckersmp.com/v2/vtc/1/member/1579
List of specific VTC events
https://api.truckersmp.com/v2/vtc/{id}/events
Example request:
https://api.truckersmp.com/v2/vtc/4/events
Specific VTC event
https://api.truckersmp.com/v2/vtc/{id}/events/{event_id}
Example request:
https://api.truckersmp.com/v2/vtc/4/events/1
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.6.1", "numeric": "02261", "stage": "Alpha", "ets2mp_checksum": { "dll": "5c69c94490a67c25d7350dd9cac04253", "adb": "b81cd80669e2da9e60d3dcd47724f94d" }, "atsmp_checksum": { "dll": "850fd2c4a3142f251b40f4c6160eb7a4", "adb": "cbfee709981c7a49332382e82b9363da" }, "time": "2019-09-12 09:39:02", "supported_game_version": "1.35.1.150s", "supported_ats_game_version": "1.35.1.31s" }
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