Popular Post Lyrositor Posted November 13, 2017 Popular Post Share Posted November 13, 2017 (edited) This is a combined list of some of the most requested features for the API. If you have a popular suggestion you would like to see added, post below and I'll edit this post. The Politics & War API, while very useful, could be much more convenient with a few changes, ranging from simple additions to more complex options: Tax API: an alliance API which lists the gains from the last turn for a specific alliance (protected by key). Grouped Nation API Queries: right now, if we want to fetch a list of nations, we have to first obtain a list of IDs (usually from /nations/ or /alliance/id=*), then fetch each nation individually from /nation/id=*. This is both more time-consuming to implement and more work for the server, which has to deal with the overhead of all the separate requests when it could be optimized in one call to the database. A mechanism that either lets us specify multiple IDs for /nation/id=* or lets us get a detailed version of /nations/ (possibly limited to chunks of X nations at a time if you think pulling the detailed info to every nation in the game at once would be too expensive - e.g. /nations/range=1000:2000 or something of the sort) would make this much easier for everyone. Note that this should be optional - so that if you only want a simple list of nations, as is currently the case, it should still be the default. Grouped City API Queries: basically the same thing as above, but for cities. It would be nice, for example, to be able to get both a detailed nation and all the details of all of its cities in one go. Total Number of Improvements in Nation API: just a convenience, instead of having to call every city to find out. Ongoing War IDs in Nation/Nations API: it would be very useful to see a list of a nation's ongoing wars in the Nation API and the Nations API (as an option for the latter). Bank Manipulation in Bank API: might be open to exploits, like what happened with trading bots, but something to manage transaction in the bank could be interesting. Radiation and Season in API (personal suggestion): this is something I would find useful (not sure if others would), but a way to get the radiation level and season for a nation would be nice (in the nation API ideally). Treaty API: an API to view active treaties for each alliance. Edited December 29, 2017 by Lyrositor 1 9 Quote Link to comment Share on other sites More sharing options...
Partisan Posted November 13, 2017 Share Posted November 13, 2017 On 11/13/2017 at 4:11 PM, Lyrositor said: Ongoing War IDs in Nation API: it would be very useful to see a list of a nation's ongoing wars in the Nation API. To go along with this, ongoing war IDs in the Alliance API would be pretty sweet. EDIT BY ALEX: This has been done. 2 Quote Link to comment Share on other sites More sharing options...
Charlie Traveler Posted November 14, 2017 Share Posted November 14, 2017 Yes, please. These are all great ideas and I'm excited to see them come to fruition. Keep up the great work! 1 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted November 15, 2017 Administrators Share Posted November 15, 2017 I've updated the Nation API to include the following: offensivewars defensivewars offensivewar_ids defensivewar_ids But for the time being I can't push these changes live yet. Expect them in the next week or two. 3 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Printer635 Posted November 15, 2017 Share Posted November 15, 2017 On 13/11/2017 at 10:11 PM, Lyrositor said: Radiation and Season in API (personal suggestion): this is something I would find useful (not sure if others would), but a way to get the radiation level and season for a nation would be nice (in the nation API ideally). I second this one Also, LYRO IS BACK!! 1 Quote Link to comment Share on other sites More sharing options...
Dynamic Posted December 9, 2017 Share Posted December 9, 2017 My request is very simple and particular that would be of help to a current spreadsheet project I'm working on. Would it be possible to include the "offensivewars" and "defensivewars" indexes that are current found in the nation (singular) api and add it to the nations (plural) api? In other words can you add these keys from the nation api to the nation list api? Thanks. 1 Quote Horizon Guard of Rose Internal Affairs Link to comment Share on other sites More sharing options...
Lyrositor Posted December 10, 2017 Author Share Posted December 10, 2017 20 hours ago, Dynamic said: My request is very simple and particular that would be of help to a current spreadsheet project I'm working on. Would it be possible to include the "offensivewars" and "defensivewars" indexes that are current found in the nation (singular) api and add it to the nations (plural) api? In other words can you add these keys from the nation api to the nation list api? Thanks. I am okay with this so long as it is an option. I'll add it to the list. 3 Quote Link to comment Share on other sites More sharing options...
NastyGamer Posted December 28, 2017 Share Posted December 28, 2017 Treaty API. So that I can know what alliances have treaties.. and accordingly rule out those alliances or identify from my sheets. 1 Quote Link to comment Share on other sites More sharing options...
Lyrositor Posted December 29, 2017 Author Share Posted December 29, 2017 On 12/28/2017 at 6:52 AM, WarGamer said: Treaty API. So that I can know what alliances have treaties.. and accordingly rule out those alliances or identify from my sheets. Added. 2 Quote Link to comment Share on other sites More sharing options...
Shakyr Posted January 12, 2018 Share Posted January 12, 2018 I figured I'd link my previous posts about the API, and then include some extra stuff below. Other notes: All API pages should have the header media type of "application/json" All date/times should be in the format "1990-12-31T23:00:00Z". Dates are fine as "1990-12-31" Date Founded for Alliances API should be called "founded" (this seems to be standard), not "founddate" Alliance API is missing Date Founded Versioning: Should accept the HTTP Header "X-PNWAPI-Version" (or similar), which should just contain a simple version number, eg "1.9.0". If there is no header, it defaults to the latest version. Authentication: Should accept the HTTP Header "Authorization", which should contain "Bearer: <api_key>", eg "Bearer: 6ecf12cc109d9a". If there is no header, it should return the json "{error: "Not Authorised"}" or similar (this allows you to rate limit all API requests then). Result Filtering: Allow the results to be filtered, example "api/nations/?filter=id:lte:1000" (all nations with a nation id less than or equal to 1000) Field Selection: Allow the fields to be altered from the default, example "api/nations/?fields=id,name,leader,alliance_id" Of course, these can be both combined into "api/nations/?fields=id,name,leader,alliance_id&filter=id:lte:1000" Alternate suggestion for API endpoints (as opposed to my above posts). Might be overkill. api/orbis/ - current game information { orbis_date: <date>, //eg 1990-12-31 server_time: <date/time> //eg 1990-12-31T23:00:00Z season: <string>, //one of summer/autumn/winter/spring radiation: { global: <decimal>, africa: <decimal>, ... } } api/orbis/nations/ - all nations, default to the fields listed in my above post api/orbis/nations/<nation_id>/ - specific lookup for a nation api/orbis/nations/<nation_id>/cities/ - all cities for a nation api/orbis/nations/<nation_id>/cities/<city_id>/ api/orbis/cities/<city_id>/ - specific lookup of a city api/orbis/nations/<nation_id>/cities/<city_id>/improvements/ api/orbis/cities/<city_id>/improvements/ - all improvements for a city api/orbis/nations/<nation_id>/improvements/ - all improvements for a nation (to save having to loop through the above API endpoint api/orbis/nations/<nation_id>/military/ - military information and stats for the nation { soldiers: 1000, ... stats: { soldiers: { casualties: 200, killed: 500 }, ... } } api/orbis/nations/<nation_id>/projects/ - project information for the nation api/orbis/nations/<nation_id>/wars/ - list all wars for a particular nation api/orbis/alliances/ - all alliances, default to the fields listed in my above post api/orbis/alliances/<alliance_id>/ - specific lookup of an alliance api/orbis/alliances/<alliance_id>/members/ - list of all nations in the alliance (as per api/orbis/nations/ defaults), including those on vacation and leaders/heirs/officers, excluding applicants api/orbis/alliances/<alliance_id>/leaders/ api/orbis/alliances/<alliance_id>/heirs/ api/orbis/alliances/<alliance_id>/officers/ - list all nations with only the specific roles api/orbis/alliances/<alliance_id>/applicants/ - list of all nations who are applicants to the alliance api/orbis/alliances/<alliance_id>/members/resources/ - list the resources of an alliance's members { { id: <integer>, //nation_id coal: <decimal>, ... money: <decimal> }, ... } api/orbis/alliances/<alliance_id>/applicants/resources/ - list the resources of an alliance's applicants api/orbis/alliances/<alliance_id>/bank/ - list of all bank records - use filters to restrict to just tax records api/orbis/alliances/<alliance_id>/bank/resources/ - list the resources stored in the alliance's bank { coal: <decimal>, ... money: <decimal> } api/orbis/alliances/<alliance_id>/wars/ - list of wars for the alliance api/orbis/market/ - summary of market information for all resources api/orbis/market/<resource_name>/ - summary of market information for a specific resource api/orbis/market/<resource_name>/buy_offers/ - all buy offers currently available api/orbis/market/<resource_name>/sell_offers/ - all buy offers currently available api/orbis/treaties/ api/orbis/treaties/<alliance_id>/ 4 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted January 15, 2018 Administrators Share Posted January 15, 2018 I just fixed a bug where there was a discrepancy between the rank shown in the Nation API and the rank shown on the view nation page caused by the API taking into account nations in vacation mode. 3 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Administrators Alex Posted January 16, 2018 Administrators Share Posted January 16, 2018 The Nation API now includes the nation's local radiation index and what season the nation is currently in. @Lyrositor Radiation is listed as "radiation_index" and should return a float Season is listed as "season" and should return "spring" "summer" "autumn" or "winter" @Shakyr "beige_turns_left" has been added as a field in the Nation API. 3 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Charlie Traveler Posted January 29, 2018 Share Posted January 29, 2018 It would be awesome if the War API had fields for kills, casualties, and looting that happened in that particular war. Basically the "Total Losses" chart , but in the API. 1 Quote Link to comment Share on other sites More sharing options...
Dio Brando Posted January 29, 2018 Share Posted January 29, 2018 I’ll reiterate: It would make my, and a dozen other people’s life a hecktonne easier. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.