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
Dowaesk
Ambassador
 
Posts: 1200
Founded: Nov 03, 2020
Liberal Democratic Socialists

Postby Dowaesk » Sun Jun 13, 2021 9:59 am

Is this the place to ask why a certain player could have gotten banned?
Last edited by Dowaesk on Sun Jun 13, 2021 10:00 am, edited 1 time in total.
Dowaesk is a nation set in the year 2041 in the Indian Ocean. An alternative future where Laccadives, Suvadives and Chagos are independent. And these 3 countries along with the Maldives join together to form Dowaesk. Much like how the EU is made up.
-Social Democrat
-Environmentalist
-Moderate
-Modernist Muslim
-Pro-Palestine
-Anti-Kemalist
-Warning: I tend to talk about Maldives a little too much.
A Patriotic Maldivian and a Proud Muslim
FREE PALESTINE
TGs always welcome. Idk. I just like keeping people in my inbox. TG me for my Discord.
#FreeNSGRojava

Member of UDAF
The Amman Message

User avatar
Sedgistan
Senior Issues Moderator
 
Posts: 31014
Founded: Oct 20, 2006
Anarchy

Postby Sedgistan » Sun Jun 13, 2021 10:48 am

Dowaesk wrote:Is this the place to ask why a certain player could have gotten banned?

No. And if you read anything in this thread you'd realise that.

There isn't any place to ask that question, as it's not information we're going to disclose to you.

User avatar
SherpDaWerp
Ambassador
 
Posts: 1233
Founded: Mar 02, 2016
Civil Rights Lovefest

Postby SherpDaWerp » Sun Jun 20, 2021 9:09 pm

Thought of this while typing up a response in one of the new managerial threads.

Could the full list of notables and admirables that a nation is eligible for be made available through the API? Currently, you can only request admirable, notable which gives you one or three (respectively) of the eligible values for the nation. If you want to get the full list currently, you just have to keep requesting until you're pretty sure you've got them all, which is not a great approach.

What I have in mind is kinda similar to how the "banner" shard shows one randomly selected banner code from that nation, and "banners" shows all eligible banner codes from that nation.

EDIT: If redoing that code to make displaying all of them simultaneously requires a full rewrite, it would also be nice if "notable" (and perhaps a new "sensibility" shard) was displayed as a single value rather than a set of three sentence-formatted values, in line with the admirable shard. At the moment, they all just return the exact <thing> that gets concatenated into the homepage paragraph, which is a bit icky to deformat as a user.
Last edited by SherpDaWerp on Sun Jun 20, 2021 10:34 pm, edited 3 times in total.

User avatar
Trotterdam
Powerbroker
 
Posts: 9560
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Sun Jun 20, 2021 10:04 pm

I also mentioned this request here

SherpDaWerp wrote:Could the full list of notables, admirables, and sensibilities that a nation is eligible for be made available through the API? Currently, you can only request admirable, notable, and sensibilities, which gives you one, three, and one (respectively) of the eligible values for the nation. If you want to get the full list currently, you just have to keep requesting until you're pretty sure you've got them all, which is not a great approach.

Switching the shard name from "sensibilities" to "sensibility" would let you just add pluralised versions as shards, presenting the full list. Kinda similar to how the "banner" shard shows one randomly selected banner code from that nation, and "banners" shows all eligible banner codes from that nation.

EDIT: Also, internal consistency with the three existing shards would be good, i.e. displaying "notable" as a single value, rather than a set of three sentence-formatted values, in line with the admirable and sensibilities shards, which just return the single value on their own.
I think sensibilities are already nonrandom, unlike the other two. Also, it can contain multiple values - if you only get one then that's because your nation only qualifies for one (this is the case for Testlandia, which the example link in the API manual uses).

