Page 44 of 97

PostPosted: Fri Oct 09, 2015 10:45 am
by Frisbeeteria
The United Island Tribes wrote:I need a way to ban myself from the api to test and fix how my python module handles api temp bans.

Easy enough. File a GHR from the nation holding an API recruitment key and we can lock you out. If you don't have one, go found a region with a puppet and request one, then explain about the lock testing.

PostPosted: Fri Oct 09, 2015 11:09 am
by The United Island Tribes
Frisbeeteria wrote:
The United Island Tribes wrote:I need a way to ban myself from the api to test and fix how my python module handles api temp bans.

Easy enough. File a GHR from the nation holding an API recruitment key and we can lock you out. If you don't have one, go found a region with a puppet and request one, then explain about the lock testing.


Are you saying my telegram api client_key needs to be locked out? I rather keep one key operation. Am I allowed to have two api keys? (two separate regions of course)

PostPosted: Fri Oct 09, 2015 11:35 am
by Frisbeeteria
The United Island Tribes wrote:Am I allowed to have two api keys? (two separate regions of course)

AFAIK, several people manage recruiting puppets in multiple regions. You are allowed only one API key per region, but there's no rule that says you can't have multiple regions.

PostPosted: Fri Oct 09, 2015 1:32 pm
by HMS Unicorn
HMS Unicorn wrote:Would it be possible to add an option for the Happenings shard in the World API that allows restricting results to before or after a timestamp?

This would be similar to the "sinceid" and "beforeid" optional parameters, but instead of specifying event IDs we would specify a timestamp.

Currently, if I want to fetch happenings of some sort that happened during, say, the last 6 hours, I need to make multiple API calls using the sinceid option, decrementing the event ID until I encounter an event with a timestamp more than 6 hours old. With my suggested addition, I would be able to do the same with one API call.

Thanks in advance.

Bumping this to make sure it is not forgotten. It'd be great if the Happenings option I describe could be added. Thanks again.

PostPosted: Fri Oct 09, 2015 4:59 pm
by Zemnaya Svoboda
The United Island Tribes wrote:
Frisbeeteria wrote:Easy enough. File a GHR from the nation holding an API recruitment key and we can lock you out. If you don't have one, go found a region with a puppet and request one, then explain about the lock testing.


Are you saying my telegram api client_key needs to be locked out? I rather keep one key operation. Am I allowed to have two api keys? (two separate regions of course)

Use mock-nationstates. It's quite happy to ban you from your mock NS API server for spamming, and you don't harm anyone while doing so

