NATION

PASSWORD

NationStates API (nationdata/regiondata)

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.

Advertisement

Remove ads

User avatar
Ballotonia
Site Admin
 
Posts: 5431
Founded: Antiquity
New York Times Democracy

Postby Ballotonia » Fri Jul 03, 2020 5:18 am

The Northern Light wrote:Request

Would it be possible to expand the cards API and include options to retrieve a nation's asks and bids?

Bids in particular would be useful for collectors, who may want to check what cards from a large set they have placed bids on, or to check for bids on cards they already own, etc.

Thank you in advance!


Quick turn-around on this one!

Implemented. Example: https://www.nationstates.net/cgi-bin/ap ... me=carinov
See the API page (Section Cards.4) for the details: https://www.nationstates.net/pages/api.html#cards

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Ballotonia
Site Admin
 
Posts: 5431
Founded: Antiquity
New York Times Democracy

Postby Ballotonia » Fri Jul 03, 2020 5:47 am

Aurum Raider wrote:Would it be possible to alter the "CATEGORY" field on the cards API to "CARDCATEGORY", and "CARDID" to "ID"?
In it's present form, the output from the API is incongruent with the data dumps.

EDIT: I'm referring specifically to the decklist provided by "cards+deck;nationname="


While I do enjoy consistency, this would break the scripts of all current users. I think this is manageable on user-side.

Akragas wrote:Hi all, I am a compete beginner to the API so my apologies in advance if what I am asking is overly simple.

The specific stat I’d like to know about is total number of issues answered (I looked up in the documentation but couldn’t find a relevant shard); I would presume this is kept track of somewhere since there exist banners for reaching specific milestones. Thanks for any help!


Added to the Nation API: ISSUES_ANSWERED. See for example: https://www.nationstates.net/cgi-bin/ap ... testlandia

Note that this only keeps track of all issues answered since back when this counter was added. Especially older nations will find a lower value than what really happened. It's been quite some years already though, so by far most nations will have the right value.

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
Ballotonia
Site Admin
 
Posts: 5431
Founded: Antiquity
New York Times Democracy

Postby Ballotonia » Fri Jul 03, 2020 6:16 am

The Northern Light wrote:Feature request:

Would it be possible to add an option to the cards API to list the IDs and names of all current collections in a nation's deck?

For example, it could be:

Code: Select all
https://www.nationstates.net/cgi-bin/api.cgi?q=cards+collections;nationname=testlandia


Ideally it could be combined with deck and info:

Code: Select all
https://www.nationstates.net/cgi-bin/api.cgi?q=cards+info+deck+collections;nationname=testlandia


One downside of my example proposal that you may want to take into account is that the syntax is very similar to the "+collection" option for listing the contents of a specific collection. Feel free to use some other syntax.

Thanks in advance!


Implemented as suggested. I know the singular/plural is similar, but this is not the first time we've had that. Since I don't see these two being used within the same call, it's OK.

Example: https://www.nationstates.net/cgi-bin/ap ... ationid=38

Ballotonia
"Een volk dat voor tirannen zwicht zal meer dan lijf en goed verliezen, dan dooft het licht…" -- H.M. van Randwijk

User avatar
The Northern Light
Spokesperson
 
Posts: 130
Founded: Oct 10, 2014
Moralistic Democracy

Postby The Northern Light » Fri Jul 03, 2020 3:32 pm

Thanks for all these new features!
Home of the WADP, Planet Eras, and the Constibillocode!
Join The North Pacific!
Where the democracy is strong, the debate robust, and the rum plentiful!

Forum | Discord Chat | Citizenship | Executive Staff | North Pacific Army | World Assembly Ministry | Roleplay | Trading Cards | Handbook

User avatar
HN67
Political Columnist
 
Posts: 3
Founded: Mar 11, 2015
Liberal Democratic Socialists

API Feature Request

Postby HN67 » Fri Jul 10, 2020 7:31 pm

Would it be possible to add shards to the cards API that shows the sales/buys of a nation, (i.e. https://www.nationstates.net/page=deck/ ... ades=sales and https://www.nationstates.net/page=deck/show_trades=buys)? similar to the existing askbids shard (e.g. https://www.nationstates.net/cgi-bin/ap ... testlandia), although ideally separate shards. It could use the XML syntax similar to the other trades shards (e.g. https://www.nationstates.net/cgi-bin/ap ... 1;season=1).

This would be useful for summarizing the activity of puppets.

Thanks,
HN67

User avatar
Imperium Anglorum
Powerbroker
 
Posts: 9591
Founded: Aug 26, 2013
Left-Leaning College State

NS API Historical resolutions

Postby Imperium Anglorum » Wed Jul 15, 2020 3:40 pm

The NS API doesn't have NSUN resolutions, I think. I tried with the following links:

https://www.nationstates.net/cgi-bin/ap ... resolution
https://www.nationstates.net/cgi-bin/ap ... resolution

Could it be added (or the specific location be added to the documentation, if already present)?
Last edited by Imperium Anglorum on Wed Jul 15, 2020 3:40 pm, edited 1 time in total.

Author: 1 SC and 34 GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
Toxic villainous globalist kittehs
Delegate for Europe
Elsie Mortimer Wellesley (EMW); OOC unless otherwise indicated
Ideological Bulwark 285, WALL delegate
Dastardly villain providing free services to the community sans remuneration

Previous

Return to Technical

Who is online

Users browsing this forum: Kenmoria, Praeceps

Advertisement

Remove ads