The q=notable shard displays the comma-separated-list-of-three because that's how it's actually shown on your nation page.
The <q=type> of <q=name> is a <I don't think there's an API shard for this one, it's a one-word description of your size>, <q=admirable> nation, renowned for its <q=notable>. The <q=sensibilities> population of <I don't think there's an API shard for this one, q=population doesn't do the "million"/"billion" processing> <q=demonym2plural> <I don't think there's an API shard for this one, but it's computable from q=category and a lookup table>.

User avatar
SherpDaWerp
Ambassador
 
Posts: 1233
Founded: Mar 02, 2016
Civil Rights Lovefest

Postby SherpDaWerp » Sun Jun 20, 2021 10:26 pm

Trotterdam wrote:Also, it can contain multiple values - if you only get one then that's because your nation only qualifies for one (this is the case for Testlandia, which the example link in the API manual uses).
Oh, right, my apologies. It's probably the case that I requested notable when I thought I was requesting sensibilities, tbh, I found myself getting mixed up between the three a decent amount while writing those posts. I was requesting of SherpDaWerp for most of them. Then again, I might have just clicked the link from the docs page, which always displays from Testlandia. :unsure:

Trotterdam wrote:The q=notable shard displays the comma-separated-list-of-three because that's how it's actually shown on your nation page.
Yeah, but (I was of the opinion that) none of the other ones display with sentence-formatting despite all of them having that on the page.
Trotterdam wrote:<I don't think there's an API shard for this one, it's a one-word description of your size>
I swear I'd seen those pop up in an admirable request, but double-checking confirms I'm wrong. It's not really my day today, huh.

So in hindsight, all three are actually displayed as-retrieved directly from a nation page, which I guess makes sense. But if redoing the three involves separating whatever code so that you can get them all instead of just calling whatever homepage-subroutine that gets values and formats them, then it would make sense for the three "singular" shards to return just one value with no formatting.

User avatar
Trotterdam
Powerbroker
 
Posts: 9560
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Sun Jun 20, 2021 11:05 pm

SherpDaWerp wrote:it would make sense for the three "singular" shards to return just one value with no formatting.
I don't think there's any interest in a "one randomly-selected value" shard. Generally, you'll want either the as-formatted-on-the-nation-page texts (what we have now, which is random for notables and admirables but not for sensibilities), or the full nonrandom list (currently available only for sensibilities, although comma-separated rather than XML-separated - not so much of an issue for sensibilities, where individual entries never include commas, but a notables list should definitely be XML-separated since some individual ones do include commas), to which you can then apply any post-processing you like (such as picking one) yourself.

The current randomized shards are already of pretty dubious use, the only reason they exist is because that's what appears on your nation page so the game already has a reason to generate them anyway. Practically anyone using the API rather than just casually browsing the site will almost always want reliable, nonrandom data.

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

Postby [violet] » Mon Jun 21, 2021 6:19 pm

SherpDaWerp wrote:Could the full list of notables and admirables that a nation is eligible for be made available through the API? Currently, you can only request admirable, notable which gives you one or three (respectively) of the eligible values for the nation. If you want to get the full list currently, you just have to keep requesting until you're pretty sure you've got them all, which is not a great approach.

What I have in mind is kinda similar to how the "banner" shard shows one randomly selected banner code from that nation, and "banners" shows all eligible banner codes from that nation.

Added as shard "notables".

User avatar
SherpDaWerp
Ambassador
 
Posts: 1233
Founded: Mar 02, 2016
Civil Rights Lovefest

Postby SherpDaWerp » Mon Jun 21, 2021 7:16 pm

[violet] wrote:Added as shard "notables".

Sweet, thanks! Although, no "admirables" with it?

I'm eligible for 18 of them, which is honestly a few more than I expected. I still support expanding the list, though. ;)

Trotterdam wrote:The current randomized shards are already of pretty dubious use, the only reason they exist is because that's what appears on your nation page so the game already has a reason to generate them anyway. Practically anyone using the API rather than just casually browsing the site will almost always want reliable, nonrandom data.

You make a good point, I was thinking more about "make them all identical" than any other reasonable deciding factor, like processing effort or use-cases. That said, I would almost say picking them all and choosing your own is generally a better approach for a user than requesting pre-formatted versions, because that would allow you to make your own sentences with them instead of exactly copying the gameside homepage.

