API

* Spamming these API links and causing the game to lag can result in your API privilege's being revoked. So make sure to stay within your daily API cap. The game will keep track of any excess API request you make above your limit.

#### API Codes

You can find/generate your own API code on your account page income. It is suggested to not share your API code with anyone. Everyone has a daily limit of 500 api request per day. Upgraded accounts have their daily limit increased to 5000.

#### Public API Links

##### Nation list

* Link: http://diplomacyandstrifeapi.com/api/nation?APICode=YOURAPICODEHERE
* Info: Returns a list of nations with all data publicly available on the leaderboards. The only exception is that it will not return Tech Output.
* API Cost: 1

##### Specific Nation Info

* Link: http://diplomacyandstrifeapi.com/api/nation?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns public data for a specific nation
* API Cost: 1

##### Specific Nation Projects

* Link: http://diplomacyandstrifeapi.com/api/NationProjects?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns project data for a specific nation
* API Cost: 1

##### Alliance list

* Link: http://diplomacyandstrifeapi.com/api/alliance?APICode=YOURAPICODEHERE
* Info: Returns a list of alliances with all data publicly available on the leaderboards.
* API Cost: 1

##### Specific Alliance Treaties

* Link: http://diplomacyandstrifeapi.com/api/AllianceTreaties?APICode=YOURAPICODEHERE&&AllianceId=ALLIANCEIDHERE
* Info: Returns active treaties for an alliance
* API Cost: 1

#### Non-Public Alliance Data

The following links can be used to get for members of the alliance you are in. You require your alliances spy data permission to access these links.

###### Alliance Member Contribution

* Link: http://diplomacyandstrifeapi.com/api/AllianceMemberContribution?APICode=YOURAPICODEHERE
* Info: Returns a list of members of your alliance and their contribution amounts
* API Cost: 3(use Alliance Member Nation Contribution instead to pull a single nation for an api cost of 1)

###### Alliance Member Tech

* Link: http://diplomacyandstrifeapi.com/api/AllianceTech?APICode=YOURAPICODEHERE
* Info: Returns a list of members of your alliance and their technology levels
* API Cost: 1

###### Alliance Member Military

* Link: http://diplomacyandstrifeapi.com/api/AllianceMilitary?APICode=YOURAPICODEHERE
* Info: Returns a list of members of your alliance and their current military numbers
* API Cost: 1

###### Alliance Member Effects List

* Link: http://diplomacyandstrifeapi.com/api/NationsEffectsSummary?APICode=YOURAPICODEHERE
* Info: Returns a list of members of your alliance and their current effect summaries
* API Cost: 3
* Note: Not all effects are returned. Technology income is omitted so it can't be used to discover technology bribes
* Note: All cost reduction is returned in its raw form as this is a summary of effects. This means if this returns a 10 for land cost reduction then the actually effect is 0.99 ^ 10 not 10%.
* Note: The effects of technology and projects are not included in these numbers as they are handled differently by the backend server

###### Alliance Bank History

* Link: http://diplomacyandstrifeapi.com/api/AllianceBankHistory?APICode=YOURAPICODEHERE
* Info: Returns a list of bank transaction values for your own alliance.
* API Cost: 1

###### Alliance Grant Request

* Link: http://diplomacyandstrifeapi.com/api/AllianceGrantRequest?APICode=YOURAPICODEHERE
* Info: Returns a list of active grant request for your own alliance.
* API Cost: 1

###### Alliance Member Bank History

* Link: http://diplomacyandstrifeapi.com/api/NationBankHistory?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns a list of bank transaction values for a member of your alliance.
* API Cost: 1

###### Alliance Member Nation Buildings

* Link: http://diplomacyandstrifeapi.com/api/NationBuildings?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns a list of buildings for a single member of your alliance.
* API Cost: 1
* Optional Parameters:
	1. ExtraInfo: Adds Development, Land, Core Land, and Non Core Land (ExtraInfo=true)

###### Alliance Member Policy Last Ran

* Link: http://diplomacyandstrifeapi.com/api/NationPolicyLastRan?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns a list of immediate action and budgets and the server time they were last ran for a single nation.
* API Cost: 1

###### Alliance Member Nation Contribution

* Link: http://diplomacyandstrifeapi.com/api/NationContribution?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns the contribution amount for a single member of your alliance.
* API Cost: 1

###### Alliance Member Bank Deposits

* Link: http://diplomacyandstrifeapi.com/api/AllianceMemberBankDeposits?APICode=YOURAPICODEHERE
* Info: Returns a list of bank deposits for all members of your alliance.
* API Cost: 1

###### Alliance Member Inventory

* Link: http://diplomacyandstrifeapi.com/api/AllianceMemberInventory?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns a list of equipment for single member of your alliance. If a nation in your alliance has disabled Alliance Information Access then this will not return anything for them.
* Requires you to be a vice leader, or have your alliances permission to approve grants or loans to access this
* API Cost: 1

###### Alliance Member Funds

* Link: http://diplomacyandstrifeapi.com/api/AllianceMemberFunds?APICode=YOURAPICODEHERE
* Info: Returns a list of members of your alliance and their current funds levels on their nation. Any nation in your alliance that has disabled Alliance Information Access will not appear in this list.
* Requires you to be a vice leader, or have your alliances permission to approve grants or loans to access this
* API Cost: 1

##### War History

###### Nation War History

* Link: http://diplomacyandstrifeapi.com/api/NationWarHistory?APICode=YOURAPICODEHERE&&NationId=NATIONIDHERE
* Info: Returns a list of wars and corresponding data for a specific nation
* API Cost: 1
* Optional Parameters:
	1. StartDate: any war started on or after this date (year/month/day)
	2. StarDateEnd: any war started on or before this date (year/month/day)
	3. OnlyActive: only active wars. (OnlyActive=true)
	4. OnlyDefensive: only defensive wars. (OnlyDefensive=true)
	5. OnlyOffensive: only offensive wars. (OnlyOffensive=true)

###### Nation War Action History

* Link: http://diplomacyandstrifeapi.com/api/WarActionHistory?APICode=YOURAPICODEHERE&&WarId=WARIDHERE
* Info: Returns a list of actions and units loses per action in a war.
* API Cost: 1
* WarId can be retrieved from either the nation or alliance war history API

###### Alliance War History

* Link: http://diplomacyandstrifeapi.com/api/AllianceWarHistory?APICode=YOURAPICODEHERE&&AllianceId=ALLIANCEIDHERE
* Info: Returns a list of wars and corresponding data for a specific alliances
* API Cost: 10 (1 if only active wars are pulled)
* Optional Parameters:
	1. StartDate: any war started on or after this date (year/month/day)
	2. StarDateEnd: any war started on or before this date (year/month/day)
	3. OnlyActive: only active wars. Reduces API cost to 1 (OnlyActive=true)
	4. OnlyDefensive: only defensive wars. (OnlyDefensive=true)
	5. OnlyOffensive: only offensive wars. (OnlyOffensive=true)