API[]
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[]
The following 2 API pages return the exact same data about citizens.
- http://primera.e-sim.org/apiCitizenByName.html?name=voldemortas - browsing citizens by name. Keep in mind that citizen name must be in lower case.
- 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[]
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[]
Battles[]
This API gives us a log of selected round. Some stuff may not be shown (if they had no impact). List of them: surround debuff, hospital/DS quality, location bonus, MU bonus.
https://secura.e-sim.org/apiFights.html?battleId=100000&roundId=4 - returns the log of a round
https://secura.e-sim.org/apiFights.html?battleId=100000 - returns the log of a battle
Example result
[{"damage":1203310, "weapon":5, "berserk":true, "defenderSide":false, "militaryUnitBonus":1.2, "citizenship":7, "citizenId":622389, "time":"22-03-2020 14:18:42:211", "militaryUnit":1150}, ...]
Battles 2[]
This API gives us information of requested battle. API shows current state of the battle, type of the battle etc.
http://secura.e-sim.org/apiBattles.html?battleId=73317 - returns info of a battle
Example result
[{"currentRound":10, "attackerScore":7, "regionId":874, "RW":true, "defenderScore":2, "secondsRemaining":35, "frozen":false, "type":"RESISTANCE", "defenderId":35, "minutesRemaining":37, "hoursRemaining":1, "attackerId":146}]
Countries[]
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[]
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[]
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[]
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 }, ... ]
Online players[]
This API gives us information of online players.
https://secura.e-sim.org/apiOnlinePlayers.html - returns info of online players
Example result
["{\"localization\":283, \"level\":49, \"citizenship\":2, \"xp\":\"Gkx\", \"id\":635252, \"login\":\"Gkx\"}", ...]
This API is a bit bugged so you'll have to convert it to the format you need before using it .The xp key is also currently bugged but there's nothing we can do about it.
Python example:
for row in API: row = json.loads(row)
Equipment
https://secura.e-sim.org/apiEquipmentById.html?id=1
{'EqInfo': [{'id': 1,
'name': 'Compass',
'quality': 1,
'set': 'none',
'slot': 'Offhand'}],
'Parameters': [{'Name': 'Miss chance reduction', 'Value': 0.55},
{'Name': 'Increased maximum damage', 'Value': 0.75}]}