User avatar
Trotterdam
Powerbroker
 
Posts: 9560
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Mon Jun 21, 2021 11:38 pm

[violet] wrote:Added as shard "notables".
Yay, thanks!

I'm using this now and it seems to work perfectly.

SherpDaWerp wrote:That said, I would almost say picking them all and choosing your own is generally a better approach for a user than requesting pre-formatted versions,
Almost? That's exactly what I said.

Although this discussion is moot point now since we already got what we wanted! Yay!

Well, half of what we wanted. I also support the addition of a q=admirables shard for completion's sake, but unlike q=notables, I have no intention to make use of it myself. So I'm happy now.

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

Postby [violet] » Wed Jun 23, 2021 12:48 am

Added "admirables" shard, too.

User avatar
SherpDaWerp
Ambassador
 
Posts: 1233
Founded: Mar 02, 2016
Civil Rights Lovefest

Postby SherpDaWerp » Wed Jun 23, 2021 1:05 am

[violet] wrote:Added "admirables" shard, too.

Wonderful news, thanks.

User avatar
Balasai
Lobbyist
 
Posts: 11
Founded: Feb 10, 2021
Iron Fist Consumerists

Postby Balasai » Mon Jun 28, 2021 3:00 am

I need an api shard which gives the rating index like wood chipping index without ranks

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

Postby Merni » Mon Jun 28, 2021 5:12 am

Balasai wrote:I need an api shard which gives the rating index like wood chipping index without ranks

See here.
Donate your free time
The Labyrinth |
RIP Residency 3.5.16-18.11.21, killed by simplistic calculation | TGW Warden | GA Committee List
OOC by default | Admins: Please allow blocking WA TGs!
E -8.0 S -3.18
Wrote 532 GA
meth
I've noticed that everybody that is for abortion has already been born. — Ronald Reagan (eww)
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
Indian andhra
Attaché
 
Posts: 80
Founded: May 01, 2021
Democratic Socialists

Postby Indian andhra » Thu Jul 08, 2021 12:50 am

https://www.nationstates.net/cgi-bin/ap ... nt=(Client Key)&tgid=(TGID)&key=(Secret Key)&to=(nation_name) this is not working it shows client not registered how I set it I filled all spaces

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

Postby Merni » Thu Jul 08, 2021 1:03 am

Indian andhra wrote:https://www.nationstates.net/cgi-bin/api.cgi?a=sendTG&client=(Client Key)&tgid=(TGID)&key=(Secret Key)&to=(nation_name) this is not working it shows client not registered how I set it I filled all spaces

Check whether your client key is correctly typed as you received it from the mods.
Also, in most cases it is much easier to use one of the existing Telegram API clients, rather than making requests manually yourself. This thread has all the information you need on the Telegram API and various clients available.
Donate your free time
The Labyrinth |
RIP Residency 3.5.16-18.11.21, killed by simplistic calculation | TGW Warden | GA Committee List
OOC by default | Admins: Please allow blocking WA TGs!
E -8.0 S -3.18
Wrote 532 GA
meth
I've noticed that everybody that is for abortion has already been born. — Ronald Reagan (eww)
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
Valentine Z
Postmaster-General
 
Posts: 11087
Founded: Nov 08, 2015
Scandinavian Liberal Paradise

Postby Valentine Z » Fri Jul 09, 2021 9:45 am

I would like to make a humble request regarding the Policies shard. https://www.nationstates.net/cgi-bin/api.cgi?nation=testlandia&q=policies

As of now, it only shows the policies that a nation has, not what it does not have. So, I was wondering if there is perhaps a way that is feasible to have a shard "all_policies" or something to that effect, alongside a value of 0 for that nation not having that policy, and 1 for having that policy (i.e. binary representation).

For example, 0 0 0 1 1 if you want to show that the nation has the last 2 policies.

-----

