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
PhilTech
Chargé d'Affaires
 
Posts: 430
Founded: Sep 29, 2020
Corporate Bordello

Postby PhilTech » Sun Feb 13, 2022 6:36 am

Valkyriah wrote:After I got the client key,what I should do with?


Where do you intend to use it exactly? Usually, it is used for recruiting purposes - API client/API automatic telegrammer.

Lucky for us, NS has some brilliant people and they already created API clients that are publicly available for the community.

Just choose one of them of your liking and you're now set. I recommend not using Nstg-web, I've tried it and has a lot of issues. I personally use pyNSrecruit.

User avatar
Frisbeeteria
Senior Game Moderator
 
Posts: 26589
Founded: Dec 16, 2003
Anarchy

Postby Frisbeeteria » Sun Feb 13, 2022 10:12 am

Valkyriah wrote:After I got the client key,what I should do with?

If you don't know how scripts work, you shouldn't be doing anything with it. API scripts are designed for people who who have a basic understanding of the concepts.

User avatar
Imperium Anglorum
GA Secretariat
 
Posts: 11471
Founded: Aug 26, 2013
Left-Leaning College State

Postby Imperium Anglorum » Fri Mar 11, 2022 10:13 am

Imperium Anglorum wrote:
[violet] wrote:Removed GENSEC and HELD from the API since they're not ready for public consumption yet.

Could these be added back to the API?

Bump this request.

Author: 1 SC and 47 GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Gaius Marcius Blythe
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
Aurum Raider
Envoy
 
Posts: 239
Founded: Sep 18, 2014
Ex-Nation

Postby Aurum Raider » Fri Mar 18, 2022 4:29 pm

Would a World API endpoint that returns the most recent region updated be possible? (LASTREGION)
The main use would be for monitoring update progress during the update itself, as well as enhancing time prediction scripts.
Last edited by Aurum Raider on Fri Mar 18, 2022 4:30 pm, edited 1 time in total.
Vleerian Vytherov-Denral
Cognitohazard

The North Polish Union wrote:Additionally, virtually all founderless regions are viewed as falling under the defenders' allegedly protective purview. This is a form of colonialism that the great imperialist regions of NS history could only dream of.

User avatar
The United Penguin Commonwealth
Ambassador
 
Posts: 1758
Founded: Feb 01, 2022
Democratic Socialists

Postby The United Penguin Commonwealth » Mon Mar 21, 2022 10:08 am

Is there an official or third-party forum API?

Alignment: LibLeft
Ideology: Libertarian Social Democracy
8values: results
LeftValues: results
Compass: results
SapplyValues: results
InfValues: results

Heloin wrote:If your faith is hatred towards other people for being born a way then your faith isn’t worth a whole lot.

Kannap wrote:Gotta deny people are born gay because then you have to wrestle with the idea that if people are born gay then its by God's design and, if such, serves a God-given purpose and that doesn't mesh with God believing its a sin.

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

Postby Ever-Wandering Souls » Mon Mar 21, 2022 10:12 am

The United Penguin Commonwealth wrote:Is there an official or third-party forum API?


No, botted interaction with the forums is pretty heavily discouraged and not officially supported.

From the Scripting FAQ that Ziz and I are working on, with sourcing to [v]:

Zizou wrote:Q: Can my bot interact with the NS forums?
A: Any form of scraping is heavily discouraged, and it is forbidden for scripts to perform actions as logged in users or to attempt to log in.
Last edited by Ever-Wandering Souls on Mon Mar 21, 2022 10:13 am, edited 1 time 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
Imperium Anglorum
GA Secretariat
 
Posts: 11471
Founded: Aug 26, 2013
Left-Leaning College State

Postby Imperium Anglorum » Tue Mar 22, 2022 9:19 am

Imperium Anglorum wrote:
[violet] wrote:Removed GENSEC and HELD from the API since they're not ready for public consumption yet.

Could these be added back to the API?

Bump this request again. It would be great to be able to add to the (my) proposal archive GenSec remarks on various proposals.

Author: 1 SC and 47 GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Gaius Marcius Blythe
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
United Calanworie
Envoy
 
Posts: 218
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Tue Mar 29, 2022 3:37 am

Can we please get the SPDR score of each nation added to the daily dumps? It would avoid having to make dozens or hundreds of calls in order to check influence for all nations in a region.
Discord: Aav#7564
Pyo Sage for Karma
She/Her/Hers
If you're looking for something to do this month with money, consider donating to the Astraea Foundation instead of spending money on corporate "pride" merchandise.
||||||||||||||||||||
||||||||||||||||||||

