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
Bowzin
Envoy
 
Posts: 301
Founded: Aug 13, 2018
Libertarian Police State

Postby Bowzin » Sat Jun 10, 2023 9:06 am

Roavin wrote:
Lemmingtopias wrote:Does NS keep a log of the amount of unique issues answered, or options answered?

And if so, is that something that could be added as a shard alongside the current answered shard?


Do you mean something like "issue 123 was answered 123321 times"?

Even if this wasn't their suggestion, having access to this data, as well as the data behind how many times each option was chosen, would be super interesting, if at all possible.
Bowzin Vytherov-Skollvaldr
| On a Redemption Arc. |
We dropped a new resume dispatch!

User avatar
Thorn1000
Envoy
 
Posts: 232
Founded: Apr 02, 2015
Corporate Police State

Postby Thorn1000 » Mon Jun 12, 2023 11:07 am

Took a quick read around and I cant say I found it mentioned anywhere else and I am happy to cross post this to wherever else it might need to go, but I was wondering about getting a nation's trade history API shard (broken down into buys or sells or maybe that isnt needed). We have the stored buys and sells already of each nation (at the present moment I can see mine is 4188 buys and 2969 sales!) and we even have API access to each individual cards buys and sells but it isnt easy to encompass specific nations with that information. Would be nice to have something that spits out information like the general trades shard or the specific card trades history so we could have some information tracking or see how much a nation spends vs how much they sell. Something like this maybe?

Code: Select all
<TRADE>
<CARDID>1</CARDID>
<SEASON>3</SEASON>
<PRICE>450.00</PRICE>
<SELLER>Thorn1000</SELLER>
<TIMESTAMP>1668660299</TIMESTAMP>
</TRADE>
walrus wrote:Life is a zero-sum game. The lower I make the happiness of children, the higher my happiness rises

All opinions that I express are solely mine. I do not speak for anyone but me yadayadayada
One of 5 people to have hit more than 200 regions in 1 update

User avatar
20XX
Lobbyist
 
Posts: 14
Founded: May 03, 2020
Iron Fist Consumerists

Postby 20XX » Mon Jun 19, 2023 1:04 pm

United Calanworie wrote:One-month *bump* on this query. Something that I thought of would be influence returning as a list, like this for example:
<influence>
<region id="a region">124.0</region>
<region id="testregionia">2.0</region>
</influence>
This is obviously a change from my prior response of "current region only," but after thinking about it a bit more while I wrote this post, it seems more logical to provide all the data instead of a small subset.

Bump on this. As Eluvatar asked about possible ramifications - I don't think that this would endanger many sleepers. While you could use this to track what regions a nation has spent update in, that's already trivial to do by comparing data dumps. As noted, There is already a historical catalog of where nations have spent major update

This could potentially enable you to also track where a nation has spent Minor update, assuming they are jumping from region to region between updates, however realistically that won't impact sleeper operations - making a lot of noise on the happenings feed is the antithesis of stealth.
Vleerian Vytherov

User avatar
Thorn1000
Envoy
 
Posts: 232
Founded: Apr 02, 2015
Corporate Police State

Postby Thorn1000 » Mon Jun 19, 2023 1:14 pm

And while we are at this could we make these numbers actually specific and correct/true and not the hazy pseudo accuracy it has right now by including in endorsements?
walrus wrote:Life is a zero-sum game. The lower I make the happiness of children, the higher my happiness rises

All opinions that I express are solely mine. I do not speak for anyone but me yadayadayada
One of 5 people to have hit more than 200 regions in 1 update

User avatar
Ever-Wandering Souls
Negotiator
 
Posts: 7272
Founded: Jan 01, 2014
Father Knows Best State

Postby Ever-Wandering Souls » Mon Jun 19, 2023 1:41 pm

Thorn1000 wrote:And while we are at this could we make these numbers actually specific and correct/true and not the hazy pseudo accuracy it has right now by including in endorsements?


Yes, right now, the Census (and API) SPDR number is...not real. It shows some sort of inflated value that is, as far as I can tell, roughly your current inf + what you're expected to gain next update, but not exactly that either (i.e. if someone endorses and then resigns), and without accounting for any Decay either I think. The end result is that, for example, a nation I just looked at in TNP which was founded yesterday and has had ~25 endorsements through only one update, shows as having >50 SPDR, but half of that is not real yet.

