Dovetail Games Train Sim World Api Support

Discussion in 'PC Editor Discussion' started by DTG Alex, Oct 8, 2025.

Thread Status:
Not open for further replies.
  1. DTG Alex

    DTG Alex Senior Community Manager Staff Member

    Joined:
    Jun 16, 2022
    Messages:
    1,664
    Likes Received:
    14,001
    Hi everyone,

    Today, we wanted to share some detailed thoughts from our Executive Producer, Matt Peddlesden, about TSW API support that we've been working on. Here are Matt's thoughts, and attached to this forums post is the API documentation referenced throughout.

    What exactly is an API and why should players care?


    API stands for “Application Programming Interface” and it is how systems can talk to each other. What this means is that developers can now create their own applications which can interface directly with Train Sim World, without using any kind of hacks or non-standard approaches.

    What does the API enable that couldn’t be done before?

    The API was specifically designed around allowing access to the internals of trains from external applications and even hardware. The main driving force for it was to allow people to make their own realistic train driving controls (it’s surprisingly simple to connect a few components to a Raspberry PI computer, write some simple code and suddenly find yourself able to operate the throttle from a realistic lever!). The API also allows access to other areas like seeing what speed limits, signals and gradients are ahead and even letting you control the weather! Imagine a set of physical sliders, as found on many MIDI control desks, being able to let you control the weather on the fly!

    This all sounds like it’s great for developers, but what about many players out there, is this relevant for them?

    The API is going to be more directly useful to developers who can write the code but where the players are going to benefit is from what they produce. Whether it’s physical hardware controls or other fun software features in external applications, or silly things like MIDI keyboards that can control the weather, ultimately this benefits the players by allowing more creative people to enhance their experience in all kinds of fun and interesting ways.

    One of the cool things about an API like this is that people will often find new and fun ways to use the API beyond how it was intended. I can’t wait to see what people do with it!

    What’s the story here for Console players?

    Unfortunately, the API is not available on the console due to platform limitations. It’s something we’d like to try and find a solution for in the future but currently access to the API is only possible on the PC.

    If someone reading this is a developer, how are they going to make use of this API?

    Start by reading the API documentation, follow the examples and practice getting information in and out of the game. Read the speed of your train, set the throttle lever, change the weather and so forth. Learn how it works and get comfortable (it won’t take long if you have a basic understanding of coding).

    When you’ve understood the API, which I’d estimate is a couple of hours playing around, it’s time to fire up your favourite development environment and start coding some experiments.

    Finally, once you’ve got the basics down it’s time to think about how you’re going to use it and get started on some real projects.

    For those that like some alphabet soup with their API’s - it uses HTTP requests over TCP with JSON response blocks. It’s easier when you see it and standard, easy to understand stuff for a developer.

    Are there any developers already using the API?

    Yes!

    TSControllers have a range of physical hardware controls available and have updated their software to use the API for full native support of TSW6. Gone are the days of keyboard-emulation for a less than satisfactory result, the API makes these devices feel much more realistic.

    Find out more about TSControllers here - TS Controllers | Enhance your immersion

    Another developer has released an application called ThirdRails which is a bit of a swiss army knife, it now has full integration using the API and this lets players join in with friends sharing their data online as well as with a real time live tracking map of people playing and where they are and many other things.

    Find out more about ThirdRails here - ThirdRails.org - Map tool, live radar for Train Simulator

    Lastly (that I’m aware of) ProCab Simulators are building a realistic Class 700 control desk, based on the Corys Compact driver training simulator desk. The desk makes great use of the API to map the controls, dials and other functions on the desk. Find out more at ProCab Simulators – Real Components – Simulated Reality

    What programming languages work with the API?

    Just about any programming language should work, if you can make HTTP requests over TCP and then understand the JSON response that comes back. In most modern software development environments those areas are covered very well and there are usually either built in features to support them or readily downloadable support libraries to help.

    If you are having stuck getting started, you can probably get some useful tips from Chat GPT or something similar too!

    How do players get started?

    If you can’t code, go and find people who are using the API such as the ones mentioned earlier. If you can code then read the API documentation and get coding!
     

    Attached Files:

    • Like Like x 8
Thread Status:
Not open for further replies.

Share This Page