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
Diplomat
 
Posts: 807
Founded: Sep 29, 2020
Capitalist Paradise

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: 27796
Founded: Dec 16, 2003
Capitalizt

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: 12655
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 56+ GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Elsie Mortimer Wellesley
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
Aurum Raider
Envoy
 
Posts: 239
Founded: Sep 18, 2014
Iron Fist Consumerists

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
Minister
 
Posts: 3478
Founded: Feb 01, 2022
Liberal Democratic Socialists

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

Is there an official or third-party forum API?
linux > windows

@ruleofthree@universeodon.com

User avatar
Ever-Wandering Souls
Negotiator
 
Posts: 7267
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: 12655
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 56+ GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Elsie Mortimer Wellesley
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
United Calanworie
Technical Moderator
 
Posts: 3740
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.
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
Vleerian
Spokesperson
 
Posts: 137
Founded: Feb 07, 2022
Compulsory Consumerist State

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 - Also known as Aurum Rider
Cretox State wrote:“We treat your shipment like it’s ours!”

Creator of FATTKatt

User avatar
Ever-Wandering Souls
Negotiator
 
Posts: 7267
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
Technical Moderator
 
Posts: 1873
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?

User avatar
Sweeze
Spokesperson
 
Posts: 189
Founded: Oct 21, 2018
Scandinavian Liberal Paradise

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 nsdotpy |
[6:38 PM] Chingis: ... the Tom Brady of R/D
5417+ times tag/detag delegate, 5945+ regions hit, first person to become delegate of 200+ regions in an update (and only to do so multiple times)
call me audrey, it/she

User avatar
Imperium Anglorum
GA Secretariat
 
Posts: 12655
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 56+ GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Elsie Mortimer Wellesley
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
United Calanworie
Technical Moderator
 
Posts: 3740
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.
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
Hagston
Bureaucrat
 
Posts: 63
Founded: Nov 17, 2018
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
Minister
 
Posts: 2254
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.

User avatar
[violet]
Executive Director
 
Posts: 16205
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: 18
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]
Executive Director
 
Posts: 16205
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
Technical Moderator
 
Posts: 1895
Founded: Mar 02, 2016
Benevolent Dictatorship

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.
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
Comfed
Minister
 
Posts: 2254
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?

User avatar
[violet]
Executive Director
 
Posts: 16205
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: 12655
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 56+ GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Elsie Mortimer Wellesley
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

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

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.
Became an editor on 18/01/23 techie on 29/01/24

Rampant statistical speculation from before then is entirely unofficial

User avatar
Refuge Isle
Technical Moderator
 
Posts: 1873
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

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Baharan, Dolor Mortis, Hoppeonia, Micro Gettysburg, Nolgonia, Normania Islands and Antartica territory, Waseand

Advertisement

Remove ads