PostPosted: Sat Oct 10, 2015 12:10 pm
by Zemnaya Svoboda
Is there any chance of a region zombie shard being added? (The total dead, survivors, and zombies, like for the nation zombie shard, is what I'd have in mind)

Could I also suggest adding a national happening for adopting a zombie policy? (Whether export, exterminate, research, or none at all).

PostPosted: Sun Oct 11, 2015 7:00 pm
by [violet]
The United Island Tribes wrote:I need a way to ban myself from the api to test and fix how my python module handles api temp bans.

It's no problem to spam it now and again. It will just auto-ban you for 15 minutes; it won't mark it down on your permanent record.

Just FYI, the best deliberately bad API request you can do is probably this:

http://www.nationstates.net/cgi-bin/api.cgi?a=sendtg

... since it will immediately error out as malformed on our side without attempting any more expensive checks.

PostPosted: Sun Oct 18, 2015 2:00 am
by Eluvatar
A few things.




In desperate hope of inducing admin to look kindly on my earlier request, I present yet another run of wa_members_validator output:

The following nations listed in http://www.nationstates.net/cgi-bin/api ... /q=members are not WA nations:

Worse, the following WA nations are not listed in http://www.nationstates.net/cgi-bin/api.cgi/wa=1/q=members:





I'd like to put forward my Trawler modules which I have now made a topic for in Technical. It may be appropriate to link to that topic from the API help page, if you find the topic usable.

PostPosted: Tue Oct 20, 2015 3:41 pm
by [violet]
Zemnaya Svoboda wrote:Is there any chance of a region zombie shard being added? (The total dead, survivors, and zombies, like for the nation zombie shard, is what I'd have in mind)

Added, and updated API doc.

PostPosted: Wed Oct 21, 2015 5:36 pm
by Trotterdam
[violet] wrote:Added, and updated API doc.
Thanks, this will be a great help!

But one thing: the API currently returns nothing unless the zombie event is active. Could you make it so that, outside of a zombie event, it returns that data as of the end of the last zombie event? Not so much because I still care about that data eleven months later (though a debriefing immediately after could be nice), but so that I have sample data I can test my program with before the event starts :)

PostPosted: Wed Oct 21, 2015 9:54 pm
by [violet]
Trotterdam wrote:Could you make it so that, outside of a zombie event, it returns that data as of the end of the last zombie event?

Done, but be aware it may be unreliable outside of Z-Day, beforehand because we sometimes run tests, and afterward because it won't continue to track populations accurately (so # of survivors will grow but not dead or zombies).

PostPosted: Thu Oct 22, 2015 12:36 pm
by Trotterdam
[violet] wrote:because it won't continue to track populations accurately (so # of survivors will grow but not dead or zombies).
I am aware of this.

It happens even during the apocalypse, since it lasts longer than 24 hours, so there's a population-increasing tick in the middle. It can cause survivors to suddenly appear in a previously-dead nation.

It's not a problem for me though, I just need numbers, they don't need to be correct numbers.

Thanks.

PostPosted: Thu Oct 22, 2015 2:34 pm
by Frisbeeteria
Trotterdam wrote: I just need numbers, they don't need to be correct numbers.

1
2001
3.14159
149,597,870,700
1.414213562373095
-1
2.6854520010
−1.1×10−12

There ya go.

PostPosted: Wed Oct 28, 2015 4:11 pm
by HMS Unicorn
Would it be possible to add shards to the Region API for:

1) Regional Officers. Ideally, this would return both which nations are ROs and what powers each RO has. However, even just listing the ROs without specifying their powers would be very helpful.

2) Recruitment Settings. Ideally, this would return whether the region has activated one of the standard options (API only, officers only, etc.), or the list of authorized nations.

For (1), I'm primarily interested in gathering some statistics for large regions. Though more generally, given that the founder and delegate information are available through the API, I believe it'd make sense to also make available regional officers.

For (2), I frequently need to authenticate whether a nation has recruitment permissions for a given region.

In both cases, this information can be grabbed from the regional administration page, but it'd be a lot more efficient if the API could be used instead. I expect both of these shards will be useful to other players for similar reasons.

Thanks in advance!

PostPosted: Wed Oct 28, 2015 4:15 pm
by The Blaatschapen
HMS Unicorn wrote:Would it be possible to add shards to the Region API for:

1) Regional Officers. Ideally, this would return both which nations are ROs and what powers each RO has. However, even just listing the ROs without specifying their powers would be very helpful.

2) Recruitment Settings. Ideally, this would return whether the region has activated one of the standard options (API only, officers only, etc.), or the list of authorized nations.

For (1), I'm primarily interested in gathering some statistics for large regions. Though more generally, given that the founder and delegate information are available through the API, I believe it'd make sense to also make available regional officers.

For (2), I frequently need to authenticate whether a nation has recruitment permissions for a given region.

In both cases, this information can be grabbed from the regional administration page, but it'd be a lot more efficient if the API could be used instead. I expect both of these shards will be useful to other players for similar reasons.

Thanks in advance!


On number 1: Ideally, I would also like to see the names of the offices being returned; also in the daily dumpfile, so I can run naughty word filters on it (I should run one again soon) :)

PostPosted: Wed Oct 28, 2015 4:16 pm
by Misley
HMS Unicorn wrote:Would it be possible to add shards to the Region API for:

1) Regional Officers. Ideally, this would return both which nations are ROs and what powers each RO has. However, even just listing the ROs without specifying their powers would be very helpful.

