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
New Rogernomics
Powerbroker
 
Posts: 9509
Founded: Aug 22, 2006
Left-wing Utopia

Postby New Rogernomics » Mon Sep 02, 2019 9:31 am

Hey there, I have a two part question, if this is the right place to ask this.

I have been learning more about how the Nationstates Telegram API is implemented, and I have a question concerning this.

If a nation is a founder in a UCR, or the delegate of a GCR, and they allow nation X to get the API key for recruiting, and nation X CTEs, does that only API key become open to nation Y to acquire the key?
Herald (Vice-Delegate) of Lazarus
"Solidarity forever..."
Hoping for Peace in Israel and Palestine
  • Former First Citizen (PM) of Lazarus
  • Former Proedroi (Minister) of Foreign Affairs of Lazarus
  • Former Lazarus Delegate (Humane Republic of Lazarus, 2015)
  • Minister of Culture & Media (Humane Republic of Lazarus)
  • Foreign Minister of The Ascendancy (RIP, and purged)
  • Senator of The Ascendancy (RIP, and purged)
  • Interior Commissioner of Lazarus (Pre-People's Republic of Lazarus)
  • At some point a member of the Grey family...then father vanished...
  • Foreign Minister of The Last Kingdom (RIP)
  • ADN:DSA Rep for Eastern Roman Empire
  • Honoratus Servant of the Holy Land (Eastern Roman Empire)
  • UN/WA Delegate of Trans Atlantice (RIP)

User avatar
Phydios
Minister
 
Posts: 2568
Founded: Dec 06, 2014
Left-Leaning College State

Postby Phydios » Mon Sep 02, 2019 10:06 am

New Rogernomics wrote:Hey there, I have a two part question, if this is the right place to ask this.

I have been learning more about how the Nationstates Telegram API is implemented, and I have a question concerning this.

If a nation is a founder in a UCR, or the delegate of a GCR, and they allow nation X to get the API key for recruiting, and nation X CTEs, does that only API key become open to nation Y to acquire the key?

API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.
If you claim to be religious but don’t control your tongue, you are fooling yourself, and your religion is worthless. Pure and genuine religion in the sight of God the Father means caring for orphans and widows in their distress and refusing to let the world corrupt you. | Not everyone who calls out to me, ‘Lord! Lord!’ will enter the Kingdom of Heaven. Only those who actually do the will of my Father in heaven will enter. On judgment day many will say to me, ‘Lord! Lord! We prophesied in your name and cast out demons in your name and performed many miracles in your name.’ But I will reply, ‘I never knew you. Get away from me, you who break God’s laws.’
James 1:26-27, Matthew 7:21-23

User avatar
New Rogernomics
Powerbroker
 
Posts: 9509
Founded: Aug 22, 2006
Left-wing Utopia

Postby New Rogernomics » Mon Sep 02, 2019 4:40 pm

Phydios wrote:
New Rogernomics wrote:Hey there, I have a two part question, if this is the right place to ask this.

I have been learning more about how the Nationstates Telegram API is implemented, and I have a question concerning this.

If a nation is a founder in a UCR, or the delegate of a GCR, and they allow nation X to get the API key for recruiting, and nation X CTEs, does that only API key become open to nation Y to acquire the key?

API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.
That is not correct apparently. There is only one key per region. If you don't know the key or have access to it, then no other nation can use it. A good example would be where a regional officer nation or a founder acquires the key, and then CTEs.
Last edited by New Rogernomics on Mon Sep 02, 2019 4:42 pm, edited 1 time in total.
Herald (Vice-Delegate) of Lazarus
"Solidarity forever..."
Hoping for Peace in Israel and Palestine
  • Former First Citizen (PM) of Lazarus
  • Former Proedroi (Minister) of Foreign Affairs of Lazarus
  • Former Lazarus Delegate (Humane Republic of Lazarus, 2015)
  • Minister of Culture & Media (Humane Republic of Lazarus)
  • Foreign Minister of The Ascendancy (RIP, and purged)
  • Senator of The Ascendancy (RIP, and purged)
  • Interior Commissioner of Lazarus (Pre-People's Republic of Lazarus)
  • At some point a member of the Grey family...then father vanished...
  • Foreign Minister of The Last Kingdom (RIP)
  • ADN:DSA Rep for Eastern Roman Empire
  • Honoratus Servant of the Holy Land (Eastern Roman Empire)
  • UN/WA Delegate of Trans Atlantice (RIP)

User avatar
Frisbeeteria
Senior Game Moderator
 
Posts: 27796
Founded: Dec 16, 2003
Capitalizt

Postby Frisbeeteria » Mon Sep 02, 2019 5:18 pm

Phydios wrote:API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.

There's a lot wrong with this statement. Keys are tied to a region, but a single nation is considered 'responsible' for it. If another nation misuses the key, the responsible nation could get a warning. Sharing a key requires a fair bit of trust.

Also, "any time that no one else is using it" is misleading. Multiple nations can use the same key simultaneously - it's just pointless. The rate limit applies to the key rather than the nation, so every recruiter after the first will probably bounce 100% of their attempts.

New Rogernomics wrote:A good example would be where a regional officer nation or a founder acquires the key, and then CTEs.

In such cases, a Getting Help Request can get the old key deactivated and a new key issued. Same if the old recruiter nation moved to a new region. Unfortunately, it's not the same for living-but-inactive recruiter nations. We won't reissue the key if the nation is alive and still in the region.

New Rogernomics wrote: does that only API key become open to nation Y to acquire the key?

We'd issue a different key, cancelling the old one.

User avatar
New Rogernomics
Powerbroker
 
Posts: 9509
Founded: Aug 22, 2006
Left-wing Utopia

Postby New Rogernomics » Mon Sep 02, 2019 7:09 pm

Okay I get how it works now.

I had thought it would be a bit odd if a key could get lost forever.

Thanks for explaining it.
Herald (Vice-Delegate) of Lazarus
"Solidarity forever..."
Hoping for Peace in Israel and Palestine
  • Former First Citizen (PM) of Lazarus
  • Former Proedroi (Minister) of Foreign Affairs of Lazarus
  • Former Lazarus Delegate (Humane Republic of Lazarus, 2015)
  • Minister of Culture & Media (Humane Republic of Lazarus)
  • Foreign Minister of The Ascendancy (RIP, and purged)
  • Senator of The Ascendancy (RIP, and purged)
  • Interior Commissioner of Lazarus (Pre-People's Republic of Lazarus)
  • At some point a member of the Grey family...then father vanished...
  • Foreign Minister of The Last Kingdom (RIP)
  • ADN:DSA Rep for Eastern Roman Empire
  • Honoratus Servant of the Holy Land (Eastern Roman Empire)
  • UN/WA Delegate of Trans Atlantice (RIP)

User avatar
Phydios
Minister
 
Posts: 2568
Founded: Dec 06, 2014
Left-Leaning College State

Postby Phydios » Mon Sep 02, 2019 8:43 pm

Frisbeeteria wrote:
Phydios wrote:API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.

There's a lot wrong with this statement. Keys are tied to a region, but a single nation is considered 'responsible' for it. If another nation misuses the key, the responsible nation could get a warning. Sharing a key requires a fair bit of trust.

Also, "any time that no one else is using it" is misleading. Multiple nations can use the same key simultaneously - it's just pointless. The rate limit applies to the key rather than the nation, so every recruiter after the first will probably bounce 100% of their attempts.

New Rogernomics wrote:A good example would be where a regional officer nation or a founder acquires the key, and then CTEs.

In such cases, a Getting Help Request can get the old key deactivated and a new key issued. Same if the old recruiter nation moved to a new region. Unfortunately, it's not the same for living-but-inactive recruiter nations. We won't reissue the key if the nation is alive and still in the region.

New Rogernomics wrote: does that only API key become open to nation Y to acquire the key?

We'd issue a different key, cancelling the old one.

Got it. Thanks for the clarification. I was going off my own experience with the Telegram API.
If you claim to be religious but don’t control your tongue, you are fooling yourself, and your religion is worthless. Pure and genuine religion in the sight of God the Father means caring for orphans and widows in their distress and refusing to let the world corrupt you. | Not everyone who calls out to me, ‘Lord! Lord!’ will enter the Kingdom of Heaven. Only those who actually do the will of my Father in heaven will enter. On judgment day many will say to me, ‘Lord! Lord! We prophesied in your name and cast out demons in your name and performed many miracles in your name.’ But I will reply, ‘I never knew you. Get away from me, you who break God’s laws.’
James 1:26-27, Matthew 7:21-23

User avatar
Minoa
Negotiator
 
Posts: 6074
Founded: Oct 05, 2011
Civil Rights Lovefest

Postby Minoa » Thu Sep 26, 2019 6:59 am

Regarding: https://www.nationstates.net/cgi-bin/ap ... ction;id=1

Hello, I wish to ask if there is a way to combine queries for N-Day faction data… strikes, stockpiled nukes and all that? For example, https://www.nationstates.net/cgi-bin/ap ... ;id=1;id=2 doesn't work.

Best,

-- Minoa
Last edited by Minoa on Thu Sep 26, 2019 7:00 am, edited 2 times in total.
Mme A. d'Oiseau, B.A. (State of Minoa)

User avatar
RantSpot
Secretary
 
Posts: 36
Founded: Feb 15, 2010
New York Times Democracy

Postby RantSpot » Thu Sep 26, 2019 12:15 pm

I saw requests by The Northern Light for some card API shards back in January and March. Was there ever any decision on that? It makes sense for cards to only be generated by manual website issue answers and not API, but all the other card game features e.g. buying, auctioning, valuing could be handled by API, and other rich applications could be built for the marketplace.

User avatar
Minoa
Negotiator
 
Posts: 6074
Founded: Oct 05, 2011
Civil Rights Lovefest

Postby Minoa » Fri Sep 27, 2019 4:53 am

Source: https://www.nationstates.net/cgi-bin/ap ... ion;id=246

I have observed that the API is not recording the names of the regions which a faction belongs to, if region in question ceased to exist. I believe that the name of the region should stay as a matter of historical record.

-- Minoa
Mme A. d'Oiseau, B.A. (State of Minoa)

User avatar
Darcania
Envoy
 
Posts: 205
Founded: Dec 29, 2014
Civil Rights Lovefest

Postby Darcania » Sat Nov 02, 2019 2:33 pm

Could it be made possible to have a private nation API shard to apply to (not join, just apply to) the World Assembly?

User avatar
Flanderlion
Minister
 
Posts: 2226
Founded: Nov 25, 2013
Psychotic Dictatorship

Postby Flanderlion » Sun Nov 03, 2019 3:58 am

Darcania wrote:Could it be made possible to have a private nation API shard to apply to (not join, just apply to) the World Assembly?

I would assume that it would still be illegal to use a script to apply to join the WA. Admins replied multiple times re that until finally it was settled my script for it was illegal as it was generating a happening other that my nation page. Wasn't 100% on the logic from it, but they've got the GHR history to go through to see what they said in the past.

If it is legal, yes please, is very helpful for prepping tagging puppets.

Edit: Added missing it.
Edit 2: Was 3, almost 4 years ago, script rules were edited following it. I've only got the replies, not what I sent.
Last edited by Flanderlion on Sun Nov 03, 2019 4:10 am, edited 2 times in total.
As always, I'm representing myself.
Information
Wishlist

User avatar
Valentine Z
Postmaster-General
 
Posts: 13018
Founded: Nov 08, 2015
Scandinavian Liberal Paradise

Postby Valentine Z » Fri Nov 22, 2019 4:56 am

viewtopic.php?p=36459354#p36459354

Cross-posting from my own thread, I recently noticed and realised that there are undocumented (at least on the API Doc itself) ways of getting more precise data for some NS Stats.

For instance, http://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=census&scale=68&mode=score is a well-known and what I have been using to get the stats as they appear on the census. However... https://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=hdi, whereby q=hdi is not mentioned in the public shard section, gives precise HDI values, to several decimal places.

This would explain why as the bigger nations continue to answer issues, their HDI increments at 0.01 on the gameside, but in reality... there are minute changes that are still happening, and eventually, they will round up and give that 0.01.

I wonder if there are precise values for Integrity, Civil Rights, Economy, etc... basically a way to get all these stats' precise results instead of the rounded http://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=census&scale=all&mode=score.
Last edited by Valentine Z on Fri Nov 22, 2019 4:59 am, edited 3 times in total.
Val's Stuff. ♡ ^_^ ♡ For You
If you are reading my sig, I want you to have the best day ever ! You are worth it, do not let anyone get you down !
Glory to De Geweldige Sierlijke Katachtige Utopia en Zijne Autonome Machten ov Valentine Z !
(✿◠‿◠) ☆ \(^_^)/ ☆

Issues Thread Photography Stuff Project: Save F7. Stats Analysis

The Sixty! Valentian Stories! Gwen's Adventures!

• Never trouble trouble until trouble troubles you.
• World Map is a cat playing with Australia.
Let Fate sort it out.

User avatar
Trotterdam
Postmaster-General
 
Posts: 10541
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Fri Nov 22, 2019 9:40 am

Valentine Z wrote:However... https://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=hdi, whereby q=hdi is not mentioned in the public shard section, gives precise HDI values, to several decimal places.
Wow, it's possible to track people's lifespans to an accuracy of three microseconds?

User avatar
Valentine Z
Postmaster-General
 
Posts: 13018
Founded: Nov 08, 2015
Scandinavian Liberal Paradise

Postby Valentine Z » Fri Nov 22, 2019 11:43 am

Trotterdam wrote:
Valentine Z wrote:However... https://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=hdi, whereby q=hdi is not mentioned in the public shard section, gives precise HDI values, to several decimal places.
Wow, it's possible to track people's lifespans to an accuracy of three microseconds?

Happy 14th and 1 microsecond birthday, to you. :P
Last edited by Valentine Z on Fri Nov 22, 2019 11:43 am, edited 1 time in total.
Val's Stuff. ♡ ^_^ ♡ For You
If you are reading my sig, I want you to have the best day ever ! You are worth it, do not let anyone get you down !
Glory to De Geweldige Sierlijke Katachtige Utopia en Zijne Autonome Machten ov Valentine Z !
(✿◠‿◠) ☆ \(^_^)/ ☆

Issues Thread Photography Stuff Project: Save F7. Stats Analysis

The Sixty! Valentian Stories! Gwen's Adventures!

• Never trouble trouble until trouble troubles you.
• World Map is a cat playing with Australia.
Let Fate sort it out.

User avatar
The Order of the Holy Inquisitors
Secretary
 
Posts: 35
Founded: Jan 31, 2018
Ex-Nation

Postby The Order of the Holy Inquisitors » Fri Nov 22, 2019 4:57 pm

Hi there! I'm currently trying my hand at some basic data retrieval stuff using a wrapper for the API (was bored and thus looking for a challenge), and I noticed that on the Wrapper documentation page (here), it states I must "set a user agent." If I'm using a wrapper, is this step still mandatory, and if so, could you please direct me as to how exactly I should go about doing that?
Last edited by The Order of the Holy Inquisitors on Fri Nov 22, 2019 4:57 pm, edited 1 time in total.

User avatar
Trotterdam
Postmaster-General
 
Posts: 10541
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Fri Nov 22, 2019 7:36 pm

The Order of the Holy Inquisitors wrote:Hi there! I'm currently trying my hand at some basic data retrieval stuff using a wrapper for the API (was bored and thus looking for a challenge), and I noticed that on the Wrapper documentation page (here), it states I must "set a user agent." If I'm using a wrapper, is this step still mandatory, and if so, could you please direct me as to how exactly I should go about doing that?
Yes, setting a user agent is still mandatory.

The way to do this should be specified in the documentation for whichever wrapper you're using. If you can't find it, it's probably best to contact the wrapper's author for help.

User avatar
The Order of the Holy Inquisitors
Secretary
 
Posts: 35
Founded: Jan 31, 2018
Ex-Nation

Postby The Order of the Holy Inquisitors » Fri Nov 22, 2019 10:37 pm

Trotterdam wrote:
The Order of the Holy Inquisitors wrote:Hi there! I'm currently trying my hand at some basic data retrieval stuff using a wrapper for the API (was bored and thus looking for a challenge), and I noticed that on the Wrapper documentation page (here), it states I must "set a user agent." If I'm using a wrapper, is this step still mandatory, and if so, could you please direct me as to how exactly I should go about doing that?
Yes, setting a user agent is still mandatory.

The way to do this should be specified in the documentation for whichever wrapper you're using. If you can't find it, it's probably best to contact the wrapper's author for help.

Thank you so much! I'll get on that ASAP

Edit: I think I got it set properly (registers my nation site link as the value of the userAgent variable and logs to the console the name of the wrapper creator and me as a "user" of it. I think this is enough, but if I want to double check, would I just go to the author of the wrapper again?
Last edited by The Order of the Holy Inquisitors on Fri Nov 22, 2019 11:10 pm, edited 3 times in total.

User avatar
Trotterdam
Postmaster-General
 
Posts: 10541
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Sat Nov 23, 2019 12:17 am

The Order of the Holy Inquisitors wrote:Edit: I think I got it set properly (registers my nation site link as the value of the userAgent variable and logs to the console the name of the wrapper creator and me as a "user" of it. I think this is enough, but if I want to double check, would I just go to the author of the wrapper again?
For clarification on what constitutes a sufficiently-informative user agent you'll need to contact the actual game staff (for which this is the right thread, so just wait and hope for a response), since they're the only ones with the authority to make a ruling on that. The wrapper just determines how you set your user agent, not what you should set it to.

I don't understand what you mean by "logs to the console", though. Unless I'm misunderstanding, what your program logs to your console shouldn't be relevant to anyone except yourself.

User avatar
Frisbeeteria
Senior Game Moderator
 
Posts: 27796
Founded: Dec 16, 2003
Capitalizt

Postby Frisbeeteria » Sat Nov 23, 2019 9:59 am

Trotterdam wrote:For clarification on what constitutes a sufficiently-informative user agent you'll need to contact the actual game staff

We want something that will let us get back to you if something goes wrong. Your main nation or email address are both acceptable. I'd personally go for 'blatantly obvious' and call mine "Frisbeeteria Recruitment Script".

User avatar
The Order of the Holy Inquisitors
Secretary
 
Posts: 35
Founded: Jan 31, 2018
Ex-Nation

Postby The Order of the Holy Inquisitors » Sat Nov 23, 2019 4:48 pm

Trotterdam wrote:For clarification on what constitutes a sufficiently-informative user agent you'll need to contact the actual game staff (for which this is the right thread, so just wait and hope for a response), since they're the only ones with the authority to make a ruling on that. The wrapper just determines how you set your user agent, not what you should set it to.

I don't understand what you mean by "logs to the console", though. Unless I'm misunderstanding, what your program logs to your console shouldn't be relevant to anyone except yourself.

Okay. I was just logging the value that I set it to to my own console to make sure it worked. Thank you for your help!

Frisbeeteria wrote:We want something that will let us get back to you if something goes wrong. Your main nation or email address are both acceptable. I'd personally go for 'blatantly obvious' and call mine "Frisbeeteria Recruitment Script".

I put the link to my nation.

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

Postby SherpDaWerp » Tue Dec 03, 2019 4:44 pm

Is there a more efficient way for me to query the political freedoms/civil rights/economic freedoms for every nation than just slowly going through every nation individually? I'm looking to build up an idea of the thresholds for each WA classification, so a large sample size (every nation) is best IMO.

Economic Freedom is not listed in the daily dump, although civil rights, political freedoms and WA classification are. At the moment, it looks like my best option is to use the daily dump, but then I'd still have to manually query the economic freedom of every nation. (Despite the fact that there is ECONOMY under FREEDOM and FREEDOMSCORES, these values represent the economic strength census rather than the economic freedom one...)
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Dec 11, 2019 4:58 pm

There is now a Cards API in development. It's subject to change without warning, but is pretty functional already.

Documentation here:

https://www.nationstates.net/pages/api.html#cards

User avatar
Flanderlion
Minister
 
Posts: 2226
Founded: Nov 25, 2013
Psychotic Dictatorship

Postby Flanderlion » Wed Dec 11, 2019 5:47 pm

[violet] wrote:There is now a Cards API in development. It's subject to change without warning, but is pretty functional already.

Documentation here:

https://www.nationstates.net/pages/api.html#cards

Thanks for writing this up, was trying to keep track through a myriad of bookmarks. Can you add the two card files to the doc as well? Probably under the Daily Dump section.
As always, I'm representing myself.
Information
Wishlist

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Dec 11, 2019 8:59 pm

Flanderlion wrote:Can you add the two card files to the doc as well? Probably under the Daily Dump section.

What do you mean?

User avatar
Flanderlion
Minister
 
Posts: 2226
Founded: Nov 25, 2013
Psychotic Dictatorship

Postby Flanderlion » Thu Dec 12, 2019 3:49 am

[violet] wrote:
Flanderlion wrote:Can you add the two card files to the doc as well? Probably under the Daily Dump section.

What do you mean?

viewtopic.php?f=42&t=468779

These two files, just so everything that would help tool related wise is in the same place.
As always, I'm representing myself.
Information
Wishlist

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Istastioner, Mavenu, Norvoz, Reformed United States, The Plough Islands, Untecna, Workers Republic of Prestes Order

Advertisement

Remove ads