| This page documents the API.
This page is about the API for the game. It contains information such as contents, structure, & other miscellany. See Category:API for other pages on the API. |
This endpoint is deprecated and planned to potentially be removed by December 2023. It is recommended to switch to v3 of the API.
Overview[]
The Alliance Members API can be used to access information about your alliance's member information. It displays information found in the Alliance Control panel, along with extra information. Use of this API requires your API key.
Access URL[]
baseurl/alliance-members/?allianceid={id}&key={api key}
Alliance Member Resource Information[]
Nations in alliances have a setting on the account page to prevent alliances from having access to their money and resource information. If they prevent access, values returned by the API for all money and resources are -1.
Returned JSON[]
With the following request
accessurl/?allianceid=790&key=897sfn72e7xhh0u
{
'success': True,
'nations': [
{
'nationid': 390,
'nation': 'Gran Pulse',
'leader': 'Clarke',
'war_policy': 'Pirate',
'color': 'pink',
'alliance': 'Rose',
'allianceid': 790,
'allianceposition': 0,
'cities': 0,
'offensivewars': 0,
'defensivewars': 0,
'score': '4694.36',
'vacmode': '0',
'minutessinceactive': 1705,
'infrastructure': '21146.33',
'turns_since_last_city': 41,
'turns_since_last_project': 712,
'bauxiteworks': '1',
'ironworks': '0',
'armsstockpile': '1',
'emgasreserve': '1',
'massirrigation': '1',
'inttradecenter': '1',
'missilepad': '1',
'nuclearresfac': '1',
'irondome': '1',
'vitaldefsys': '1',
'intagncy': '1',
'uraniumenrich': '0',
'propbureau': '1',
'cenciveng': '1',
'money': '0',
'food': '0',
'coal': '0',
'oil': '0',
'uranium': '0',
'bauxite': '0',
'iron': '0',
'lead': '0',
'gasoline': '0',
'munitions': '0',
'aluminum': '0',
'steel': '0',
'credits': 0,
'soldiers': '0',
'tanks': '0',
'aircraft': '0',
'ships': '0',
'missiles': '0',
'nukes': '0',
'spies': '0'
},
// other nations
]
}
Error JSON[]
With an incorrect key
{
"success": false,
"general_message": "Invalid API key."
}
Both an incorrect alliance id and having no bank access returns this
{
"success": false,
"general_message": "Unable to access. You are not in this alliance."
}