The Feeds of eRepublik API

From eRepublik Official Wiki
Jump to: navigation, search

Speech balloon.png Menu

Feeds are simple resources that can be requested directly without any authorization.

For example, you can go here with your browser, to get an XML list of all countries.

Data formats

The eAPI can transparently output XML (which is the default) or JSON data formats. By default, the response will be formatted in XML. For most calls, the data format can simply be chosen by appending .xml or .json to the call.

example :

both return information about Romania (country-id 1) in xml.

returns information about Romania (country-id 1) in json.

All the below examples will deal with XML data because it's more human readable. Feel free to always use the JSON format if you prefer it!


When the eAPI encounters an error, it will usually return an error element containing a time and a message element. Calling the following url

will result in the following error

These errors are meant for debugging purposes only, so if the eAPI returns such a response, the only information for your application should be “there was an error” - do not use the message for anything other than reading it yourself.


The eAPI data feeds let you retrieve various information about the game. No registration or authentication is required to use the feeds. To use a feed, simply make an HTTP GET request to the appropriate url.


Returns information about one citizen. The citizen can be retrieved by either his/her id or his/her citizen name. The name parameter of the citizen_by_name call is not case sensitive. Note that for the citizen_by_name call, you have to specify the format (either xml or json) before the name parameter.



Note that citizen names can contain special characters, you should therefore always URL escape the name before making the request, replacing all special characters with their corresponding URL escape code. The name “fresh!==!dude” would become “fresh%21%3D%3D%21dude”. Otherwise, the eAPI will not recognize some names.

XML output


Returns information about all countries.


XML output


Returns information about one country by its country id. For detailed information about the regions of a country, see regions by country. For detailed information about the wars a country is involved in, see wars by country.



XML output


Returns information about one region by its globally unique region id. To get information about the citizens/inhabitants of a region, see citizens by region.



XML output

Regions by country

Returns detailed information about the regions of a country. Each region looks exactly like a region returned by the Region call.



Wars by country

Returns information about the wars a country is involved in. Each war looks exactly like a war returned by the War feed.



Citizens by region

Returns the citizen-ids of all the citizens living in this region. This list can get very large and is therefore paginated. The current page, total number of pages and total number of citizens in this region are returned on each page. Note that the page numbers are zero-indexed.



XML Output


Returns information about one company.



XML Output

Exchange market

The currency exchange market (or monetary market) feed provides information about monetary exchange offers. The currencies that you specify are not case sensitive. This call does only return the 10 best offers for the requested exchange. Note that each country (see Countries) has one currency and there's the GOLD currency in addition.

  • buy_currency : The currency that you want to buy.
  • sell_currency : The currency that you want to sell.


XML Output


The market feed provides information about product offers, filtered by their attributes.

URL<industry_id>/<country_id>/<attr_1>/<attr_2>/<a ttr_3>/<attr_4>
  • industry_id : The id of the industry in which you want to look for products. See the industries feed for information about the industry ids.
  • country_id: the id of the country in which you want to look for products.
  • attr_1 – attr_4 : These correspond to the attributes of the product and state the minimum value the product should have at this attribute. Products have different number of attributes (0 to 4), and you must specify the correct number. The order of the attributes is the order they are returned in the industries feed.


XML Output


Returns Information about all industries and their customizable attributes. The attributes are returned in the same order the market feed takes them.



Returns information about one war. For detailed information on the battles fought in this war, see battle by war.



XML Output


Returns information about a battle. For information on the combatants fighting in the battle, see combatants.



XML Output

Battle by war

Returns all battles that were or are fought in a specific war. Each battle looks exactly like a battle from the Battle call.



Battle combatants

This feed was for the second version of the war module during eRepublik Rising, so this feed work only for battles which were during the second version.

Returns information about combatants of a battle. This feed is paged. The current page, total number of pages and total number of combatants in this battle are returned on each page. Note that the page numbers are zero-indexed.



XML Output


Google Documents

You can use the eAPI on a Google Spreadsheet document, for this you have to use the ImportXML function, like this :


This cell will contain the name of the citizen 1450324

You can use the function with a node of the feed like that :


Google Docs will put all child's nodes info on the line, one child per cell.



You can use many methods for parse XML in PHP, you can find some of ones here : XML Manipulation

You can use DOM (Document Object Model) for PHP 5 & 6 :

  $xmlDoc = new DOMDocument();
  $xp = $xmlDoc->getElementsByTagName("experience-points")->item(0)->nodeValue;