For the next data trawl, I can still do Python and XML wizadry to get what I want, but given how different nations have different numbers of policies, this will help me quite a fair bit of not having to deal with those different lengths. Thanks! ♥
Val's Stuff. ♡ ^_^ ♡ For You


Issues Thread 4th in Gen Sec Photography Stuff Project: Save F7.

The Sixty! Opinions Deposit! Valentian Stories! Gwen's Adventures! Cat Anthem! Valentian News.
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 !
Q & A Here! | Heights of NS! | F7 Etiquette

Clarissa mistaken for Smurf/Avatar: 14
Valentijn Misgendered: 59
Valentijn now a She!

• Never trouble trouble until trouble troubles you.
• As a wise man once said: 我等は砲兵 皇国の護り (We are Artillery Guardians of the Empire).
• World Map is a cat playing with Australia.

User avatar
Kringalia
Diplomat
 
Posts: 797
Founded: Feb 03, 2013
Civil Rights Lovefest

Postby Kringalia » Sat Jul 10, 2021 1:29 pm

Glen-Rhodes wrote:Would it be possible to include a "natives" shard in the region API, listing which nations count as "natives" for poll purposes?

Is there any chance this could be added? A way to check if a nation counts as a "native" and/or list all nations in a region that count as "native" would definitely be helpful.
Former Delegate of the South Pacific
Chief Justice and Security Councillor. Posts outside official venues should be taken as those of any other legislator.

Legal Resources: THE MATT-DUCK Law Archive | Mavenu Diplomatic Archive | Rules of the High Court | Case Submission System | Online Rulings Consultation System
Selected Achievements: Interviewed Max Barry | Tuesday Couper

User avatar
Wayneactia
Minister
 
Posts: 2482
Founded: Aug 01, 2014
New York Times Democracy

Postby Wayneactia » Fri Jul 16, 2021 11:38 pm

Glen-Rhodes wrote:Would it be possible to include a "natives" shard in the region API, listing which nations count as "natives" for poll purposes?

How exactly do you define a "native"? The only real native to a region is the founder, and even then they were spawned in a feeder.
Sarcasm dispensed liberally.

User avatar
Flanderlion
Minister
 
Posts: 2056
Founded: Nov 25, 2013
Iron Fist Consumerists

Postby Flanderlion » Fri Jul 16, 2021 11:51 pm

Wayneactia wrote:
Glen-Rhodes wrote:Would it be possible to include a "natives" shard in the region API, listing which nations count as "natives" for poll purposes?

How exactly do you define a "native"? The only real native to a region is the founder, and even then they were spawned in a feeder.

The same way as the game defines natives for polls - given this is about polls, and polls have a native option.
As always, I'm representing myself.
Information
Wishlist

User avatar
Balasai
Lobbyist
 
Posts: 11
Founded: Feb 10, 2021
Iron Fist Consumerists

About tg can recurit

Postby Balasai » Sun Jul 18, 2021 3:26 am

https://www.nationstates.net/cgi-bin/ap ... from=india I want to check for two nations but cannot how to do so

User avatar
Trotterdam
Powerbroker
 
Posts: 9560
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Sun Jul 18, 2021 5:50 am