User avatar
Vleerian
Bureaucrat
 
Posts: 49
Founded: Feb 07, 2022
Psychotic Dictatorship

Postby Vleerian » Thu Apr 14, 2022 3:20 pm

Something that's been on the wishlist for a while, would it be possible to have LASTUPDATE include a timestamp for the minor update?

Presently to determine the exact length of the update, you can use the LASTUPDATE of the first and last regions. For the Major this data is present in the regions.xml data dump. For minor, you must make these requests on your own, and save the relevant data locally, as this data is overwritten over the course of the major update.

This would be especially valuable in the data dumps for tools like Spyglass which use LASTUPDATE to determine the length of the update, permitting it to calculate these values without relying on previous usage, or depending on an external resource to provide them.

My preference would be that the data is provided as an XML attribute a la
Code: Select all
<LASTUPDATE minor="(minor update time)">(major update time)</LASTUPDATE>

So as to be backwards compatible with existing tools that may be poorly (or not at all) maintained, while still providing the data under the LASTUPDATE tag.
Vleerian R - Formerly Aurum Raider
Cretox State wrote:“We treat your shipment like it’s ours!”

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

Postby Ever-Wandering Souls » Thu Apr 14, 2022 3:24 pm

Vleerian wrote:Something that's been on the wishlist for a while, would it be possible to have LASTUPDATE include a timestamp for the minor update?

Presently to determine the exact length of the update, you can use the LASTUPDATE of the first and last regions. For the Major this data is present in the regions.xml data dump. For minor, you must make these requests on your own, and save the relevant data locally, as this data is overwritten over the course of the major update.

This would be especially valuable in the data dumps for tools like Spyglass which use LASTUPDATE to determine the length of the update, permitting it to calculate these values without relying on previous usage, or depending on an external resource to provide them.

My preference would be that the data is provided as an XML attribute a la
Code: Select all
<LASTUPDATE minor="(minor update time)">(major update time)</LASTUPDATE>

So as to be backwards compatible with existing tools that may be poorly (or not at all) maintained, while still providing the data under the LASTUPDATE tag.


I'll also add that while a lot of users would vastly prefer getting this info regionally (whether in one, larger lastupdate shard or new shards), if this is not something you're willing to implement, it would also be similarly-but-less helpful to have an "updatelength" shard with the timestamp for either the end or the total runtime of /both/ of the last updates (again whether in one combined or two shards)
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
Refuge Isle
Ambassador
 
Posts: 1073
Founded: Dec 14, 2018
Left-wing Utopia

Postby Refuge Isle » Mon Apr 18, 2022 12:21 pm

Might a banner shard be added to the region API?

Ikania wrote:My brother in Christ, please stop posting.

User avatar
Sweeze
Spokesperson
 
Posts: 155
Founded: Oct 21, 2018
Inoffensive Centrist Democracy

Postby Sweeze » Wed Apr 27, 2022 9:06 pm

hihi- being that RO appoint timestamps are already included on the general region shard, any possibility we could get delegate elect timestamps on the region shard as well? i hate the idea of scraping the html for that info
Last edited by Sweeze on Wed May 18, 2022 1:21 pm, edited 1 time in total.
| lily supreme command | the mt army third in command | dev of swarm and feather |
[6:38 PM] Chingis: ... the Tom Brady of R/D
5417+ times tag/detag delegate, 5945+ regions hit, only person to become delegate of 200+ regions in an update (multiple times)
she/they

User avatar
Imperium Anglorum
GA Secretariat
 
Posts: 11471
Founded: Aug 26, 2013
Left-Leaning College State

Postby Imperium Anglorum » Mon May 02, 2022 9:30 am

Imperium Anglorum wrote:
Imperium Anglorum wrote:Could these be added back to the API?

Bump this request again. It would be great to be able to add to the (my) proposal archive GenSec remarks on various proposals.

Bump this again. There was recently a proposal which expired within hours of being held. And because proposals are deleted when they expire, there was no way for me (or others) to recover the GenSec statements on the matter or who voted. Adding them to the API would allow for that information to be archived.

Author: 1 SC and 47 GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Gaius Marcius Blythe
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
United Calanworie
Envoy
 
Posts: 218
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Wed May 18, 2022 12:54 pm

