Jump to content

API upgrades, plz


Iteo
 Share

Recommended Posts

1. Colors API, basic info about colors, like the current name, and the boost. This is pretty useful and makes sense

2. Wars API, like the nations API, but a giant list of all the wars, though it should probably be capped at the last 500 wars or smth.

3. Add date created to nations API, This should be on it because I feel it's part of the basic info of a nation, and also helps out a lot

4. Transactions API, you can go on a nations page and see their transactions anyways, so it would be nice if it was in API form, just a big list of all the recent transactions across all nations. I'm about to start a project that would really benefit from this, downloading every nation's bank transaction page and sifting through it will make me want to die xD
5. why not, a UID API, to look for alts during the low-load times a large list of every UID with all the nations under it, yes I know public networks, but I'm sure we can figure something out/

Don't think much else is needed, anything else that's more specific should just be web scraped tbh. I don't mind web scraping for colors API, but it just feels like it should be a thing.

 

1. is just a small utility that just makes sense

2. would be immensely helpful

3. simple enough would be a good alternative to sifting through every player page. 

4. Maybe a little too OP? But the information is already public, and I would love to use it, would simplify managing IA and stuff alot

5. why not :)

  • Upvote 6
Link to comment
Share on other sites

@Iteo

1. Good idea, for now we'll just have to use the HTML table at https://politicsandwar.com/leaderboards/display=color to do this (which is a lot more work than everything else)

2. There is already an API for this (http://politicsandwar.com/api/wars/). I made a list of all the APIs I could find:

 

Alliances
http://politicsandwar.com/api/alliances/

Alliance
http://politicsandwar.com/api/alliance/id= (AA ID)

Alliance Bank
http://politicsandwar.com/api/alliance-bank/?allianceid= (AA ID) &key= (API key)

Alliance Members
http://politicsandwar.com/api/alliance-members/?allianceid= (AA ID) &key= (API key)

Alliance Applicants
http://politicsandwar.com/api/applicants/ (AA ID)

Nations:
http://politicsandwar.com/api/nations/

Nation
http://politicsandwar.com/api/nation/id= (nation ID)

Wars
http://politicsandwar.com/api/wars/

War
http://politicsandwar.com/api/war/ (war ID)

City
http://politicsandwar.com/api/city/id= (city ID)

Tradeprice
http://politicsandwar.com/api/tradeprice/resource= (resource name)

 

3. imo it's not that important, but the nations API could do with a change just not sure what...

4. This has been brought up before I think, it would probably be a great help.

5. If you need something like this, maybe you only need Unique IDs for nations in an alliance (especially applicants). Try doing that instead of all nations.

  • Like 1
Link to comment
Share on other sites

1 minute ago, John Smith said:

@Iteo

1. Good idea, for now we'll just have to use the HTML table at https://politicsandwar.com/leaderboards/display=color to do this (which is a lot more work than everything else)

2. There is already an API for this (http://politicsandwar.com/api/wars/). I made a list of all the APIs I could find:

 

Alliances
http://politicsandwar.com/api/alliances/

Alliance
http://politicsandwar.com/api/alliance/id= (AA ID)

Alliance Bank
http://politicsandwar.com/api/alliance-bank/?allianceid= (AA ID) &key= (API key)

Alliance Members
http://politicsandwar.com/api/alliance-members/?allianceid= (AA ID) &key= (API key)

Alliance Applicants
http://politicsandwar.com/api/applicants/ (AA ID)

Nations:
http://politicsandwar.com/api/nations/

Nation
http://politicsandwar.com/api/nation/id= (nation ID)

Wars
http://politicsandwar.com/api/wars/

War
http://politicsandwar.com/api/war/ (war ID)

City
http://politicsandwar.com/api/city/id= (city ID)

Tradeprice
http://politicsandwar.com/api/tradeprice/resource= (resource name)

 

3. imo it's not that important, but the nations API could do with a change just not sure what...

4. This has been brought up before I think, it would probably be a great help.

5. If you need something like this, maybe you only need Unique IDs for nations in an alliance (especially applicants). Try doing that instead of all nations.

Oh, woah thanks for all the API links :) The wiki really does need to be updated lol.

But for 3. I'd help with finding noobs to message xD, finding experienced players and also more simple info as buffer so your results page doesn't look so bland

Link to comment
Share on other sites

2 minutes ago, Kim Jong Un IIIV said:

Hey,

Going to bud in here: could you add an output in the nations API that allows us to view other nations attributed by the unique ID?

nah, too much extra text, every nation having another attribute would be extra, we could just have a list of each UID and all the nations under it.

Link to comment
Share on other sites

23 hours ago, Iteo said:

one more suggestion, big list of all nation ids, just a list of nation ids, nothing else.

This is unneeded. It's indeed not hard to build... but why? Just cycle over the array in Nations API.

Edited by Columbus Griffin
Link to comment
Share on other sites

There should be a city manager API so you can get all improvements in a nation without having to do separate API requests for each city, or web scraping the city manager page.

Also some other minor suggestions (these might be a bit too specific):

  • include a list of battles in the war api
  • include the score change graph in the nation api
  • Upvote 1
Link to comment
Share on other sites

On 9/11/2018 at 8:18 AM, Erland said:

There should be a city manager API so you can get all improvements in a nation without having to do separate API requests for each city, or web scraping the city manager page.

Also some other minor suggestions (these might be a bit too specific):

  • include a list of battles in the war api
  • include the score change graph in the nation api

Agreed for the city manager. This would vastly speed up my current system in-place that pulls all my alliance cities. Or just convert the individual cities into just the city manager with all relevant info. I doubt most people have much use of only a single city's data rather than all the cities in a nation.

  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...
On 9/14/2018 at 6:12 PM, Valdoroth said:

Agreed for the city manager. This would vastly speed up my current system in-place that pulls all my alliance cities. Or just convert the individual cities into just the city manager with all relevant info. I doubt most people have much use of only a single city's data rather than all the cities in a nation.

I think we should just have cities api in general, list of all cities and some basic stats. graph is a little too much to put 1 api request same for battles

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.