Skip to main content

TruckSimAPI

This module will provide information from the in game API. This is the same API that most other applications use as well.

Arguments

Fallback: bool = False
If enabled the module will return "not connected" instead of a virtual dictionary when no data is received from the game API.

Return Data

TruckSimAPI will return a dictionary with all the data available from the api. In the following dictionary the table title is the parent key, and the values are child keys.

# Update the API data
data = self.modules.TruckSimAPI.run()
# Example
value = data[parent_key][child_key]
speed = data["truckFloat"]["speed"]
tip

Use CTRL+F to search. There is a lot of data here!

root (no parent key)Description
sdkActiveTrue if the SDK is active.
placeHolder
pauseTrue if the game is paused.
placeHolder2
timeThe current in-game time.
simulatedTimeIncrementing simulation time.
renderTimeThe last frame's render time.
multiplayerTimeOffset
scsValuesDescription
telemetryPluginRevisionThe revision of the telemetry plugin.
versionMajorThe major version of the game.
versionMinorThe minor version of the game.
gameThe name of the game. ETS2 / ATS / unknown
telemetryVersionGameMajorThe major version of the telemetry plugin.
telemetryVersionGameMinorThe minor version of the telemetry plugin.
commonUIDescription
timeAbsThe absolute time in the game.
configUIDescription
gearsHow many gears the truck has.
gearsReverseHow many reverse gears the truck has.
retarderStepCountHow many steps the retarder has.
truckWheelCountHow many wheels the truck has.
selectorCountHow many selectors the truck has. (no clue what this means btw)
timeAbsDeliveredThe absolute time the delivery was made. (no clue what this means also)
maxTrailerCountThe maximum amount of trailers the truck can have.
unitCountHow many units of cargo the current job has.
plannedDistanceKmThe distance of the planned route in km.
truckUIDescription
shifterSlot?
retarderBrake?
lightsAuxFrontwhether the front aux lights are on.
lightsAuxRoofwhether the roof aux lights are on.
truckWheelSubstanceMaterial of the wheels.
hshifterPositionThe position of the hshifter.
hshifterBitmaskNo clue why this is here...
gameplayUIDescription
jobDeliveredDeliveryTimeThe time the delivery was made.
jobStartingTimeThe time the job started.
jobFinishedTimeThe time the job finished.
commonIntDescription
restStop?
truckIntDescription
gearThe current gear of the truck.
gearDashboardThe gear shown on the dashboard.
hshifterResultingThe resulting hshifter position. (I guess)
commonFloatDescription
scaleI would assume this is the scale of the game map, for ETS2 that's 1/19 and for ATS it's 1/20.
configFloatDescription
fuelCapacityThe fuel capacity of the truck.
fuelWarningFactorThe fuel warning factor, when the fuel is at this percentage the warning will show.
adblueCapacityThe adblue capacity of the truck.
adblueWarningFactorThe adblue warning factor, when the adblue is at this percentage the warning will show.
airPressureWarningThe air pressure warning factor, when the air pressure is at this percentage the warning will show.
airPressureEmergencyThe air pressure emergency factor, when the air pressure is at this percentage the emergency warning will show.
oilPressureWarningThe oil pressure warning factor, when the oil pressure is at this percentage the warning will show.
waterTemperatureWarningThe water temperature warning factor, when the water temperature is at this percentage the warning will show.
batteryVoltageWarningThe battery voltage warning factor, when the battery voltage is at this percentage the warning will show.
engineRpmMaxThe maximum RPM of the engine.
gearDifferentialThe current (?) gear differential.
cargoMassThe mass of the cargo.
truckWheelRadiusThe radius of the wheels. (array of len(16))
gearRatiosForwardThe forward gear ratios. (array of len(24))
gearRatiosReverseThe reverse gear ratios. (array of len(8))
unitMassThe mass of one unit.
truckFloatDescription
speedThe speed of the truck. In m/s. For km/h multiply by 3.6. For mph multiply by 2.236936.
engineRpmThe RPM of the engine.
userSteerThe steering input of the user.
userThrottleThe throttle input of the user.
userBrakeThe brake input of the user.
userClutchThe clutch input of the user.
gameSteerThe steering input of the game.
gameThrottleThe throttle input of the game.
gameBrakeThe brake input of the game.
gameClutchThe clutch input of the game.
cruiseControlSpeedThe speed of the cruise control.
airPressureThe air pressure of the truck.
brakeTemperatureThe temperature of the brakes.
fuelThe amount of fuel. (%)
fuelAvgConsumptionThe average fuel consumption of the truck. Note that this is broken like 50% of the time.
fuelRangeThe range of the fuel in km.
adblueThe current amount of adblue. (%)
oilPressureThe current oil pressure
oilTemperatureThe current oil temperature
waterTemperatureThe current water temperature
batteryVoltageThe current battery voltage
lightsDasboard?
wearEngineThe wear of the engine.
wearTransmissionThe wear of the transmission.
wearCabinThe wear of the cabin.
wearChassisThe wear of the chassis.
wearWheelsThe wear of the wheels.
truckOdometerThe odometer of the truck.
routeDistanceThe distance left on the current route.
routeTimeThe time left on the current route.
speedLimitThe current speed limit. In m/s. For km/h multiply by 3.6. For mph multiply by 2.236936.
truck_wheelSuspDeflectionThe suspension deflection of the wheels. (array of len(16))
truck_wheelVelocityThe velocity of the wheels. (array of len(16))
truck_wheelSteeringThe steering of the wheels. (array of len(16))
truck_wheelRotationThe rotation of the wheels. (array of len(16))
truck_wheelLiftThe lift of the wheels. (array of len(16))
truck_wheelLiftOffsetThe lift offset of the wheels. (array of len(16))
gameplayFloatDescription
jobDeliveredCargoDamageThe damage of the cargo.
jobDeliveredDistanceKmThe distance of the delivery in km. For miles multiply by 0.621371.
refuelAmountThe last refuel amount.
jobFloatDescription
cargoDamageThe damage of the cargo for the current job.
configBoolDescription
truckWheelSteerableIf the wheels are steerable (array of len(16))
truckWheelSimulatedIf the wheels are simulated (array of len(16))
truckWheelPoweredIf the wheels are powered (array of len(16))
truckWheelLiftableIf the wheels are liftable (array of len(16))
isCargoLoadedIf the cargo is loaded.
specialJobIf the job is special.
truckBoolDescription
parkBrakeIf the parking brake is on.
motorBrakeIf the motor brake is on.
airPressureWarningIf the air pressure is below the warning level.
airPressureEmergencyIf the air pressure is below the emergency level.
fuelWarningIf the fuel is below the warning level.
adblueWarningIf the adblue is below the warning level.
oilPressureWarningIf the oil pressure is below the warning level.
waterTemperatureWarningIf the water temperature is above the warning level.
batteryVoltageWarningIf the battery voltage is below the warning level.
electricEnabledIf the electric is enabled.
engineEnabledIf the engine is enabled.
wipersIf the wipers are on.
blinkerLeftActiveIf the left blinker is active.
blinkerRightActiveIf the right blinker is active.
blinkerLeftOnIf the left blinker is on (currently the light is enabled, this blinks with the light)
blinkerRightOnIf the right blinker is on (currently the light is enabled, this blinks with the light)
lightsParkingIf the parking lights are on.
lightsBeamLowIf the low beam lights are on.
lightsBeamHighIf the high beam lights are on.
lightsBeaconIf the beacon lights are on.
lightsBrakeIf the brake lights are on.
lightsReverseIf the reverse lights are on.
lightsHazardIf the hazard lights are on.
cruiseControlIf the cruise control is on.
truck_wheelOnGroundIf the wheels are on the ground. (array of len(16))
shifterToggleIf the shifter is toggled.
differentialLockIf the differential lock is on.
liftAxleIf the axle is lifted.
liftAxleIndicatorIf the lift axle indicator is on.
trailerLiftAxleIf the trailer axle is lifted.
trailerLiftAxleIndicatorIf the trailer lift axle indicator is on.
gameplayBoolDescription
jobDeliveredAutoparkUsedIf the autopark was used for the delivery.
jobDeliveredAutoloadUsedIf the autoload was used for the delivery.
configVectorDescription
cabinPositionXThe X position of the cabin.
cabinPositionYThe Y position of the cabin.
cabinPositionZThe Z position of the cabin.
headPositionXThe X position of the head.
headPositionYThe Y position of the head.
headPositionZThe Z position of the head.
truckHookPositionXThe X position of the truck hook.
truckHookPositionYThe Y position of the truck hook.
truckHookPositionZThe Z position of the truck hook.
truckWheelPositionXThe X position of the wheels. (array of len(16))
truckWheelPositionYThe Y position of the wheels. (array of len(16))
truckWheelPositionZThe Z position of the wheels. (array of len(16))
truckVectorDescription
lv_accelerationXThe X linear acceleration of the truck.
lv_accelerationYThe Y linear acceleration of the truck.
lv_accelerationZThe Z linear acceleration of the truck.
av_accelerationXThe X angular acceleration of the truck.
av_accelerationYThe Y angular acceleration of the truck.
av_accelerationZThe Z angular acceleration of the truck.
accelerationXThe X acceleration of the truck.
accelerationYThe Y acceleration of the truck.
accelerationZThe Z acceleration of the truck.
aa_accelerationX?
aa_accelerationY?
aa_accelerationZ?
cabinAVXThe X angular velocity of the cabin.
cabinAVYThe Y angular velocity of the cabin.
cabinAVZThe Z angular velocity of the cabin.
cabinAAX?
cabinAAY?
cabinAAZ?
headPlacementDescription
cabinOffsetXThe X offset of the cabin.
cabinOffsetYThe Y offset of the cabin.
cabinOffsetZThe Z offset of the cabin.
cabinOffsetrotationXThe X rotation offset of the cabin.
cabinOffsetrotationYThe Y rotation offset of the cabin.
cabinOffsetrotationZThe Z rotation offset of the cabin.
headOffsetXThe X offset of the head.
headOffsetYThe Y offset of the head.
headOffsetZThe Z offset of the head.
headOffsetrotationXThe X rotation offset of the head.
headOffsetrotationYThe Y rotation offset of the head.
headOffsetrotationZThe Z rotation offset of the head.
truckPlacementDescription
coordinateXThe X coordinate of the truck.
coordinateYThe Y coordinate of the truck.
coordinateZThe Z coordinate of the truck.
rotationXThe X rotation of the truck.
rotationYThe Y rotation of the truck.
rotationZThe Z rotation of the truck.
configStringDescription
truckBrandIdThe brand ID of the truck.
truckBrandThe brand of the truck.
truckIdThe ID of the truck.
truckNameThe name of the truck.
cargoIdThe ID of the cargo.
cargoThe name of the cargo.
cityDstIdThe ID of the destination city.
cityDstThe name of the destination city.
compDstIdThe ID of the destination company.
compDstThe name of the destination company.
citySrcIdThe ID of the source city.
citySrcThe name of the source city.
compSrcIdThe ID of the source company.
compSrcThe name of the source company.
shifterTypeThe type of the shifter.
truckLicensePlateThe license plate of the truck.
truckLicensePlateCountryIdThe country ID of the license plate.
truckLicensePlateCountryThe country of the license plate.
jobMarketThe job market.
gameplayStringDescription
fineOffenceThe fine offence.
ferrySourceNameThe name of the source ferry.
ferryTargetNameThe name of the target ferry.
ferrySourceIdThe ID of the source ferry.
ferryTargetIdThe ID of the target ferry.
trainSourceNameThe name of the source train.
trainTargetNameThe name of the target train.
trainSourceIdThe ID of the source train.
trainTargetIdThe ID of the target train.
configLongLongDescription
jobIncomeThe income of the current job.
gameplayLongLongDescription
jobCancelledPenaltyThe penalty of the cancelled job.
jobDeliveredRevenueThe revenue of the delivered job.
fineAmountThe amount of the fine.
tollgatePayAmountThe amount paid at the tollgate.
ferryPayAmountThe amount paid at the ferry.
trainPayAmountThe amount paid at the train.
specialBoolDescription
onJobIf the player is on a job.
jobFinishedIf the job is finished.
jobDeliveredIf the job is delivered.
jobCancelledIf the job is cancelled.
finedIf the player is fined.
tollgateIf the player is at a tollgate.
ferryIf the player is at a ferry.
trainIf the player is at a train.
refuelIf the player is refueling.
refuelPayedIf the player has payed for the refuel.