United Calanworie wrote:Can we please get the SPDR score of each nation added to the daily dumps? It would avoid having to make dozens or hundreds of calls in order to check influence for all nations in a region.

Vleerian wrote:Something that's been on the wishlist for a while, would it be possible to have LASTUPDATE include a timestamp for the minor update?

Presently to determine the exact length of the update, you can use the LASTUPDATE of the first and last regions. For the Major this data is present in the regions.xml data dump. For minor, you must make these requests on your own, and save the relevant data locally, as this data is overwritten over the course of the major update.

This would be especially valuable in the data dumps for tools like Spyglass which use LASTUPDATE to determine the length of the update, permitting it to calculate these values without relying on previous usage, or depending on an external resource to provide them.

My preference would be that the data is provided as an XML attribute a la
Code: Select all
<LASTUPDATE minor="(minor update time)">(major update time)</LASTUPDATE>

So as to be backwards compatible with existing tools that may be poorly (or not at all) maintained, while still providing the data under the LASTUPDATE tag.


Bumping both of these as they'd be real nice to have available.
Discord: Aav#7564
Pyo Sage for Karma
She/Her/Hers
If you're looking for something to do this month with money, consider donating to the Astraea Foundation instead of spending money on corporate "pride" merchandise.
||||||||||||||||||||
||||||||||||||||||||

User avatar
Hagston
Bureaucrat
 
Posts: 59
Founded: Nov 17, 2018
Liberal Democratic Socialists

Postby Hagston » Wed Jun 15, 2022 6:35 pm

I'm not sure if this is the right place, but does anyone know why my client key has stopped being recognized? For awhile now, everytime I try to use this TG tool (https://auralia.github.io/nstg-web/build/), it comes up with "Client Not Registered For API". I went and tried a new api template, and was then asked to make an API request for it. I clicked on the provided link, but the same message cam up again.

It all used to work fine. But now suddenly it doesn't? Do they expire or something?
.....................
.....................
.....................
.....................

User avatar
Comfed
Ambassador
 
Posts: 1633
Founded: Apr 09, 2020
Psychotic Dictatorship

Postby Comfed » Wed Jun 15, 2022 6:51 pm

Hagston wrote:I'm not sure if this is the right place, but does anyone know why my client key has stopped being recognized? For awhile now, everytime I try to use this TG tool (https://auralia.github.io/nstg-web/build/), it comes up with "Client Not Registered For API". I went and tried a new api template, and was then asked to make an API request for it. I clicked on the provided link, but the same message cam up again.

It all used to work fine. But now suddenly it doesn't? Do they expire or something?

You should probably file a GHR to ask that question.

Alternatively, the tool may be broken.
TNP NPO
WA (Co-)Authorship: SC#390

10000 Islands Foreign Affairs wrote:~The population of 10000 Islands suffered a huge increase

Ankuran wrote:"Here's Form T-34 for issuing a bribe. Enter the recipient's name here, check reason for bribe here, enter amount here. Now we'll just swipe your card here. Would you like to join our Frequent Briber's Club? Get five percent cash back on your first bribe."

“In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.” - Douglas Adams
Fool me once, shame on you. Fool me twice, everybody dies.
Nation reflects RL beliefs, especially bad ones. All stats are canon.

User avatar
[violet]
Site Admin
 
Posts: 15649
Founded: Antiquity

Postby [violet] » Wed Jun 15, 2022 8:06 pm

Imperium Anglorum wrote:
Imperium Anglorum wrote:Could these be added back to the API?

Bump this request again. It would be great to be able to add to the (my) proposal archive GenSec remarks on various proposals.

I'm back and doing API stuff. Added.

User avatar
East Durthang
Lobbyist
 
Posts: 16
Founded: Apr 07, 2015
Democratic Socialists

Postby East Durthang » Wed Jun 15, 2022 9:25 pm

An endpoint which spits out all the issues in the game and what options are available to select for each would be lovely. Bonus points if it also includes other metrics about the issues such as author (if there is one), prerequisites, number of nations who have picked each option, and so on.

User avatar
[violet]
Site Admin
 
Posts: 15649
Founded: Antiquity

Postby [violet] » Wed Jun 15, 2022 9:32 pm

Refuge Isle wrote:Might a banner shard be added to the region API?

Added BANNER to Standard Region API and BANNER and BANNERBY as Region API shards.

User avatar
SherpDaWerp
Ambassador
 
Posts: 1371
Founded: Mar 02, 2016
Libertarian Police State

