FANDOM



Overview Edit

The City API provides information about a given city.

Access URL politicsandwar.com/api/city/id=X&key=Y Edit

Returned JSONEdit

Below is the JSON for the request of:

accessurl=245169
{
    'success': True, 
    'cityid': '245169', 
    'url': 'https://politicsandwar.com/city/id=245169', 
    'nationid': '137331', 
    'name': 'Capital', 
    'nation': 'Nation Name', 
    'leader': 'Leader Name', 
    'continent': 'North America', 
    'founded': '2018-10-03', 
    'age': 75, 
    'powered': 'Yes', 
    'infrastructure': '1309.90', 
    'land': '1500.00', 
    'population': 134264.75, 
    'popdensity': 89.51, 
    'crime': 0, 
    'disease': 0, 
    'commerce': 71, 
    'avgincome': 4.807, 
    'pollution': 0, 
    'nuclearpollution': 0, 
    'basepop': 130990, 
    'basepopdensity': 87.326608448928, 
    'minimumwage': 1.986301369863, 
    'poplostdisease': 0, 
    'poplostcrime': 0, 
    'imp_coalpower': '0', 
    'imp_oilpower': '0', 
    'imp_nuclearpower': '1', 
    'imp_windpower': '0', 
    'imp_coalmine': '0', 
    'imp_oilwell': '0', 
    'imp_ironmine': '0', 
    'imp_bauxitemine': '0', 
    'imp_leadmine': '0', 
    'imp_uramine': '1', 
    'imp_farm': '0', 
    'imp_gasrefinery': '0', 
    'imp_steelmill': '0', 
    'imp_aluminumrefinery': '0', 
    'imp_munitionsfactory': '0', 
    'imp_policestation': '1', 
    'imp_hospital': '1', 
    'imp_recyclingcenter': '1', 
    'imp_subway': '1', 
    'imp_supermarket': '0', 
    'imp_bank': '0', 
    'imp_mall': '3', 
    'imp_stadium': '3', 
    'imp_barracks': '5', 
    'imp_factory': '5', 
    'imp_hangar': '5', 
    'imp_drydock': '3'
}


Error JSON Edit

With an incorrect city id:

{
    'error': "City doesn't exist."
}
Community content is available under CC-BY-SA unless otherwise noted.