CountyWar: The ultimate all-county battle royale simulation. Powered by REC.
GAME 22 OVER : Game 23 will start on Monday at 7:01 AM MST(AZ) / 14:01 UTC.
COUNTY WAR'S VERY GEEKY API

OK, since we are going to develop what many may find as a totally pointless website that is very long and drawn out, like a test cricket match; we might as well include an open application programming interface (API) to go with it.

The API is simply some of the functions from the CountyWAR site that you can use to develop your own interface to the data and live results. Perhaps, build a desktop app that sounds an alarm when your selected county is engaged in battle. The possibilities are only limited to what you can really do with randomized US counties.

The API is delivered in JSON and there are several endpoints that can be used. Enjoy the API while you engage down your path of expanding your inner-nerdiness.

game SECTION

Many of our endpoints provide a section called game. This section gives some basic information about the live game including:

curGameThe number of the current or last game played. This will increment once per week on Monday mornings.
inProgressIf the value is 1, then there is a live game in progress. A value of 0 indicates that the game has ended.
curRoundThe last round number that has been played.
lastBattleTimecode of when the last battle was conducted.
curEntitiesCount of the current number of entities remaining in the game.
sleepIf the value is 1, the game is currently in the overnight cease fire mode where the game is in progress but no battles are taking place. On Monday through Thursdays, the battles resume at 7AM MST/14:00 UTC.

 
CERTAIN VALUES IN RAW AND FORMATTED VERSIONS

Certain values such as populations and number of entities are provided in the next level down. value contains the value of the variable. formatted is the value of the variable but formatted with commas for display purposes.

GEOGRAPHIC IDENTIFIERS (geoId)

The geoId is a 5-digit zero-filled value that uniquely identifies a county entity. The values are based on the Federal Information Processing Standards (FIPS) code for that county or other third-level entity.

LIVE RESULTS API

Endpoint: https://countywar.com/api/live

This API provides information on the last battle/round that was played. The data in this endpoint updates once per minute during the period of when a live game is in progress.

In addition to the game section described above, this endpoint also includes the following sections:

battle - General information about the last round played. Note: The terms "battle" and "round" are used interchangeably in this game.

battleTypeThe type of battle being played in this round:
W - War - One entity attempts to take the land of the other entity.
L - Liberation - One entity has revolted without a fight and has been liberated. In this case, the county becomes independent and subject to future attack as well as eligible to originate its own attacks.
popInvolvedThe total population for both the attacker and target which is currently at stake in the current battle in raw and formatted versions.
entityCountThe total number of county entities for both the attacker and the target which is currently at stake in the current battle in raw and formatted versions.
outcomeIn the perspective of the attacker:
W - Attacker wins the round. (Attacker always wins liberation and free pass rounds)
L - Target wins the round.
(this element is not displayed in liberation rounds.)
freePasstrue if the round was a "free pass" given to the attacker as a result of achieving a perfect 9 hit points in the previous round. Otherwise, it is false.
outcomeTextThe plain English account of the battle which is displayed on the main page. The API version does not include the line breaks used on the website presentation.
majorBattletrue if this is considered a major battle, false if not. A major battle is one where both entities current have at least 25 entities each at the time of the battle.

attack and target - These are two separate sections that use the same data structure. Attack is the entity that engaged the Target in the battle. Liberation rounds will only display the attack section:

geoIdThe geoID for the controlling county entity.
nameName of the county entity.
statePostal abbreviation for the state of the county entity.
popCurrent population of the entity including acquisitions in both raw and formatted versions.
entityCurrent count of entities that have been captured by the controlling entity. This is available in raw and formatted versions.
fullNameThe county and state formatted on a single line.
outcomeOutcome of this controlling entity in the battle (win or lose).
hitPointsThe total number of hit points that were achieved by the controlling entity in this battle. This value can range from 0~9.

hitPoints - This is a simple array that shows the outcome for each of the 9 fights within the battle. A value of 1 indicates that the attacker won the point where a value of 2 indicates that the target was the winner. Hit points are not used in liberation or free pass rounds.

LEADERBOARD API

Endpoint (entity leaders): https://countywar.com/api/leaderboard
Endpoint (population leaders): https://countywar.com/api/leaderboard/?pop=1

The leaderboard API identifies the top 25 controlling entities. It is updated after each round of the live game. There are two different versions for entity leaders and population leaders.

This API includes the game section shown above.

leader

entityGeoID of the controlling entity with the most entities. If there is a tie, then population will break the tie.
popGeoID of the contorlling entity with the largest captured population.

leaderboard - Up to 25 of the following values ranked by either entities or population:

popPopulation of the controlling entity in raw and formatted versions.
entityNumber of entities controlled by the controlling entity in raw and formatted versions.
countyName of the county entity.
statePostal state abbreviation for the county entity.
nameName and state of county entity on a single line for display.
geoIdGeoID for the subject controlling entity.
 
From your friends at the Fun and Games Department at REC!
Copyright © REC Networks - All rights reserved.
Developer API

REC Privacy Policy | REC GDPR Policy