#API Changes

1 messages · Page 1 of 1 (latest)

static lion
#

Here are some API changes, or additions, i'd like to see:

/api/guild/

  • I'd like to see for the online_players part the uuid of the players aswell.
  • I'd love to see searching for guilds by uuid

uhh thats all really, atleast that i've seen and wanted

#

maybe it'd be cool to add the raid info from /api/database/guild to the /api/guild/ shit

tender ocean
#

these are good suggestions!
i'd be down to add them the next time i work on the api
(i have free time in june, in case i don't get to it in may)

tender ocean
static lion
#

happens

#

also @tender ocean, is the ratelimit shown in the docs accurate? keep-alive header suggests its 100 ratelimit

static lion
#

all of the ones i've tried

#

thats /api/database/guild

#

which shows 180/m on docs

tender ocean
#

just checked the backend, technically it's 3/sec, yielding a net total of 180 per min

#

so perhaps you did a burst of request in the interval of a sec and only 3 went through? it depends on how your request is set up

#

other than that, there could be something funky with the load balancers i set up last month (for the web game that was deployed), im not sure if that's related tho, need to investigate further

static lion
#

i dont think i've hit ratelimits, was just manually looking, as I'd like to ratelimit myself to not get ratelimited by the api

tender ocean
#

mmm i see

#

about half of those endpoints are actually rated by second, with exceptions like get item is 300/min

static lion
#

if anything i'd like to get keep-alive or another header to reflect the current ratelimit remaining, and also x/min makes much more sense than /second

#

its the same thing at the end of the day, but limiting myself is easier when i have a bigger number to work with

tender ocean
#

that's fair, I don't remember the exact reason they were made in /s instead of /min. if i had to guess, it was designed to protect backend's stability and latency, for some endpoints there were an absurd amount of requests in burst, but guild wasn't one of them.

tender ocean
static lion
#

yeah I can assume that sending 180 requests in a 10s interval would be a bit hard to process

tender ocean
#

haha, if it's just 180 in 10s it should be okay, but at one point i was getting a couple thousands in a split second

#

mostly for item-related stuff

static lion
#

ah

#

ig just badly implemented code spamming your api

tender ocean
#

could be yeah, the api is fully public so i rlly don't block anyone unless its malicious.
i've seen someone's in-game macro would scan pages of items in their bank/market and request item analysis via nori in bulk

#

anyway, let's keep this thread open, I am hoping to get to these in the next month or so, after the crowdsourcing mod's server handling is full integrated i would say.

opal auroraBOT
#

rawfish69#0: api things - merge guild info, add uuid to players, add guild uuid query, change rate limit to /min based. <t:1748458329:R>

static lion
#

also i just noticed, this isnt a big thing but multiple responses is getting killed

#

id assume its also happening on other endpoints

static lion
#

back to back, im seemingly getting a http code 200 for a server error, which is odd because when I request the same url that its failing on in my browser it works normally

2025-05-01 20:58:51 - INFO     - discord: https://nori.fish/api/player/e4b79fc5-a5f3-4fa5-a7e4-667167473d63,
2025-05-01 20:58:52 - WARNING  - discord: True
2025-05-01 20:58:52 - WARNING  - discord: <Response [200]>
2025-05-01 20:58:52 - INFO     - discord: {'error': {'msg': 'Expecting value', 'doc': '\n<!doctype html>\n<html lang="en">\n<head>\n  <title>Server Error (500)</title>\n</head>\n<body>\n  <h1>Server Error (500)</h1><p></p>\n</body>\n</html>\n', 'pos': 1, 'lineno': 2, 'colno': 1, 'response': None, 'request': None}}
#

the prints in question just being
url, arbitrary boleen based on response code, request, then request.json()

tender ocean
#

oh what

#

that's weird

#

I could take a look over the weekend, still a bit occupied as of now, thanks for letting me know.

static lion
#

it seems i had a misplaced comma.

#

though it still shouildve repsponded 500

tender ocean
#

oh hmm

#

will look into this this week.. still a bit busy atm

opal auroraBOT
#

@tender ocean api things - merge guild info, add uuid to players, add guild uuid query, change rate limit to /min based.

static lion
#

@tender oceanthoughts on this og

tender ocean
#

oh hey soz it's been a while, haven't really touched nori in a hot minute

#

been on vacation and other stuff after a big project

opal auroraBOT
#

rawfish69#0: [Backend] revisit api changes <t:1751098588:R>

static lion
#

allg dw

#

just happened to start trying to optimize my api usage and rethought about this

tender ocean
#

yeah fair, the thing is that once I changed endpoint stuff things may break for existing apps, so those would need to be handled as well

static lion
#

it shouldnt be toooo bad, just changing from x/s to x/m, the header will require existing apps to adapt to though

opal auroraBOT
#

@tender ocean [Backend] revisit api changes

tender ocean
#

I was talking about the guild endpoint merge haha, if it's not desperately needed I'd rather leave it as is for now. We are trying to get an endpoint for market stuff at one point so that comes first

#

The rate limiting I'll take care of tonight very soon (currently out atm, will be home tmrw nite)

static lion
#

Oh I forgot about endpoint merging

tender ocean
#

that one might break a few things

static lion
#

very possibly

tender ocean
#

Hey @static lion, I added some changes to the throttling rules - for the database/guild endpoint rate limit is raised to 300/m, instead of 3/s, the same applies for all leaderboard endpoints (player, profession, and guild) as well as server uptime. (not sure who needs uptime 300 times a min..)
however player and guild endpoint are reduced to 90/m (due to poor optimization atm), you may want to use official player/guild endpoint as fallback in case the limit is hit.

#

sry for the massive delay to this smol change i have not been touching wynn related stuff at all for months

static lion
tender ocean
static lion
#

not time sensitive at all, just adding this because uuid is better than prefix searching, but guild uuid searching is a goated add

static lion
#

also a bit of 500's on guild endpoint, doesnt seem to be on player endpoint atleast I havent ran into it

#

happened a few times in the past hour

tender ocean
#

does it happen around a specific time, if it's just a minute or so out of the hour, it could be you guys requesting /guild while database/guild runs the bulk fetch and update (from official wynn), smth could have gone wrong, i will have to check that part. i thought lowering the rate would reduce that tbh

#

tho the db runs on a separate pool of IPs

#

yeah knowing the timestamp and if there's a pattern would help

#

i run a bunch of jank on my server so one of the apps could have spiked the resources or smth

static lion
#

times dont look out of the ordinary

#

though i guess they are usually more torwards the end of the minute

tender ocean
#

hmmm idk tbh will have to dig a bit deeper