AM4 DEVELOPER API
Updated April 08 2024 12:13:13
Through the API you can request data from the AM4 servers, which can be used for your own calculations or websites.
To request data, a unique API key is required, and can be obtained by contacting am4@xombat.dk.
This API key is personal and will be tied to your account, so please remember not to share this with anyone.

There is a limit of 500 requests per 24 hours. The status message will return the amount of requests remaining for that period
When using the api, always listen for "status":"success", in order to make sure that your request was successfull
Endpoint
https://www.airlinemanager.com/api
Alliance info
GET Parameters
access_token=[YOUR_ACCESS_TOKEN]
search=[ALLIANCE_NAME]
Example alliance query
Request details about an alliance
https://www.airlinemanager.com/api?access_token=[YOUR_ACCESS_TOKEN]&search=[ALLIANCE_NAME]

Response:
{
	"status": {
		"request": "success",
		"requests_remaining": 500
	},
	"alliance": [
		{
			"name": "Some alliance",
			"rank": 180,
			"members": 2,
			"maxMembers": 10,
			"value": 0,
			"ipo": 0,
			"minSV": 0
		}
	],
	"members": [
		{
			"company": "Company 1",
			"joined": 1584668561,
			"flights": 12,
			"contributed": 273,
			"dailyContribution": 500,
			"online": 1592676704,
			"shareValue": 5.44,
                        "season": 123   // Will return null if alliance is not entering into season
		},
		{
			"company": "Company 2",
			"joined": 1584668640,
			"flights": 18,
			"contributed": 195,
			"dailyContribution": 800,
			"online": 1593676104,
			"shareValue": 0.85,
                        "season": 123   // Will return null if alliance is not entering into season
		}
	]
}
User
GET Parameters
access_token=[YOUR_ACCESS_TOKEN]
user=[USERNAME] OR id=[USERID]
Example user query
Request details about a user
https://www.airlinemanager.com/api?access_token=[YOUR_ACCESS_TOKEN]&user=[SOME_COMPANY]
https://www.airlinemanager.com/api?access_token=[YOUR_ACCESS_TOKEN]&id=[NUMERIC_USERID]

Response:
{
    "status": {
        "request": "success",
        "requests_remaining": 500
    },
    "user": {
        "company": "Some Company",
        "level": 2,
        "share": 0.66,
        "shares_available": 0,
        "shares_sold": 50000,
        "ipo": 1,
        "fleet": 5,
        "routes": 5,
        "alliance": false,
        "achievements": 7,
	"game_mode": "Easy"
	"rank": 200,
        "founded": 1578721827,
	"logo": "http://logopath"
    },
    "share_development": [
        {
            "date": 1591777258,
            "share": 69.2
        },
        {
            "date": 1591773304,
            "share": 69.18
        },
        {
            "date": 1591772350,
            "share": 69.17
        },
        {
            "date": 1591515739,
            "share": 69.23
        },
        {
            "date": 1591355057,
            "share": 69.24
        },
        {
            "date": 1591350903,
            "share": 69.33
        },
        {
            "date": 1591045312,
            "share": 69.3
        },
        {
            "date": 1590564030,
            "share": 69.31
        }
	],
    "awards": [
        {
            "award": "Most Profitable",
            "awarded": 1589968741
        }
    ],
    "fleet": [
        {
            "aircraft": "B737-800",
            "amount": 1
        },
        {
            "aircraft": "Tu-104B",
            "amount": 1
        },
        {
            "aircraft": "Cessna 172",
            "amount": 1
        },
        {
            "aircraft": "Il-114",
            "amount": 2
        }
    ],
     "routes": [
        {
            "dep": "Esbjerg, Denmark",
            "stop": null,
            "arrival": "Shahrekord, Iran",
            "distance": 4159,
            "arrived": 1654095283
        }
    ]
}
Single route demand
GET Parameters
access_token=[YOUR_ACCESS_TOKEN]
fields=demand
dep_icao=[ICAO]
arr_icao=[ICAO]
Example demand query
Request demand data for a given route
https://www.airlinemanager.com/api?access_token=[YOUR_ACCESS_TOKEN]&fields=demand&dep_icao=[ICAO]&arr_icao=[ICAO]

Response:
{
    "status": {
        "request": "success",
        "requests_remaining": 484
    },
    "route": {
        "distance": 148,
        "departure": "Copenhagen, Denmark",
        "arrival": "Aarhus, Denmark"
    },
    "demand": {
        "economy_class_demand": 408,
        "business_class_demand": 98,
        "first_class_demand": 125,
        "cargo_large_demand": 204000,
        "cargo_heavy_demand": 98000
    }
}
Route research
GET Parameters
access_token=[YOUR_ACCESS_TOKEN]
fields=research
dep_icao=[ICAO]
min_runway=[MIN RUNWAY LENGTH]
max_distance=[MAX ROUTE DISTANCE]
Example demand query
Request demand data for a given route
https://www.airlinemanager.com/api?access_token=[YOUR_ACCESS_TOKEN]&fields=research&dep_icao=[ICAO]&min_runway=[NO]&max_distance=[NO]

Response:
{
    "status": {
        "request": "success",
        "requests_remaining": 757
    },
    "route": {
        "departure": "Copenhagen, Denmark",
        "data": [
            {
                "arrival": "Lviv, Ukraine",
		"icao": "xxxx",
		"iata": "xxxx",
                "runway": 10843,
                "market": 77,
                "economy_class_demand": 777,
                "business_class_demand": 280,
                "first_class_demand": 73,
                "cargo_large_demand": 389,
                "cargo_heavy_demand": 280,
		"distance": 100
            },
            {
                "arrival": "Manchester, United Kingdom",
		"icao": "xxxx",
		"iata": "xxxx",
                "runway": 10000,
                "market": 44,
                "economy_class_demand": 415,
                "business_class_demand": 326,
                "first_class_demand": 128,
                "cargo_large_demand": 208,
                "cargo_heavy_demand": 326,
		"distance": 100
            }
        ]
    }
}