Breaking down the per-region values in the API is also something I support on top of "fixing" the census total value; it's per-region values that matter for regional actions as I understand it, so clearly those are already tracked. As was said, it adds relatively little info about that nation's history that the Activity feed and Dumps do not already contain.

Big picture: As was discussed in a bipartisan manner (i.e. both raiders and defenders in support) with a measure of Admin agreement, over in the Frontiers thread, there really isn't any reason for Influence to be pseudo-secret in 2023, in terms of what you have or what things cost. R&D players and large regions benefit from someone somewhere figuring it out and sharing it, and it's only the random average native that's out here getting shafted by the effective class-difference in site mechanical knowledge. The site would be a better, more equitable, and more accessible place for all players if it clearly disclosed both the influence cost formulas for various tasks and also the actual influence in various regions that a player has. Especially as Influence, as a mechanic, is now a lot more relevant to a lot more average people under Frontiers, I think the time is ripe to make this change towards mechanical transparency here that puts all players of the game on common ground.

Edit: To add, I also think Decay should be transparent too. But let me know if I'm getting more into "make a separate tech thread about inf transparency" than what's appropriate for the API thread.
Last edited by Ever-Wandering Souls on Mon Jun 19, 2023 1:53 pm, edited 2 times in total.
Proud Raider; General of The Black Hawks, Ret.
TG me anytime; I'm always happy to talk about anything!

The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258

Misley wrote:
Hobbesistan wrote:Don't think I understand the question.
The color or what?..

Jesus, Hobbes, it's 2015. You can't just call someone "the color".

Reploid Productions wrote:Raiders are endlessly creative

How Do I Telegram API?

Omnis delenda est.

User avatar
Esfalsa
Spokesperson
 
Posts: 132
Founded: Aug 07, 2015
Civil Rights Lovefest

Postby Esfalsa » Tue Jun 20, 2023 1:22 pm

Eh, I think this would be new information, because neither daily dumps nor census shard history covers minor updates, and happenings only go back a week. (I could've sworn census shard history used to cover minor updates as well, but maybe I'm just imagining things there...) In any case, I'd find it useful as well and think this kind of information would be cool to have :P. Admittedly, I'm not too familiar with implications outside of R/D .

User avatar
Ever-Wandering Souls
Negotiator
 
Posts: 7272
Founded: Jan 01, 2014
Father Knows Best State

Postby Ever-Wandering Souls » Tue Jun 20, 2023 1:33 pm

Esfalsa wrote:Eh, I think this would be new information, because neither daily dumps nor census shard history covers minor updates, and happenings only go back a week. (I could've sworn census shard history used to cover minor updates as well, but maybe I'm just imagining things there...) In any case, I'd find it useful as well and think this kind of information would be cool to have :P. Admittedly, I'm not too familiar with implications outside of R/D .


Any influence value that takes longer than the activity feed's 7 days of history to decay is almost certainly going to involve staying in a region through a major update and ending up in the data dumps, in practicality; as someone who has to lead stealth ops, I see no impact in that field from having a per-region breakdown of current influence be available.
Proud Raider; General of The Black Hawks, Ret.
TG me anytime; I'm always happy to talk about anything!

The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258

Misley wrote:
Hobbesistan wrote:Don't think I understand the question.
The color or what?..

Jesus, Hobbes, it's 2015. You can't just call someone "the color".

Reploid Productions wrote:Raiders are endlessly creative

How Do I Telegram API?

Omnis delenda est.

User avatar
Esfalsa
Spokesperson
 
Posts: 132
Founded: Aug 07, 2015
Civil Rights Lovefest

Postby Esfalsa » Tue Jun 20, 2023 2:52 pm

Right, I should've been more clear that I wasn't referring to sleepers/stealth ops. Personally, having per-region influence values would also be useful, for example, in the middle of a raid. Currently, there's plenty of inaccuracy from nations that have accumulated signifiant influence in other regions, data dumps and census shard history only covering every other update, deliberate update surfing (e.g. to preserve influence, avoid Delegate tipping, etc.), and so on.

But at the end of the day, new information or not, I still think it's information that would be nice to have! It's presumably useful for both sides of the R/D dynamic to identify potential targets, measure transition costs, etc... sure, it feels like new information to me, but I don't see why that's a bad thing; if anything, that just means I'd be more excited to have this information :P

User avatar
Ever-Wandering Souls
Negotiator
 
Posts: 7272
Founded: Jan 01, 2014
Father Knows Best State