2) Recruitment Settings. Ideally, this would return whether the region has activated one of the standard options (API only, officers only, etc.), or the list of authorized nations.

For (1), I'm primarily interested in gathering some statistics for large regions. Though more generally, given that the founder and delegate information are available through the API, I believe it'd make sense to also make available regional officers.

For (2), I frequently need to authenticate whether a nation has recruitment permissions for a given region.

In both cases, this information can be grabbed from the regional administration page, but it'd be a lot more efficient if the API could be used instead. I expect both of these shards will be useful to other players for similar reasons.

Thanks in advance!

#1 would be very useful, particularly if it included powers granted to the Founders (regions with non-executive founders, for example) and WA Delegate now that it's not a binary "executive"/"non-executive".

PostPosted: Wed Oct 28, 2015 4:27 pm
by HMS Unicorn
Misley's post reminded me that I also wanted to ask for an API-based way to tell whether a Founder or Delegate is executive or non-executive. As far as I can tell from an (admittedly not thorough) search, there's currently no such information available through the API.

Providing this information in the way Misley suggests is perfectly fine as far as I am concerned.

PostPosted: Wed Oct 28, 2015 6:19 pm
by Zemnaya Svoboda
Seeking to be grateful for the new Influence Ranks, another run of the WA membership validator:
The following nations listed in http://www.nationstates.net/cgi-bin/api ... /q=members are not WA nations:

Worse, the following WA nations are not listed in http://www.nationstates.net/cgi-bin/api.cgi/wa=1/q=members:


(Edit: reminder: the pages tend to shift, sometimes quite quickly).

Pretty pretty please, Dear [Violet]. :)

PostPosted: Tue Nov 03, 2015 10:29 am
by Athretvari
Can GDP or (better yet) GDP per Capita be added to the API? Also, black market and state-owned industries percents?

It would really open it up for economic calcs.

AiDataOne | Athretvari

Right now I can pull nearly everything I need via the API except GDPPC, black market, and state owned percents, which I'm inputting manually via a factbook page that is read by my spreadsheet.

PostPosted: Wed Nov 04, 2015 4:20 am
by Laevendell
Athretvari wrote:Can GDP or (better yet) GDP per Capita be added to the API? Also, black market and state-owned industries percents?

It would really open it up for economic calcs.

It would also be very nice for NSDroid!

Also, for the zombie data, I was thinking of making a special zombie-part in the app for next year and was hoping we could get the infection rate, research status etc. for the region in the API before then? If anyone has any suggestions about this part in the app, please let me know in the NSDroid thread.

Finally, it's time for the semi-regular question about a logged-in API. Perhaps someone has had time to take a look at it by now and has some input?
Refer to: viewtopic.php?p=23479734#p23479734

PostPosted: Fri Nov 20, 2015 7:02 am
by ValosaCAtX
Cards against nations states isn't working.

PostPosted: Fri Nov 20, 2015 7:06 am
by The Blaatschapen
ValosaCAtX wrote:Cards against nations states isn't working.


There's no API for Cards against NS. So that makes sense.

PostPosted: Mon Nov 23, 2015 2:09 am
by Zemnaya Svoboda
I hate to sound like a broken record, but there are those who rely on the WA members list.

The following nations listed in http://www.nationstates.net/cgi-bin/api ... /q=members are not WA nations:

Worse, the following WA nations are not listed in http://www.nationstates.net/cgi-bin/api.cgi/wa=1/q=members:

PostPosted: Mon Nov 23, 2015 5:52 pm
by [violet]
Per requests above, added more shards.

To Nation shards:
  • gdp
  • sectors
  • income
  • poorest
  • richest

To Region shards:
  • officers
  • delegateauth
  • founderauth

PostPosted: Mon Nov 23, 2015 5:56 pm
by Misley
[violet] wrote:To Region shards:
  • officers
  • delegateauth
  • founderauth

Any chance these could be added to the daily dumps?

edit: Also, any chance "delegateauth" could still report the authorities granted to an unfilled Delegate seat?