NATION

PASSWORD

Card queries [season 3 queries available]

The place to wheel and deal, talk shop, and build up your dream deck!
User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Card queries [season 3 queries available]

Postby The Northern Light » Sun Aug 04, 2019 1:47 am


Card Queries


Image

TL;DR: Easily search through all 350 thousand cards using the card queries and advanced card queries pages!

What is this?

Have you ever wondered how many cards there are in The North Pacific? How many of them are legendary, epic, or ultra-rare? Or how many of them have golden badges?

Have you ever wanted to embark on collecting these sorts of cards, only to realize you do not even know which cards you need to collect? And how could you know - there are, after all, more than 350 thousand cards in both seasons, making it practically impossible to go through them one by one.

Card queries are here to help!

To help you answer these questions, be it to satisfy your curiosity, plan your collections, or for any other reason, we created the card queries and advanced card queries pages.

These pages make it easy to parse the official XML list of cards. For example, to get all the cards of The North Pacific, with the WA badge but without the delegate badge, and of uncommon rarity, you can open the card queries page, and enter the query:
+region:the_north_pacific, +badge:wa, -badge:delegate, +rarity:uncommon
Upon clicking "submit", you will be provided with a list (IDs, names, and links) of the cards satisfying the above criteria. And that's it!

How do I use the card queries pages?

Both the card queries and advanced card queries pages include detailed use instructions. The pages also list all of the options you can use to search for cards. These include, among other things, badges, rarities, regions, trophies, and many more!

You can combine these options to form more complicated queries. Additionally, you can search for cards of either season. Finally, you can select from among a few different formatting options for the results, depending on what is the most convenient for you.

How is the advanced card queries page different?

Compared to the original version, the advanced card queries page allows making more complicated queries. In particular, whereas the original version allows only doing conjunctions (logical AND) between different (potentially negated, i.e., logical NOT) options, the advanced version allows using arbitrary combinations of disjunctions (logical OR) and conjunctions.

For example, using the advanced version, you can do a query of the form: "cards that have The North Pacific as region, and have either badge 'Admin' or badge 'Moderator'." Using the original version, this requires doing two queries, one for "cards that have The North Pacific as region, and have badge 'Admin'", another for "cards that have The North Pacific as region, and have badge 'Moderator'", and then manually merging the results from the two queries.