Postby Ever-Wandering Souls » Tue Jun 20, 2023 3:12 pm

If you mean specific to the values themselves, they're largely possible to approximate as-is with the influence census, endos census, activity, and a loose approximation of the decay rate - accurately enough to get the job done at least. I do it for ops all the time. It just requires a massive pain in the ass spreadsheet of starting inf + endos at update (in or out of the region) - assumed decay, updated twice daily.

"Tim jumped on main, but we don't care about that, he updated in region with about 45e the first update, left to cross and was late this update so gained none but decay is minimal first-day, then came back a third time and had 55e this jump, so he has about 110 in the region regardless of what the value displayed is." Times dozens. For important ops, I've tracked dozens to hundreds of lines of that through jump after jump.


For natives, those census charts plus NSHistory/dumps can provide a good approximation of whether the bulk of someone's inf is in-region or not.

Which is all to say the data exists in a close-enough-for-practical-purposes manner... it's just a massive pain in the ass to gather and calculate that requires exclusive knowledge and loads of time, and it'd be more equitable and accessible to all players if it was transparent - and frankly, it would perhaps most impact the actual data available to people *outside* of Raiding where they *don't* have me carefully beancounting as things go and just want to know how much inf random nation X *actually* has for their purposes.

Edit: at most I think you could say it'd make precisely calculating the decay formula easier, but again, that's another thing that - like influence *costs* as discussed in the frontiers thread - relevant Gameplay orgs/regions have at least a general "good enough" understanding of already, and the pseudo-secrecy is only harming less established parties/raising the barriers to entry. In short, the site already provides enough information that anything relevant is already known by the elite who've back-calculated it, so it should just provide it clearly for everyone.
Last edited by Ever-Wandering Souls on Tue Jun 20, 2023 3:26 pm, edited 5 times in total.
Proud Raider; General of The Black Hawks, Ret.
TG me anytime; I'm always happy to talk about anything!

The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258

Misley wrote:
Hobbesistan wrote:Don't think I understand the question.
The color or what?..

Jesus, Hobbes, it's 2015. You can't just call someone "the color".

Reploid Productions wrote:Raiders are endlessly creative

How Do I Telegram API?

Omnis delenda est.

User avatar
Roavin
Admin
 
Posts: 1778
Founded: Apr 07, 2016
Democratic Socialists

Postby Roavin » Tue Jun 20, 2023 11:15 pm

Ever-Wandering Souls wrote:If you mean specific to the values themselves, they're largely possible to approximate as-is with the influence census, endos census, activity, and a loose approximation of the decay rate - accurately enough to get the job done at least. I do it for ops all the time. It just requires a massive pain in the ass spreadsheet of starting inf + endos at update (in or out of the region) - assumed decay, updated twice daily.


Having done this myself, I feel your pain :P

I'll bring the suggestion up backstage.
Helpful Resources: One Stop Rules Shop | API documentation | NS Coders Discord
About me: Longest serving Prime Minister in TSP | Former First Warden of TGW | aka Curious Observations

Feel free to TG me, but not about moderation matters.

User avatar
Aramos
Civilian
 
Posts: 1
Founded: Aug 09, 2019
Anarchy

Postby Aramos » Fri Jun 30, 2023 7:23 pm

Hi, I'm here to report a missing shard on the API documentation. When making a "standard" nation API request, one of the tags returned is <FREEDOMSCORES>. However, the associated shard freedomscores is not included on the list of nation shards. It does exist in the API, but it is not currently documented.

User avatar
Esfalsa
Spokesperson
 
Posts: 132
Founded: Aug 07, 2015
Civil Rights Lovefest

Postby Esfalsa » Fri Jun 30, 2023 10:52 pm

Merni wrote:It seems there is no API field for the Governor's title. Could we have one, preferably included in the Daily Dumps so that detag-finding tools could find them?


Quick bump on this as it's been (a bit over) a couple months and this information doesn't seem like it's accessible programmatically at all without HTML scraping. I'll also echo that having this information in the region daily dump would be particularly nice — not just for detag-finding tools, as Merni pointed out, but I would say that there are untapped use cases here as well, such as for taggers to track their tagged regions or excluded regions based on governor title (just as regions may be excluded by tags, embassies, WFE contents, etc.).

User avatar
Empire of Australia1
Civil Servant
 
Posts: 7
Founded: Jul 07, 2022
Iron Fist Consumerists

Postby Empire of Australia1 » Sat Jul 01, 2023 1:03 am

