Jump to content

API Discussion


Alex
 Share

Recommended Posts

Getting this "Connect Error (1045) Access denied for user 'martiane_polwar'@'localhost' (using password: YES)"

 

Just as I made my script :'(

[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

Market data api would be fantastic.

☾☆

Priest of Dio

º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸

¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸

¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

Link to comment
Share on other sites

DId not notice we had an somewhat official API now, let me dig up some of my python work on it.

 

I'll update my unrealeased API wrapper for Politics and War (Like I said I would a few months back) and put it up somewhat soon

Edited by Dolphman

2JTFBIP.gif

Leader of UPS

Link to comment
Share on other sites

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.

 

Dont make an API for Requests (ie, cant buy infra with /api/), while automation attempts may be made, Im doubtful they be that advanced

2JTFBIP.gif

Leader of UPS

Link to comment
Share on other sites

Not Fixed. getting the same error

 

Yeah they must've changed the user and password in wake of the exploit and forgot to fix it for the api.

 

I wasn't able to collect stats last night :(

[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

Not sure what's the problem honestly, but there seems to be a few issues with the city api. I pasted the data into here: http://jsonformatter.curiousconcept.com/ and http://jsonlint.com/and there seems to be a few issues but I couldn't tell you what it is :/

Edited by Yosodog

[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

This is nice!

 

Government is spelt goverment I think.

popdensity value or basepopdensity aren't the same as population density in the web ui - something I'm missing here?

 

Population Density is a display figure that is calculated after disease deaths, crime deaths, and city age are factored in. Basepopdensity is the population density used to calculate disease deaths.

 

Any chance of adding the city/project timer to the nation api?

Link to comment
Share on other sites

  • 4 weeks later...

Is there a way to retrieve an alliance by knowing it's name (and not ID)? If not, could we at least get a page that we could access, that is simply an array of "Alliance Name" => ID?

 

EDIT: Also, there is no way to currently retrieve a list of nation IDs, of all the members in an alliance. This would make the alliance API alot more useful, if this was added.

Edited by Shakyr

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
Guest Frawley

Could we please have a couple of new api pages, they would really help with data collection.

 

Nation List

https://politicsandwar.com/api/nations/

Nation (Ruler, Nation, Alliance, Alliance ID, ID), Colour, Continant, Score, Rank

 

Alliance List

https://politicsandwar.com/api/alliances/

Alliance, Alliance ID, Created, Colour, Continant

 

War List

https://politicsandwar.com/api/world/conflicts/

War ID, Attacker (Ruler, Nation, Alliance, Alliance ID, ID), Defender (Ruler, Nation, Alliance, Alliance ID, ID), Date Started

 

War Detail

https://politicsandwar.com/api/nation/war/timeline/war=67473

Same as above but also a section with Date, Event

 

Embargos

https://politicsandwar.com/api/world/embargoes/

Embargo ID, Initiator Ruler, Initiator Nation, Initiator Alliance, Initiator Alliance ID, Initiator ID, Embargoed Ruler, Embargoed Nation, Embargoed Alliance, Embargoed Alliance ID, Embargoed ID, Date Started, Reason, Active (True/False)

 

Tax Records - Must be logged in to see

https://politicsandwar.com/api/alliance/id=[ALLIANCEID]&display=banktaxes

Timestamp, ID, Notes, Sender(Name, Ruler, ID, Alliance Flag(True/False)), Reciever(Name, Ruler, ID, Alliance Flag(True/False)), Money, Food, Coal, Oil, Uranium, Lead, Iron, Bauxite, Gasoline, Munitions, Steel, Aluminium

 

Bank Records - Must be logged in to see

https://politicsandwar.com/api/alliance/id=[ALLIANCEID]&display=bank

Timestamp, ID, Notes, Sender(Name, Ruler, ID, Alliance Flag(True/False)), Reciever(Name, Ruler, ID, Alliance Flag(True/False)), Money, Food, Coal, Oil, Uranium, Lead, Iron, Bauxite, Gasoline, Munitions, Steel, Aluminium

 

Trade Lists

https://politicsandwar.com/api/nation/trade/display=world

Trade ID, Timestamp, Buy/Sell, Resource ID, Resource Name, PPU, Volume, Offering Nation (Ruler, Name, ID, Alliance, Alliance ID)

Edited by Frawley
Link to comment
Share on other sites

Could we please have a couple of new api pages, they would really help with data collection.

 

Nation List

https://politicsandwar.com/api/nations/

Nation (Ruler, Nation, Alliance, Alliance ID, ID), Colour, Continant, Score, Rank

 

Alliance List

https://politicsandwar.com/api/alliances/

Alliance, Alliance ID, Created, Colour, Continant

 

War List

https://politicsandwar.com/api/world/conflicts/

War ID, Attacker (Ruler, Nation, Alliance, Alliance ID, ID), Defender (Ruler, Nation, Alliance, Alliance ID, ID), Date Started

 

War Detail

https://politicsandwar.com/api/nation/war/timeline/war=67473

Same as above but also a section with Date, Event

 

Embargos

https://politicsandwar.com/api/world/embargoes/

Embargo ID, Initiator Ruler, Initiator Nation, Initiator Alliance, Initiator Alliance ID, Initiator ID, Embargoed Ruler, Embargoed Nation, Embargoed Alliance, Embargoed Alliance ID, Embargoed ID, Date Started, Reason, Active (True/False)

 

Tax Records - Must be logged in to see

https://politicsandwar.com/api/alliance/id=[ALLIANCEID]&display=banktaxes

Timestamp, ID, Notes, Sender(Name, Ruler, ID, Alliance Flag(True/False)), Reciever(Name, Ruler, ID, Alliance Flag(True/False)), Money, Food, Coal, Oil, Uranium, Lead, Iron, Bauxite, Gasoline, Munitions, Steel, Aluminium

 

Bank Records - Must be logged in to see

https://politicsandwar.com/api/alliance/id=[ALLIANCEID]&display=bank

Timestamp, ID, Notes, Sender(Name, Ruler, ID, Alliance Flag(True/False)), Reciever(Name, Ruler, ID, Alliance Flag(True/False)), Money, Food, Coal, Oil, Uranium, Lead, Iron, Bauxite, Gasoline, Munitions, Steel, Aluminium

 

Trade Lists

https://politicsandwar.com/api/nation/trade/display=world

Trade ID, Timestamp, Buy/Sell, Resource ID, Resource Name, PPU, Volume, Offering Nation (Ruler, Name, ID, Alliance, Alliance ID)

 

This would be fantastic

I will take responsibility for what I have done, if I must fall, I will rise each time a better man.

 

 

Link to comment
Share on other sites

Could we please have a couple of new api pages, they would really help with data collection.

 

Nation List

https://politicsandwar.com/api/nations/

Nation (Ruler, Nation, Alliance, Alliance ID, ID), Colour, Continant, Score, Rank

 

Alliance List

https://politicsandwar.com/api/alliances/

Alliance, Alliance ID, Created, Colour, Continant

 

War List

https://politicsandwar.com/api/world/conflicts/

War ID, Attacker (Ruler, Nation, Alliance, Alliance ID, ID), Defender (Ruler, Nation, Alliance, Alliance ID, ID), Date Started

 

War Detail

https://politicsandwar.com/api/nation/war/timeline/war=67473

Same as above but also a section with Date, Event

 

Embargos

https://politicsandwar.com/api/world/embargoes/

Embargo ID, Initiator Ruler, Initiator Nation, Initiator Alliance, Initiator Alliance ID, Initiator ID, Embargoed Ruler, Embargoed Nation, Embargoed Alliance, Embargoed Alliance ID, Embargoed ID, Date Started, Reason, Active (True/False)

 

Tax Records - Must be logged in to see

https://politicsandwar.com/api/alliance/id=[ALLIANCEID]&display=banktaxes

Timestamp, ID, Notes, Sender(Name, Ruler, ID, Alliance Flag(True/False)), Reciever(Name, Ruler, ID, Alliance Flag(True/False)), Money, Food, Coal, Oil, Uranium, Lead, Iron, Bauxite, Gasoline, Munitions, Steel, Aluminium

 

Bank Records - Must be logged in to see

https://politicsandwar.com/api/alliance/id=[ALLIANCEID]&display=bank

Timestamp, ID, Notes, Sender(Name, Ruler, ID, Alliance Flag(True/False)), Reciever(Name, Ruler, ID, Alliance Flag(True/False)), Money, Food, Coal, Oil, Uranium, Lead, Iron, Bauxite, Gasoline, Munitions, Steel, Aluminium

 

Trade Lists

https://politicsandwar.com/api/nation/trade/display=world

Trade ID, Timestamp, Buy/Sell, Resource ID, Resource Name, PPU, Volume, Offering Nation (Ruler, Name, ID, Alliance, Alliance ID)

 

You can already gather all of this without the need for an API, but holy &#33;@#&#036; it would make life so much easier.

[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

Alliance list alone would be fantastic. Also market data.

 

Sheepy and Malone, is there any intention to add to this? It's been a while since we've seen anything new on this front despite a lot of suggestions.

☾☆

Priest of Dio

º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸

¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸

¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I've just noticed today, that errors are now in json format. Nice change.

 

Old Errors:

Nation doesn't exist.

New Errors:

{

"error": "Nation doesn't exist."

}

Guess I'll be having fun tonight updating scripts, to recognise the new format.

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 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.