ver API - wiki.e-sim.org

API

From wiki.e-sim.org
Jump to: navigation, search
Languages:  United-Kingdom-Flag-24.png Hungary-Flag-24.png



Contents

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.

http://e-sim.org/apiCitizenByName.html?name=doki - browsing citizens by name

http://e-sim.org/apiCitizenById.html?id=98 - browsing citizens by id

Example result

{
   "strength":1747,
   "damageToday":3417765,
   "economySkill":12.1875,
   "totalDamage":139729245,
   "organization":false,
   "citizenship":"Serbia",
   "level":19,
   "xp":29733 ,
   "login":"doki",
   "id":98,
   "rank":"Field Marshall"
}

Military unit

MU information

http://e-sim.org/apiMilitaryUnitById.html?id=32 - Military unit information

Returns information about a military unit. The following information is returned:

  • Gold value
  • The country id in which this MU exists
  • Total damage
  • Maximum members
  • Type (Novice, Regular, Veteran, Elite)
  • Name

Example result

{
   "goldValue":1900,
   "countryId":28,
   "totalDamage":2731920692,
   "maxMembers":38,
   "militaryUnitType":"Elite",
   "name":"Libra"
}

MU member information

http://e-sim.org/apiMilitaryUnitMembers.html?id=2 - Military unit members information

Returns the following information about the members of the MU:

  • Strength
  • Damage done today
  • Economy skill
  • Total damage done
  • Organization
  • Citizenship
  • Level
  • Experience points
  • Name
  • Id
  • Rank

Example result

[
   {
      "strength":1459,
      "damageToday":748040,
      "economySkill":9.921875,
      "totalDamage":88817055,
      "organization":false,
      "citizenship":"Bulgaria",
      "level":17,
      "xp":18205,
      "login":"Wildrunner",
      "id":498,
      "rank":"General of the Army"
   },
   {
      "strength":1289,
      "damageToday":0,
      "economySkill":8.640625,
      "totalDamage":8407323,
      "organization":false,
      "citizenship":"Bulgaria",
      "level":13,
      "xp":5907,
      "login":"vampire94",
      "id":42588,
      "rank":"Major"
   },
   ...
]

Misc

Battles

http://e-sim.org/apiFights.html?battleId=1050&roundId=5

Warning: This API feed has a small bug (last checked: 27 May 2012). If there is a defense system in place, the feed will return that there is a hospital in place.

Returns information regarding the attacks in a given battle in a given round. Every attack a citizen does is a new entry. A berserk attack is regarded as one entry, with the "berserk" property set to "true". Contains the following information per entry:

  • If citizen is effected by the surrounded debuff [OPTIONAL]
  • Military unit the citizen belongs to
  • Citizen id
  • The citizenship of the citizen
  • Hospital quality effecting this citizen [OPTIONAL]
  • If citizen is effected by location bonus [OPTIONAL]
  • Whether or not the citizen used the berserk option
  • If citizen is defending
  • Weapon quality used (0 if no weapon)
  • Date and time of attack
  • Bonus from MU [OPTIONAL]
  • Damage dealt

Example result

[
   {
      "surroundedDebuff":true,
      "militaryUnit":173,
      "citizenId":43689,
      "citizenship":19,
      "hospitalQuality":3,
      "localizationBonus":true,
      "berserk":true,
      "defenderSide":true,
      "weapon":1,
      "time":"27-05-2012 10:01:11:141",
      "militaryUnitBonus":1.1,
      "damage":19025
   },
   ...
]


Countries

http://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

[
   {
      "shortName":"HU",
      "name":"Hungary",
      "id":8,
      "currencyName":"HUF"
   },
   {
      "shortName":"CH",
      "name":"Switzerland",
      "id":39,
      "currencyName":"CHF"
   },
   ...
]


Ranks

http://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

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


Map data

http://e-sim.org/apiMap.html - all data available on map

Returns the entire map and its properties. These properties include:

  • The bonus resource in this region [OPTIONAL]
  • Is the region a capital;
  • Is there an ongoing battle in the region;
  • Who is the current owner of the region;
  • How many companies are in the region;
  • The abundance of the resource bonus (NONE, MEDIUM or HIGH)
  • The amount of defensive buildings;
  • The amount of people leaving in this region;
  • The region id

Example 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://e-sim.org/apiRegions.html - region information

Returns information about a region. The following data is returned:

  • Its neighbours (by id)
  • The original owner
  • If this region is a capital
  • The abundance of the resource bonus (NONE, MEDIUM or HIGH)
  • The name of region
  • The region id
  • The bonus resource in this region [OPTIONAL]


[
   {
      "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
   },
   ...
]
Personal tools
Namespaces

Variants
Actions
Navigation
Articles
Toolbox