okay this may sound stupid, but i forgot how to recover the secret key so i can run an API. Any help here would be appreciated
HM Empire of Australia1
Monarch of Empire of Australia
Commander in Chief of the Australian Defence force etc

User avatar
United States of Dictators
Civil Servant
 
Posts: 9
Founded: Dec 23, 2021
Civil Rights Lovefest

Postby United States of Dictators » Sun Jul 02, 2023 7:20 am

Hello!

So while digging this thread for some information, I found this post from 2020 about a undocumented feature of the API that allows for nation creation, I would like to know if this command is still usable/legal now?

Thanks in advance!
Programmer/Graphic Designer. Mainly based in The North Pacific and The Wellspring.

User avatar
Merni
Ambassador
 
Posts: 1800
Founded: May 03, 2016
Democratic Socialists

Postby Merni » Sun Jul 02, 2023 8:39 am

United States of Dictators wrote:Hello!

So while digging this thread for some information, I found this post from 2020 about a undocumented feature of the API that allows for nation creation, I would like to know if this command is still usable/legal now?

Thanks in advance!

This isn't part of the API at all. It's just the form submission that occurs when you click the final "Create Nation" button here in the normal nation creation page on the HTML site.
Last edited by Merni on Sun Jul 02, 2023 8:40 am, edited 1 time in total.
2024: the year of democracy. Vote!
The Labyrinth | Donate your free time, help make free ebooks | Admins: Please let us block WACC TGs!
RIP Residency 3.5.16-18.11.21, killed by simplistic calculation
Political Compass: Economic -9.5 (Left) / Social -3.85 (Liberal)
Wrote issue 1523, GA resolutions 532 and 659
meth
When the people are being beaten with a stick, they are not much happier if it is called 'the People’s Stick.' — Mikhail Bakunin (to Karl Marx)
You're supposed to be employing the arts of diplomacy, not the ruddy great thumping sledgehammers of diplomacy. — Ardchoille
The West won the world not by the superiority of its ideas or values or religion [...] but rather by its superiority in applying organised violence. — Samuel P. Huntington (even he said that!)

User avatar
United Calanworie
Technical Moderator
 
Posts: 3843
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Sun Jul 02, 2023 6:10 pm

Correct. build_nation.cgi is not part of the API and as such is subject to our script rules.
Trans rights are human rights.
||||||||||||||||||||
Discord: Aav#7546 @queerlyfe
She/Her/Hers
My telegrams are not for Moderation enquiries, those belong in a GHR. Feel free to reach out if you want to just chat.

User avatar
Merni
Ambassador
 
Posts: 1800
Founded: May 03, 2016
Democratic Socialists

Postby Merni » Sat Jul 15, 2023 11:53 am

Esfalsa wrote:
Merni wrote:It seems there is no API field for the Governor's title. Could we have one, preferably included in the Daily Dumps so that detag-finding tools could find them?


Quick bump on this as it's been (a bit over) a couple months and this information doesn't seem like it's accessible programmatically at all without HTML scraping. I'll also echo that having this information in the region daily dump would be particularly nice — not just for detag-finding tools, as Merni pointed out, but I would say that there are untapped use cases here as well, such as for taggers to track their tagged regions or excluded regions based on governor title (just as regions may be excluded by tags, embassies, WFE contents, etc.).

Bumping this again. This seems like very basic information, akin to RO titles, and it would really be helpful to have it in the API and dumps.
2024: the year of democracy. Vote!
The Labyrinth | Donate your free time, help make free ebooks | Admins: Please let us block WACC TGs!
RIP Residency 3.5.16-18.11.21, killed by simplistic calculation
Political Compass: Economic -9.5 (Left) / Social -3.85 (Liberal)
Wrote issue 1523, GA resolutions 532 and 659
meth
When the people are being beaten with a stick, they are not much happier if it is called 'the People’s Stick.' — Mikhail Bakunin (to Karl Marx)
You're supposed to be employing the arts of diplomacy, not the ruddy great thumping sledgehammers of diplomacy. — Ardchoille
The West won the world not by the superiority of its ideas or values or religion [...] but rather by its superiority in applying organised violence. — Samuel P. Huntington (even he said that!)

User avatar
United States of Dictators
Civil Servant
 
Posts: 9
Founded: Dec 23, 2021
Civil Rights Lovefest

Postby United States of Dictators » Sun Jul 16, 2023 7:11 am