Balasai wrote:https://www.nationstates.net/cgi-bin/api.cgi?nation=balasai&indian_andhra&q=tgcanrecruit&from=india I want to check for two nations but cannot how to do so
You have to check in two separate calls:
https://www.nationstates.net/cgi-bin/api.cgi?nation=balasai&q=tgcanrecruit&from=india
https://www.nationstates.net/cgi-bin/api.cgi?nation=indian_andhra&q=tgcanrecruit&from=india
You can only retrieve data from one nation at a time. (You can retrieve multiple pieces of data about the same nation in a single call, though, if there's anything else you happen to be interested in.) If you're making multiple calls, make sure to obey ratelimits, although this only matters once you exceed 50 calls total.

User avatar
Kringalia
Diplomat
 
Posts: 797
Founded: Feb 03, 2013
Civil Rights Lovefest

Postby Kringalia » Sun Jul 18, 2021 3:49 pm

Wayneactia wrote:
Glen-Rhodes wrote:Would it be possible to include a "natives" shard in the region API, listing which nations count as "natives" for poll purposes?

How exactly do you define a "native"? The only real native to a region is the founder, and even then they were spawned in a feeder.

A "native" is defined in the Region Control page as:
Region Control wrote:Natives: Nations that possess more Regional Influence here than in any other region.

An option to check if a nation qualifies as native, or to list native nations in a region, would be really helpful, for example to let anyone check their eligibility for poll-based elections in the South Pacific.
Former Delegate of the South Pacific
Chief Justice and Security Councillor. Posts outside official venues should be taken as those of any other legislator.

Legal Resources: THE MATT-DUCK Law Archive | Mavenu Diplomatic Archive | Rules of the High Court | Case Submission System | Online Rulings Consultation System
Selected Achievements: Interviewed Max Barry | Tuesday Couper

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

Postby Merni » Wed Aug 11, 2021 2:02 am

Could the list of API shards included in the Daily Dumps, and in the general query (such as https://www.nationstates.net/cgi-bin/ap ... tion=Merni ) be added to the API documentation page? I often have to download the dump and use a command to output the first few lines to find which exact shards are included in it, and including this info in the docs would be very helpful. Especially for the dumps, where you often can't open them straightaway in an editor due to their size.
Donate your free time
The Labyrinth |
RIP Residency 3.5.16-18.11.21, killed by simplistic calculation | TGW Warden | GA Committee List
OOC by default | Admins: Please allow blocking WA TGs!
E -8.0 S -3.18
Wrote 532 GA
meth
I've noticed that everybody that is for abortion has already been born. — Ronald Reagan (eww)
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
Eluvatar
Site Admin
 
Posts: 2408
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Fri Aug 13, 2021 12:48 pm

The Northern Light wrote:Bug report/request

Hi,

Recently, there have been at least two times when the event IDs in the World Happenings API were reset (I believe one was during the Zombie Apocalypse, and the second some time in the second half of November).

This has been very disruptive for my NS script ecosystem, resulting in most of them going idle for several days until I noticed and reset them. I was taking some time today to try and make my logging system more robust to such incidents, and realized that the root cause of the problem is what looks like a bug, or at least unexpected behavior, in the World Happenings API. Let me use an example to describe the issue:

Let's say I make a world happenings API call, fetch some happenings, and extract from them 123456 as the latest event ID. Then, event IDs are reset to a number smaller than that, say, 10. Then I make another world happenings API call, and use the modifier "sinceid=123456". Because of the reset, the call will return no happenings.

My guess is that "sinceid" assumes that event IDs are monotonically increasing. When this monotonicity assumption is broken (e.g., during the reset events), "sinceid" won't behave as expected.

As I said above, I believe this should be classified as a bug. It would be very convenient if this could be fixed, as it would mean that event ID resetting would not disrupt happenings logging scripts.

Thanks in advance.


As a note, the happenings API has experienced yet another happenings ID reset. Sorry about that!
Last edited by Eluvatar on Fri Aug 13, 2021 12:49 pm, edited 1 time in total.
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Reich Hungary
Secretary
 
Posts: 26
Founded: May 05, 2018
Ex-Nation

I my Ex-Nation please password send from e-mail link . !

Postby Reich Hungary » Sat Aug 14, 2021 7:59 am

Draycora please password send for e-mail , please send to me under [redacted]@gmail.com new password ex-nation !
Last edited by Frisbeeteria on Sat Aug 14, 2021 8:04 am, edited 2 times in total.
Reason: you can do that yourself using the Forgot Password link on the login page
| Stanislaw Maczek | FEDERAL PRESIDENT Reich Hungary | MEMBER OF THE UNITED NATIONS | and |
UNPROVEN EUROPA | LOBBYIST |

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Irionisca, Sovishtia

Advertisement

Remove ads