Wikia

E-Sim Wiki

API

Comments3
135pages on
this wiki

API Edit

The API allows programmers to retrieve data about e-sim, without requesting the actual game pages. The information is compressed into JSON objects, which relieves server pressure and makes it easier for programmers to work with the data. Below is an overview of the API pages currently available.


Citizen Edit

The following 2 API pages return the exact same data.

http://primera.e-sim.org/apiCitizenByName.html?name=Voldemortas - browsing citizens by name http://primera.e-sim.org/apiCitizenById.html?id=8060 - browsing citizens by id

Example result

{"id":8060,  
"rank":"Supreme Generalissimuss",  
"organization":false,  "level":29, 
"strength":2280, 
"citizenship":"Lithuania", 
"totalDamage":526111495, 
"xp":75661, 
"login":"Voldemortas", 
"economySkill":15.28125, 
"currentLocationRegionId":120, 
"damageToday":0}


Military unit Edit

There are 2 API pages, one gives a bit of general info (not all sadly) and other gives info about Military Unit members

http://primera.e-sim.org/apiMilitaryUnitById.html?id=91 - will grant info about this unit.

Example result

​{"countryId":19,
"maxMembers":50,
"name":"N1K",
"goldValue":2500,
"totalDamage":37171916746,
"militaryUnitType":"Elite"}

http://primera.e-sim.org/apiMilitaryUnitMembers.html?id=91 - gives you info about MU members.

Example result 

[{"id":32041,
 "rank":"Imperator Caesar",
 "organization":false,
 "level":34,
 "strength":2664,
 "citizenship":"Lithuania",
 "totalDamage":1636602173,
 "xp":109323,
 "login":"wygis",
 "economySkill":20.828125,
 "currentLocationRegionId":111,
 "damageToday":4943780},
...
]


MiscEdit

BattlesEdit

This API gives us a log of selected round. Some thing may not be showed (if they had no impact). List of them: surround debuff, Hospital/DS quality, location bonus, MU bonus.

http://primera.e-sim.org/apiFights.html?battleId=3040&roundId=15 - will give that round log. Example result

[{"time":"11-06-2012 15:00:09:590",
"militaryUnit":496,
"berserk":true,
"localizationBonus":true,
"militaryUnitBonus":1.05,
"weapon":1,
"defenderSide":true,
"damage":15410,
"citizenship":17,
"citizenId":97279},
...]


CountriesEdit

http://primera.e-sim.org/apiCountries.html - Returns a list of all countries The result includes the short name (used in for example setting orders), the full name, country id and the name of the currency.

Result

[{"capitalName":"Lisbon",
"id":18,
"capitalRegionId":106,
"currencyName":"PTE",
"name":"Portugal",
"shortName":"PT"},
{"capitalName":"Minsk",
"id":52,
"capitalRegionId":311,
"currencyName":"BYR",
"name":"Belarus",
"shortName":"BY"},
...
]


RanksEdit

http://primera.e-sim.org/apiRanks.html - rank list Returns a list with all the Ranks, the damage modifier and the damage required to obtain this rank.

Result

[{"damageRequired":0,
"name":"Rookie",
"damageModifier":1},
{"damageRequired":250,
"name":"Private",
"damageModifier":1.1},
...
]


Map dataEdit

http://primera.e-sim.org/apiMap.html - all data available on map Returns the entire map and its properties. Result 

[
  {
     "raw":"GRAIN",
     "capital":false,
     "battle":false,
     "occupantId":39,
     "companies":6,
     "rawRichness":"MEDIUM",
     "defensiveBuildings":0,
     "population":24,
     "regionId":230
  },
  {
     "capital":false,
     "battle":false,
     "occupantId":39,
     "companies":0,
     "rawRichness":"NONE",
     "defensiveBuildings":0,
     "population":5,
     "regionId":231
  },
  ...
]


Region informationEdit

http://primera.e-sim.org/apiRegions.html - region information Returns information about a region.

Result example

[
  {
     "neighbours":[
        16,
        45,
        69,
        122
     ],
     "homeCountry":8,
     "capital":false,
     "rawRichness":"HIGH",
     "name":"Western Transdanubia",
     "id":44,
     "resource":"GRAIN"
  },
  {
     "neighbours":[
        44,
        46,
        47,
        66,
        69,
        68
     ],
     "homeCountry":8,
     "capital":false,
     "rawRichness":"NONE",
     "name":"Eastern Transdanubia",
     "id":45
  },
  ...
]


Unofficial APIEdit

There are many not officials APIs however even if they provide better info they sometimes show wrong info or even doesn't work for a while. However I think I must put links to it:

http://www.cscpro.org/2013/12/welcome-esim-api-v3/ - many things there

http://voters.e-sim.lt/morto/ - creating in progress

Around Wikia's network

Random Wiki