It seems that I have accidentally crossed the API TG ratelimit, the documentation says that there will be a time window saying when I can try again, but my error does show the time window, just the 429 error.

Code: Select all
<!DOCTYPE html>
<h1 style="color:red">API TG ratelimit exceeded by client "".</h1>
<p style="font-size:small">Error: 429 API TG ratelimit exceeded by client "".
<p><a href="/pages/api.html">The NationStates API Documentation</a>


I tried to run the script 4-5 minutes later and it showed the same error, why is this happening?

NVM: I just remembered that we can only send 1 non recruitment telegram per 180 seconds and I was looping to send three, my bad.
Last edited by United States of Dictators on Sun Jul 16, 2023 7:14 am, edited 1 time in total.
Programmer/Graphic Designer. Mainly based in The North Pacific and The Wellspring.

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

Postby Darcania » Sun Jul 16, 2023 2:04 pm

United States of Dictators wrote:It seems that I have accidentally crossed the API TG ratelimit, the documentation says that there will be a time window saying when I can try again, but my error does show the time window, just the 429 error.

API ratelimiting information can be found in the response headers, not in the response body. I'll note though that the documentation is slightly incorrect: you'll want to check the Retry-After header rather than X-Retry-After (as the X-Retry-After header is not included anymore).

User avatar
United States of Dictators
Civil Servant
 
Posts: 9
Founded: Dec 23, 2021
Civil Rights Lovefest

Postby United States of Dictators » Mon Jul 17, 2023 11:06 pm

I was coding up a regional statistics script, and I noticed that some UCRs don't seem to have a founding date timestamp, just 0 like the GCRs, I'm not sure why, as they are user created shouldn't they have a founding date? most of the UCRs seem to except a few.

Examples:
The Land of Kings and Emperors
Europeia
Programmer/Graphic Designer. Mainly based in The North Pacific and The Wellspring.

User avatar
Notanam
Envoy
 
Posts: 227
Founded: Feb 21, 2019
Civil Rights Lovefest

Postby Notanam » Mon Jul 17, 2023 11:34 pm

United States of Dictators wrote:I was coding up a regional statistics script, and I noticed that some UCRs don't seem to have a founding date timestamp, just 0 like the GCRs, I'm not sure why, as they are user created shouldn't they have a founding date? most of the UCRs seem to except a few.

Examples:
The Land of Kings and Emperors
Europeia

Osiris has a founding date timestamp and that's a GCR. Think the founded time has to do with whether or not the founding is recorded in regional history, which was added after the foundings of those UCRs iirc.
This is Nota's signature.

User avatar
United States of Dictators
Civil Servant
 
Posts: 9
Founded: Dec 23, 2021
Civil Rights Lovefest

Postby United States of Dictators » Tue Jul 25, 2023 7:25 am

I'm not sure if this has been requested before, but would it be possible to include in the API shards or preferably, data dumps, information about how many GA/SC proposals a nation has authored?
Programmer/Graphic Designer. Mainly based in The North Pacific and The Wellspring.

User avatar
Improper Classifications
Ambassador
 
Posts: 1323
Founded: Apr 18, 2022
Iron Fist Consumerists

Postby Improper Classifications » Tue Jul 25, 2023 7:52 pm

Is there a private API command that allows Executive regional officers to appoint and dismiss officers?
Former Acolyte of Malice
Founder and Champion of Voidcall, Conqueror of Majesty and Pentarchs.
Legally proscribed in The South Pacific under On Concord.
The Imperial Federation of Improper Classifications

User avatar
United Calanworie
Technical Moderator
 
Posts: 3843
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Wed Jul 26, 2023 2:03 pm

Not at this time.
Trans rights are human rights.
||||||||||||||||||||
Discord: Aav#7546 @queerlyfe
She/Her/Hers
My telegrams are not for Moderation enquiries, those belong in a GHR. Feel free to reach out if you want to just chat.

User avatar
Improper Classifications
Ambassador
 
Posts: 1323
Founded: Apr 18, 2022
Iron Fist Consumerists

Postby Improper Classifications » Wed Jul 26, 2023 2:14 pm

Are there any plans for one?
Former Acolyte of Malice
Founder and Champion of Voidcall, Conqueror of Majesty and Pentarchs.
Legally proscribed in The South Pacific under On Concord.
The Imperial Federation of Improper Classifications

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Nanocyberia, Riemstagrad

Advertisement

Remove ads