Postby SherpDaWerp » Thu Jun 16, 2022 1:22 am

East Durthang wrote:An endpoint which spits out all the issues in the game and what options are available to select for each would be lovely. Bonus points if it also includes other metrics about the issues such as author (if there is one), prerequisites, number of nations who have picked each option, and so on.

Counterpoint: don't. The spoiler thread exists for this exact purpose; NS providing on-demand info for all of this would completely ruin the fun.

User avatar
Comfed
Ambassador
 
Posts: 1633
Founded: Apr 09, 2020
Psychotic Dictatorship

Postby Comfed » Thu Jun 16, 2022 3:15 pm

SherpDaWerp wrote:
East Durthang wrote:An endpoint which spits out all the issues in the game and what options are available to select for each would be lovely. Bonus points if it also includes other metrics about the issues such as author (if there is one), prerequisites, number of nations who have picked each option, and so on.

Counterpoint: don't. The spoiler thread exists for this exact purpose; NS providing on-demand info for all of this would completely ruin the fun.

What fun? There is already a website with all the issues results, and if you don't want spoilers for your issues... don't look for them?
TNP NPO
WA (Co-)Authorship: SC#390

10000 Islands Foreign Affairs wrote:~The population of 10000 Islands suffered a huge increase

Ankuran wrote:"Here's Form T-34 for issuing a bribe. Enter the recipient's name here, check reason for bribe here, enter amount here. Now we'll just swipe your card here. Would you like to join our Frequent Briber's Club? Get five percent cash back on your first bribe."

“In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.” - Douglas Adams
Fool me once, shame on you. Fool me twice, everybody dies.
Nation reflects RL beliefs, especially bad ones. All stats are canon.

User avatar
[violet]
Site Admin
 
Posts: 15649
Founded: Antiquity

Postby [violet] » Thu Jun 16, 2022 7:02 pm

SherpDaWerp wrote:
East Durthang wrote:An endpoint which spits out all the issues in the game and what options are available to select for each would be lovely. Bonus points if it also includes other metrics about the issues such as author (if there is one), prerequisites, number of nations who have picked each option, and so on.

Counterpoint: don't. The spoiler thread exists for this exact purpose; NS providing on-demand info for all of this would completely ruin the fun.

We probably won't ever serve data on NS internals such as number of issues in existence, what options those issues have, etc. We will serve data on the state of things in the game world, e.g. nations, regions.

User avatar
Imperium Anglorum
GA Secretariat
 
Posts: 11471
Founded: Aug 26, 2013
Left-Leaning College State

Postby Imperium Anglorum » Thu Jun 16, 2022 7:51 pm

[violet] wrote:
Imperium Anglorum wrote:Bump this request again. It would be great to be able to add to the (my) proposal archive GenSec remarks on various proposals.

I'm back and doing API stuff. Added.

Thanks! I've also done some coding on my side to archive those remarks.

Author: 1 SC and 47 GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Gaius Marcius Blythe
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
SherpDaWerp
Ambassador
 
Posts: 1371
Founded: Mar 02, 2016
Libertarian Police State

Postby SherpDaWerp » Fri Jun 17, 2022 6:27 am

Comfed wrote:
SherpDaWerp wrote:Counterpoint: don't. The spoiler thread exists for this exact purpose; NS providing on-demand info for all of this would completely ruin the fun.

What fun? There is already a website with all the issues results, and if you don't want spoilers for your issues... don't look for them?

..a website that is provided thanks to the efforts of player(s) (not staff: Trotterdam and those who've provided effect lines for him to track), and isn't guaranteed to be accurate (the way a NS API call would be). Trotterdam's tool is much closer to the spoiler thread in design than an API endpoint would be.

There's a world of difference between players maintaining potentially-accurate spoiler resources and NS just giving us the information whenever we ask.
Last edited by SherpDaWerp on Fri Jun 17, 2022 6:28 am, edited 1 time in total.

User avatar
Refuge Isle
Ambassador
 
Posts: 1073
Founded: Dec 14, 2018
Left-wing Utopia

Postby Refuge Isle » Fri Jun 17, 2022 9:55 am

[violet] wrote:
Refuge Isle wrote:Might a banner shard be added to the region API?

Added BANNER to Standard Region API and BANNER and BANNERBY as Region API shards.

Thanks! This will be a great help

Ikania wrote:My brother in Christ, please stop posting.

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Unified Empiricus

Advertisement

Remove ads