You can also use the advanced version to combine the decks of multiple puppets (use an OR to combine deck options), implement exclusive OR (XOR) operations (e.g., "cards that have either badge 'Admin' or badge 'WA', but not both), and so on. See this page for inspiration.

Please note that the card queries and advanced card queries pages use different syntax.

Which version should I use?

That is up to you to decide. The card queries uses (arguably) simpler syntax, very similar to the one used by NationStates for telegramming multiple nations. The advanced card queries page can do everything the simpler version can, and a lot more; but it uses (arguably) more complicated syntax.

You are welcome to use whichever version you prefer. You also do not have to commit to just one or the other version: both will remain available and you are welcome to switch back and forth as you like.

Can I call the card queries from my scripts?

Yes, you can! You can directly send GET requests to the daemon serving the advanced card queries page. Here is an example GET request using cURL:
Code: Select all
curl -G 'https://azure.nsr3n.info/card_queries/get_daemon_advanced.sh' -d 'format=json&season=2' --data-urlencode 'query=region:the_north_pacific'

As with the regular page, you can specify your preferred output format, e.g., you can download the results directly in JSON output. Note that you need to use url-encoding for the "query" field of the GET request, because of the special characters it contains.

There are currently no hard-enforced rate limits for using the advanced card queries through scripts. However, please be reasonable and do not submit very large numbers of requests in short time intervals.

What if I still have questions?

For any questions or comments, including requests for additional features or bug reports, please post in this thread (preferable) or send a telegram to The Northern Light.

P.S. Many thanks to Ballotonia for making the official XML list of cards available!

[Dispatch version]
Last edited by The Northern Light on Wed Nov 30, 2022 11:04 pm, edited 19 times in total.
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
9003
Diplomat
 
Posts: 624
Founded: Oct 25, 2012
Corporate Police State

Postby 9003 » Sun Aug 04, 2019 7:30 am

Thanks for this super helpful
proud member of PETZ people for the Ethical Treatment of Zombies

Active member of The cards market place discord

User avatar
SherpDaWerp
Technical Moderator
 
Posts: 1895
Founded: Mar 02, 2016
Benevolent Dictatorship

Postby SherpDaWerp » Mon Aug 05, 2019 1:07 am

Quick issue: querying
Code: Select all
+badge:Issues Author
retrieves only nations with "Issues Author", and not "Issues Author (x2)", and so on. And then you can't actually query
Code: Select all
+badge:Issues Author (x2)
which might be something to do with the brackets? Point being, there's no way to search for people who have authored more than one issue.
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Mon Aug 05, 2019 1:13 am

Thanks. It should be fixed now. Searching for "Issues author" should get you everyone with that badge, regardless of number of issues they've authored.

The same problem used to affect the various WA authorship categories, those should be fixed as well.
Last edited by The Northern Light on Mon Aug 05, 2019 1:16 am, edited 2 times in total.
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
Philomathia
Secretary
 
Posts: 33
Founded: Feb 15, 2017
Ex-Nation

Postby Philomathia » Mon Aug 05, 2019 9:11 pm

What are categories? Is that going to be something like all car cards or anime cards etc?
Last edited by Philomathia on Mon Aug 05, 2019 9:12 pm, edited 1 time in total.

User avatar
Ter Voland
Secretary
 
Posts: 38
Founded: Feb 14, 2018
Right-wing Utopia

Postby Ter Voland » Tue Aug 06, 2019 9:38 am

Philomathia wrote:What are categories? Is that going to be something like all car cards or anime cards etc?

Category is what kind of nation it is, like left wing utopia, inoffensive centrist democracy, etc. You have to use underscores instead of spaces for the query. An example would be +category:capitalist_paradise. Don't include the period. I doubt car or anime cards would be a category because they're not a built in option like left wing utopia.
Last edited by Ter Voland on Tue Aug 06, 2019 9:57 am, edited 3 times in total.

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Tue Aug 06, 2019 12:55 pm

Ter Voland wrote:You have to use underscores instead of spaces for the query.

Just a note that this is not necessary. The page should give correct results regardless of capitalization and spaces vs underscores (in fact, you can also mix spaces and underscores if you want).
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
Ter Voland
Secretary
 
Posts: 38
Founded: Feb 14, 2018
Right-wing Utopia

Postby Ter Voland » Tue Aug 06, 2019 1:57 pm

The Northern Light wrote:
Ter Voland wrote:You have to use underscores instead of spaces for the query.

Just a note that this is not necessary. The page should give correct results regardless of capitalization and spaces vs underscores (in fact, you can also mix spaces and underscores if you want).

Ah ok. I just assumed that spaces wouldn't work.

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Sat Aug 10, 2019 4:13 am

The card queries page has been updated to allow searching cards by trophies, either their type, or rank, or both. See the page for instructions.

I've also made queries faster, so some that used to require around 10 seconds should now be done in less than a second.
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
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Sun Aug 25, 2019 4:28 pm

The card queries page has been updated to include both card IDs and names in the results.

The results are still sorted by card ID.

As always, all comments are welcome.
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
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Sat Sep 07, 2019 5:51 pm

The card queries page has been updated to allow searching cards based on whether their name includes or does not include a query string.
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
Nopspri
Attaché
 
Posts: 71
Founded: Jul 30, 2012
Ex-Nation

Postby Nopspri » Sat Sep 14, 2019 8:05 pm

What would I put in to find a specific exnation card?

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Sun Sep 15, 2019 2:32 pm

It depends. What information do you have about the nation?

For example, if you remember that the nation's name contains the string NAMESTRING, you can do:

Code: Select all
+exnation, +name:NAMESTRING
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
Nopspri
Attaché
 
Posts: 71
Founded: Jul 30, 2012
Ex-Nation

Postby Nopspri » Thu Sep 19, 2019 9:32 am

Thanks!

User avatar
Aclion
Negotiator
 
Posts: 6249
Founded: Apr 12, 2016
Ex-Nation

Postby Aclion » Fri Sep 20, 2019 7:54 pm

Thanks. This will be very useful when season two comes out and I have to collect 300 nation's cards >.<
A popular Government, without popular information, or the means of acquiring it, is but a Prologue to a Farce or a Tragedy; or, perhaps both. - James Madison.

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Fri Nov 29, 2019 3:41 pm

The card queries page has been updated to allow searching by motto and flag.

For example, here are all the cards with .gif flags:

http://azure.nsr3n.info/card_queries/ge ... mit=submit


We also wanted to mention that the page will be updated to allow searching for season 2 cards as soon as the new cardlist XML file is made available (admins mentioned that this will be a few days after Season 2 begins). Until then, we will make a list that allows searching Season 2 cards by rarity only, likely after tonight's major update.

UPDATE: Unfortunately, tonight's nation dump contains rarity information only for season 1. Therefore, the season 2 update to the card queries page will need to wait till season 2 officially begins.
Last edited by The Northern Light on Sat Nov 30, 2019 12:14 am, edited 2 times in total.
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
N7eternia
Envoy
 
Posts: 254
Founded: Feb 20, 2019
Ex-Nation

Postby N7eternia » Tue Dec 03, 2019 10:19 pm

Thank you for this.

Who designed the template for these cards?

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Thu Dec 05, 2019 9:34 am

The game administrators can answer this question (I assume it's one or more of them).

The card queries page will be updated as soon as the Season 2 cardlist.xml file is made available by the administrators. This will likely happen this weekend.

In the meantime, the following link has some preliminary lists of cards by rarity. Note that these are not 100% accurate, for reasons explained in the page. I am posting them here in case they are of use to people planning their S2 collections:

Preliminary list of Season 2 cards by rarity

This is now deprecated. Please use the updated card queries page.
Last edited by The Northern Light on Sat Dec 07, 2019 6:17 pm, edited 3 times in total.
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
Assyrania
Lobbyist
 
Posts: 18
Founded: Mar 29, 2019
Ex-Nation

Postby Assyrania » Fri Dec 06, 2019 9:45 pm

This page is really nice. I can't open .xml files, so a big thanks for making this available.
I hope the S2 .xml files come out sooner.

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Sat Dec 07, 2019 2:12 pm

The card queries page has been updated to support queries of season 2 cards.

Currently, you can search the season 1 or season 2 list, but not both at the same time --- you will need to do two separate queries, one for each season.

If for whatever reason you think having mixed-season queries would be useful, please post here.

The preliminary lists in our previous post have now been disabled, to make sure nations do not continue to use incorrect information.
Last edited by The Northern Light on Sat Dec 07, 2019 6:14 pm, edited 1 time in total.
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
Recuecn
Ambassador
 
Posts: 1049
Founded: Feb 02, 2015
New York Times Democracy

Postby Recuecn » Sat Dec 07, 2019 5:26 pm

The Northern Light wrote:If for whatever reason you think having mixed-season queries, please post here.[/size]

Did you mean 'if you think having mixed-season queries would be nice, please say so?" Because I do think so.
rəswɛsən

User avatar
Toerana
Envoy
 
Posts: 297
Founded: Nov 27, 2018
Left-Leaning College State

Postby Toerana » Sun Dec 08, 2019 4:34 am

Yay S2, I can finally place lots of bits on cards of different regions without having to track down all the nations that may have left the region! xD

User avatar
The Northern Light
Spokesperson
 
Posts: 156
Founded: Oct 10, 2014
Iron Fist Consumerists

Postby The Northern Light » Sun Dec 08, 2019 6:47 pm

Recuecn wrote:Did you mean 'if you think having mixed-season queries would be nice, please say so?" Because I do think so.

Is it simply a matter of not having to do two queries, one for each season? Or is there a more compelling reason for it?

I can try and enable it, but it's somewhat more complicated than other features. So, I am trying to understand why people need it, in order to prioritize my TODO list.


Also, the spoiler in the OP mentions that the queries page supports GET requests. Admittedly, the response formatting right now is awful. I am considering updating the page to support JSON or XML formatting (analogous to the NS API).

But before I commit the time to doing so, I wanted to check first: Is anyone actually using this option?
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
Recuecn
Ambassador
 
Posts: 1049
Founded: Feb 02, 2015
New York Times Democracy

Postby Recuecn » Mon Dec 09, 2019 12:51 am

The Northern Light wrote:
Recuecn wrote:Did you mean 'if you think having mixed-season queries would be nice, please say so?" Because I do think so.

Is it simply a matter of not having to do two queries, one for each season? Or is there a more compelling reason for it?

I can try and enable it, but it's somewhat more complicated than other features. So, I am trying to understand why people need it, in order to prioritize my TODO list.


Also, the spoiler in the OP mentions that the queries page supports GET requests. Admittedly, the response formatting right now is awful. I am considering updating the page to support JSON or XML formatting (analogous to the NS API).

But before I commit the time to doing so, I wanted to check first: Is anyone actually using this option?

Yeah I don't really have a very compelling reason besides "it would be easier". Super easy to see all legendary cards next to each other, for example. But yeah, it is as simple as doing a second query, so if it's more work, by all means leave it at the bottom of your to-do list.

As to the second point, I don't use the GET request function but I'm probably not the target user for that, given I don't even know what that means.
rəswɛsən

User avatar
Warzone Codger
Ambassador
 
Posts: 1061
Founded: Oct 30, 2010
Iron Fist Consumerists

Postby Warzone Codger » Mon Dec 09, 2019 1:19 pm

The Northern Light wrote:
If for whatever reason you think having mixed-season queries would be useful, please post here.



Would this allow searching for cards which has been promoted or demoted between seasons? Or those who have lost or gained a badge or trophy?
Warwick Z Codger the Warzone Codger.
Warzone Pioneer | Peacezone Philosopher | Scourge of Polls | Forever Terror Officer of TRR
GA #121: Medical Facilities Protection | SC #183: Commend Haiku | Commended by SC #87: Commend Warzone Codger

Next

Advertisement

Remove ads

Return to Trading Cards

Who is online

Users browsing this forum: Comfed, Rushkaville, Triseria

Advertisement

Remove ads