Offer an API for AirlineSim game worlds that allows to read data and potentially issue commands in a structured format.
Why?
This has been requested many times over the course of AS’ history, but there are several reasons why this is slowly becoming an essential feature:
As we plan to lock down (exclusive) game worlds a bit more (hiding what’s going on to anyone who isn’t an active player) a separate interface for external tools (like AS Routemap) makes it easier to grant access without sharing regular authentication details.
The planned UI refresh will almost certainly come with a more modern architecture that separates the (interactive) frontend and the server, hence requiring an interface to load its data and trigger actions.
An API generally makes the life of tool-developers easier as they don’t have to parse data from regular pages in a structure that might change at any time without notice.
When?
Technically, and as stated above, this will likely arrive as a side-effect of the UI refresh. Whether and how it will be made (easily) accessible to all users is a slightly different story, but there wouldn’t really be a reason to not allow it (as clever players will figure out how to do it anyway…).
Not really, as initially, endpoints will be added for what I need right now. I likely won’t get around to adding endpoints merely for the sake of completeness for a while.
As stated above, at first the endpoints will be added according to my concrete needs to build out the next generation of the UI. So that’ll be reading endpoints for public and private data and almost certainly some writing ones to trigger actions in game. Although the latter might remain restricted/internal as I am not too excited about the thought of bots playing the game. Either way, API access will require authentication in almost all cases.
Apologies, I was really tired when writing my last post so I didn’t properly ask my questions well.
What I meant to ask was what kind of authentication are you planning to implement? Would there be different methods of authentication for different purposes? For example, basic UI changes would be made with something like JWT or Session IDs, and some kinds of automation (such as getting financials or aircraft type evaluation) could be controlled with an API key? I’m not an experienced web developer, so I don’t know if this would work/be feasible.
Also, would there be some form of public documentation down the line to allow modders to implement some basic API calls, such as getting inventory information? I understand that it would be a future consideration since the focus is getting the endpoints implemented, but would it be on the cards to be provided for in the future?
I absolutely agree that allowing bots to play the game completely ruin the experience, and it’s the furthest thing I would like for Airlinesim. It would make people who would just want to play the game feel unable to compete with bots who are operating at lightning quick speeds!
There’s no reason to make external API calls write stuff.
Calls that do things to actually play the game should only be for internal use by you.
For example, the only reason I’d want write calls is for things I already write, like the cabin configs, service profiles, and opening stations. These are really just quality of life things that remove some of the drudgery without affecting how well an airline actually does.
The people who are looking for an API mostly just want easier access to information and to remove drudgery clicks, not playing the game through a bot.
As a full-stack engineer and a newcomer to this game, I would like to express my sincere appreciation for the immense joy your game has brought into my otherwise routine life. Having previously worked in data analysis research, I often find myself building models based on numerous variables when playing management simulation games. However, I must admit that the front-end interface of this game presented me with considerable challenges—it took me roughly a month to collect most of the fundamental airport data manually. This experience led me to wish for the availability of open APIs.
Fortunately, upon visiting the forum, I came across your post, which genuinely excited me. I fully agree with your perspective on this matter and would like to share a few thoughts:
I strongly support your view that APIs should not include player actions. Preserving the game’s environment by preventing automated bots is crucial.
Initially, APIs could focus primarily on data distribution, which would align well with your new front-end project.
Security aspects such as API authentication and rate limiting could be refined during the early testing phases. We might consider granting developer access to users through a series of capability tests and reviews.
If possible, I would be keen to develop a companion mobile app to monitor my company’s operations in real-time.
I understand that implementing such features is no small endeavor. Nonetheless, I truly appreciate your dedication and contributions to this game.