Wikia

E-Sim Wiki

API

Comments10
145pages 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 about citizens.

  1. http://primera.e-sim.org/apiCitizenByName.html?name=voldemortas - browsing citizens by name. Keep in mind that citizen name must be in lower case.
  2. 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 - returns general info about MU

Example result

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

http://primera.e-sim.org/apiMilitaryUnitMembers.html?id=91 - returns 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},
...
]

Miscellaneous Edit

Battles Edit

This API gives us a log of selected round. Some stuff 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 - returns the log of round

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},
...]

Countries Edit

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"},
...
]

Ranks Edit

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 data Edit

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 information Edit

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

Returns information about regions.

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 APIs Edit

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 should put links to some of them.

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

Around Wikia's network

Random Wiki