McVillano.9256:

I’m wondering how often i can program my api access
every second, every milisecond¿?…

Rawrfaec.6412:

There is no rate limit (yet) and the event API is real-time. That said, every millisecond is pretty crazy.

Debois Guilbert.6413:

I’m seeing response times from the API of about one second, but that is highly dependent on the route between me and the API server. Querying the server every millisecond might be considered a denial of service attack, so that is probably a bad idea. How often do you think it is reasonable to refresh a web page? I would use the answer to that question as a guideline for now.

Healix.5819:

If you really wanted to, yes, you could do requests every 1ms. Don’t assume you’ll be able to do it forever though. You also shouldn’t make needless requests, such as requesting the same resource more than once per second or constantly refreshing static data, such as the server or event names.

If you can estimate when you’ll need to update, you should base how often you update on that. For example, if you’re tracking events, update every 5s or so until it becomes active and once it ends, you shouldn’t need to update again for a while, which you can calculate over time by gathering start and end times.

marnick.4305:

Let’s assume for sake of argument that you can refresh as often as you like (which is technically not possible on your end). What would be a logical or good interval?

The definition of real time is to have data that is considered as accurate as necessary given the circumstances. For temperature measurements in a room, a measurement 15 minutes can be considered real time. So what’s real-time in GW2?

I would presume, for WvW, you’d want something that’s visible, which leaves you with the limit of eyes being at 24 fps or an update every 40ms, and that’s for people staring at the map without playing in WvW. Having an update every 200ms will be real time for all intents and purposes given active play.

In PVE, having an API call every second is more than plenty for almost all purposes. Most relevant calls are on hour-long timers, and a few minutes won’t make a difference.

Gilosean.3805:

In PVE, having an API call every second is more than plenty for almost all purposes. Most relevant calls are on hour-long timers, and a few minutes won’t make a difference.

With a few exceptions – the Maw metaevent can actually start and finish in under a minute (I only saw this once). So I think reasonable timing also depends on how many people you expect to swarm the event and finish it.

marnick.4305:

In PVE, having an API call every second is more than plenty for almost all purposes. Most relevant calls are on hour-long timers, and a few minutes won’t make a difference.

With a few exceptions – the Maw metaevent can actually start and finish in under a minute (I only saw this once). So I think reasonable timing also depends on how many people you expect to swarm the event and finish it.

If that happens, do you think it’d have made a difference? Such a time presumes overflow.

Gilosean.3805:

In PVE, having an API call every second is more than plenty for almost all purposes. Most relevant calls are on hour-long timers, and a few minutes won’t make a difference.

With a few exceptions – the Maw metaevent can actually start and finish in under a minute (I only saw this once). So I think reasonable timing also depends on how many people you expect to swarm the event and finish it.

If that happens, do you think it’d have made a difference? Such a time presumes overflow.

You mean the area was probably already overflowing? Maybe. The thing is that if we are relying on accurate timers and not hanging around the area, events probably won’t go into overflow before the event starts. So it could still make a difference.

I’d still say that for events that so many people are interested in, pinging more frequently is a good idea. Maybe not down to ms, but once every second. No need to do that for regular events though. Just have a the single-event queries for the metaevents with chests and get a general event dump every minute, something like that.

The Talcmaster.7391:

Well, a rule of thumb that we were given with the trading post API was no more than 5 calls/second. When that rule was given, there was a hard limit of 10 items at a time, so multiple simultaneous calls were necessary to pull in everything in a timely manner. Since most of these new API calls let you pull in all of the data at once (and doesn’t take an hour to do so), I’d say just don’t overlap. Last run of the events.json without parameters took me 6.5 seconds, so I would probably just run it every 7 seconds. Any faster would be presuming that your information is out of date before you even get it, which is a problem that can’t be solved by more runs anyways.

So if nothing else, wait for your previous call on that output to finish.

Killer Rhino.6794:

From this post here:

The event data is updated in real-time, and there is no perceptible delay between an event state changing on the game server and it being updated in the API view.

Feel free to update as often as you’d like, though you probably don’t need to update more often than every 30 seconds or so.