gamedig / node-gamedig

Query game servers and not only! Node.JS/Deno/Bun or Bash (via the CLI).
https://www.npmjs.com/package/gamedig
MIT License
593 stars 146 forks source link

Question: API limit concern #249

Closed menix1337 closed 2 years ago

menix1337 commented 2 years ago

Hey!

I'm using GameDig in my daily workflow to track servers - this is more of a question i guess, since i can't find anything related to the topic.

Are you guys aware of any API limits regarding this? Lets say if i fetch a server info each second for the next month (Obviously this isn't recommended) - like, i would assume there would be a API Limit somewhere (I would mostly guess steam?)

Or is it straight on 'spammable'

mmorrisontx commented 2 years ago

It really depends on the game. Some games, including most of valve's (tf2, csgo, other srcds games) will temporarily stop responding to query packets if you hit it too often. I'd say that once per minute is probably safe for all servers, maybe even every 30 seconds, but beyond that you may risk being rate limited. I haven't given it too much research though, so you may need to experiment if you really want to push the limits.

menix1337 commented 2 years ago

It really depends on the game. Some games, including most of valve's (tf2, csgo, other srcds games) will temporarily stop responding to query packets if you hit it too often. I'd say that once per minute is probably safe for all servers, maybe even every 30 seconds, but beyond that you may risk being rate limited. I haven't given it too much research though, so you may need to experiment if you really want to push the limits.

I just checked an old script i had laying on a Dedicated Server from a bot. For the past year its been pulling data from 6 gameservers through gamedig ~ each 5 seconds. -And it looks like that has been running smooth actually, without timeouts or API breaches.

So I'll give it a go at 5 seconds for my new stuff here & see how it goes! 👯‍♂️

cetteup commented 2 years ago

Just to share some insight here: I am hitting quite a few Battlefield servers every 20 seconds. Have yet to see any issues.

Game No. of servers
BF1942 104
BF Vietnam 6
BF2 179
BF2142 13
BF3 131
BF4 968
BFH 27

BF4 went up to 1,600 servers when it was "free" via Prime Gaming recently. Still worked flawlessly.

mmorrisontx commented 2 years ago

Almost all query protocols operate directly with the remote servers, not some shared central api, so there is no "shared" limit between them all. As long as you keep the per-server rate low enough to keep each individual server happy, it shouldn't matter how many you query -- they're all independent.

There is one caveat. If you get on the radar of some big game server provider, they may block you at their firewall if they feel your traffic is abusive in some way. Just a theory.