Administrators Alex Posted June 21, 2015 Administrators Share Posted June 21, 2015 Just wanted to create a thread discussing the P&W API, which is slowly becoming more useful. Discuss what pages you'd like to see an API for, or what information you'd like to see added to existing API pages. Currently we have an API page for: Nation (example: https://politicsandwar.com/api/nation/id=5511 ) Alliance (example: https://politicsandwar.com/api/alliance/id=1039 ) City (example: https://politicsandwar.com/api/city/id=10614 ) 1 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...
WISD0MTREE Posted June 21, 2015 Share Posted June 21, 2015 When I saw this, the first thing I thought was Armor Piercing Incendiary ammo. Do I need help? 4 Quote Link to comment Share on other sites More sharing options...
naTia Posted June 21, 2015 Share Posted June 21, 2015 When I saw this, the first thing I thought was Armor Piercing Incendiary ammo. Do I need help? No you just need more ammo 5 Quote Resident DJ @ Club Orbis Founder of The Warehouse Link to comment Share on other sites More sharing options...
ELPINCHAZO Posted June 21, 2015 Share Posted June 21, 2015 https://politicsandwar.com/alliances/with all AAs https://politicsandwar.com/api/alliance/should have a list of members. 1 Quote Link to comment Share on other sites More sharing options...
Moreau Posted June 21, 2015 Share Posted June 21, 2015 Kk Quote Signed by Sultan Moreau Link to comment Share on other sites More sharing options...
Mike Ontry Posted June 21, 2015 Share Posted June 21, 2015 (edited) ...https://politicsandwar.com/api/alliance/should have a list of members. A list of members with nation links would be nice. Top 15 trade buy/sell trade offers for each resource would be useful too. Edited June 21, 2015 by Mike Ontry 1 Quote Link to comment Share on other sites More sharing options...
ELPINCHAZO Posted June 21, 2015 Share Posted June 21, 2015 it would be REALLY nice if the alliance page at least had the number of nations in an AA and color. and if the nation had UID Quote Link to comment Share on other sites More sharing options...
Dan77 Posted June 21, 2015 Share Posted June 21, 2015 Some kind of a military feed would be nice so that people's war stats and battles can be tracked and recorded by external sites. Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted June 22, 2015 Author Administrators Share Posted June 22, 2015 it would be REALLY nice if the alliance page at least had the number of nations in an AA and color. and if the nation had UID Bit of an oversight by me, I suppose. I've added members, applicants, and colors to the alliance API page. I've also added UID to the nation API page. 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...
Dwynn Posted June 22, 2015 Share Posted June 22, 2015 (edited) Maaan... now I'm gonna have to recode. Also in city api, manufacturing/oilrefineries not displaying Edited June 22, 2015 by Micheal Malone Quote He's right, I'm such a stinker. Play my exceptional game! Link to comment Share on other sites More sharing options...
Administrators Alex Posted June 22, 2015 Author Administrators Share Posted June 22, 2015 Maaan... now I'm gonna have to recode. Also in city api, manufacturing/oilrefineries not displaying Got it now. Thanks! 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...
Shakyr Posted June 24, 2015 Share Posted June 24, 2015 No listing of City IDs on Nation API, means you can't navigate from Nation to City. Possibly change "cities" to an array of city IDs (and they can just count the array, to find the number of cities). List of wars and list of trades (accessible by Nation ID, each list item with a unique ID), would be useful too. Quote Link to comment Share on other sites More sharing options...
ELPINCHAZO Posted June 24, 2015 Share Posted June 24, 2015 No listing of City IDs on Nation API, means you can't navigate from Nation to City. Possibly change "cities" to an array of city IDs (and they can just count the array, to find the number of cities). List of wars and list of trades (accessible by Nation ID, each list item with a unique ID), would be useful too. eh,cities are too much and not really useful. I'd leave it the way it is. Quote Link to comment Share on other sites More sharing options...
Mike Ontry Posted June 24, 2015 Share Posted June 24, 2015 No listing of City IDs on Nation API, means you can't navigate from Nation to City. Possibly change "cities" to an array of city IDs (and they can just count the array, to find the number of cities). List of wars and list of trades (accessible by Nation ID, each list item with a unique ID), would be useful too. I agree city IDs need to be on the nation API. Right now there is no way to go from the nation API to the city API using code. You have to manually look up the nations city ids in game to use the city API. Quote Link to comment Share on other sites More sharing options...
dmjohnston Posted June 24, 2015 Share Posted June 24, 2015 (edited) Being able to go to a nation page based on nation name could be a nice addition. So using either ID or Nation Name for the same feed. Either that, or a search API that lets you find the nation ID by searching a nation name to then use the ID to pull the nation page. I think an array of city IDs in the Nation page would be a good thing. List of nations in an alliance would be good. And as Ontry requested, market feeds. Edited June 24, 2015 by dmjohnston Quote ☾☆ Priest of Dio º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ ¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸ ¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸ ¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ Link to comment Share on other sites More sharing options...
Shakyr Posted June 24, 2015 Share Posted June 24, 2015 eh,cities are too much and not really useful. I'd leave it the way it is.Please elaborate, as to how cities are too much and not really useful. Because I'm pretty lost, as to what you're trying to say. To explain my point again though, just incase you didn't understand. As mentioned, by myself and others, there is currently no way to go from the Nation API to the City API, without manually looking up City IDs ingame yourself. All I asked for, was a simple quality of life change, so that the API flowed a bit nicer. Quote Link to comment Share on other sites More sharing options...
Dan77 Posted June 24, 2015 Share Posted June 24, 2015 (edited) Nation API is great for looking up individual players. Is there a database with all players in though? It would be nice to be able to have a tool where you could select criteria (e.g. alliance, active in 24hrs/3 days/7 days/etc, score range, nuclear weapons capability, etc) and generate a list with the stats of every nation that meet the criteria. If this could then be exported to a .csv file then it would be awesome. Leaving the filters blank would give you all nations in the game. This is something that used to be available in the game Mensa members used to play until the idiot admins abandoned the API. The tools were created by users but the citizen feed as it was known was a part of the API. It might have to run off a single database that is autmatically updated at a set time once a day though rather than being live, as lots of people requesting live info would cause issues. It would save a lot of trauling through individual nation pages to find the info you want. Is this something that's achievable? Edited June 24, 2015 by Dan77 Quote Link to comment Share on other sites More sharing options...
Dwynn Posted June 26, 2015 Share Posted June 26, 2015 The only thing that worries me about having everything accessible by API is the amount of automation that people will be able to create. With the PW.Tools everything requires user interaction. What's being asked for is already achievable (I already store all nations and city information once a day), but having it all API accessible just begs for people to automate a lot of processes. Quote He's right, I'm such a stinker. Play my exceptional game! Link to comment Share on other sites More sharing options...
Shakyr Posted June 26, 2015 Share Posted June 26, 2015 (edited) The only thing that worries me about having everything accessible by API is the amount of automation that people will be able to create. With the PW.Tools everything requires user interaction. What's being asked for is already achievable (I already store all nations and city information once a day), but having it all API accessible just begs for people to automate a lot of processes.Having Nation/City/War/Trade information available via API, means that it is readily accessible to more people, without them having to scrape and parse the website. Which requires some pretty specific knowledge and skills. I should know, I taught myself how to scrape Nation/Alliance/Trade screens, for a certain other game. I've actually been waiting for the API, before I do any large coding projects for PnW, simply because scraping and parsing webpages is resource intensive. There is precedent already, for putting limits on some types of scripting, with the current bans on Market Trading. So I don't see an issue there. Plus, the API is read only. So not like you'll be able to automate running a nation, using it. Tools may make recommendations, but the user will still have to login and make the changes to their nation, themselves. Edited June 26, 2015 by Shakyr Quote Link to comment Share on other sites More sharing options...
Dwynn Posted June 26, 2015 Share Posted June 26, 2015 Having Nation/City/War/Trade information available via API, means that it is readily accessible to more people, without them having to scrape and parse the website. Which requires some pretty specific knowledge and skills. I should know, I taught myself how to scrape Nation/Alliance/Trade screens, for a certain other game. I've actually been waiting for the API, before I do any large coding projects for PnW, simply because scraping and parsing webpages is resource intensive. There is precedent already, for putting limits on some types of scripting, with the current bans on Market Trading. So I don't see an issue there. Plus, the API is read only. So not like you'll be able to automate running a nation, using it. Tools may make recommendations, but the user will still have to login and make the changes to their nation, themselves. Lastly, your website is not the only way to go about displaying/caching the information and other people have other ideas. They are perfectly within their rights, to write their own tools, within the limits set by Sheepy. I'm quite aware that it's not, nor was I insinuating it should be. I'm merely raising the thought to Sheepy to make sure that he has limits in place for automation. he didn't have it in place or protection from trading for a while and it got abused quite a bit. Quote He's right, I'm such a stinker. Play my exceptional game! Link to comment Share on other sites More sharing options...
Shakyr Posted June 26, 2015 Share Posted June 26, 2015 I'm quite aware that it's not, nor was I insinuating it should be. I'm merely raising the thought to Sheepy to make sure that he has limits in place for automation. he didn't have it in place or protection from trading for a while and it got abused quite a bit.Retracted my comment. Was a misread. I do agree that limits should be put in place, like requests per timeframe. Though with that, it would be ideal if you could request information about the status of any limits. See https://dev.twitter.com/rest/public/rate-limitingfor example. A "developer" API key, that could be requested from within https://politicsandwar.com/account/or similar, would give a unique way to restrict access to the API (and better keep track, of who is making requests). Restricted to one per nation, of course (and lost if the nation is deleted). Quote Link to comment Share on other sites More sharing options...
dmjohnston Posted June 26, 2015 Share Posted June 26, 2015 I'm not sure why everyone is against automation >.> For me, one of the best parts about eRepublik was developing tools with the API and later the scraper that replaced it when their developers shit the bed. There is always someone who can make the data public enough to allow automation, so why not make it easily accessible for all and level the playing field? Quote ☾☆ Priest of Dio º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ ¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸ ¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸ ¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ Link to comment Share on other sites More sharing options...
Yosodog Posted July 2, 2015 Share Posted July 2, 2015 (edited) In the alliance page, the alliance color doesn't have quotes around the color name. I was smashing my head for a while wondering why it wouldn't work but the nation page works. Edited July 2, 2015 by Yosodog 1 Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
dmjohnston Posted July 4, 2015 Share Posted July 4, 2015 In the alliance page, the alliance color doesn't have quotes around the color name. I was smashing my head for a while wondering why it wouldn't work but the nation page works. I read this and then completely forgot about it when I was trying to parse alliance data. Sheepy, please fix. Quote ☾☆ Priest of Dio º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ ¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸ ¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸ ¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ Link to comment Share on other sites More sharing options...
dmjohnston Posted July 5, 2015 Share Posted July 5, 2015 Just so all tracking the thread are aware, the alliance feed issue has been fixed. Also, the array of city ID's is live in the nation feed. 1 Quote ☾☆ Priest of Dio º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ ¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸ ¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸ ¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸ 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.