Frequency of queries
Hi Kyle,
afaik there is no limitation for queries. But it’s no good programming style to flood the api. Try to cache the data as long as it is possible and fetch the data as often as it’s necessary :-). Keep in mind, that an API-Call uses some time (to connect, fetch, disconnect, etc.) and try to use some API-specific options (e.g. ids=all and pagination) to call the api less often.
Greetings
Chris
GuildWars2 sPvP-Tracker: http://www.gw2pvp.de
Tradingpost in your Pocket: http://www.tp2go.de
Most endpoints have a 5 minute cache on anets side, so there’s not much point in querying any more often than that.
One exception is /v2/wvw/matches or the v1 equivalent which seem to be more or less real time.
Tarnished Coast – Dissentient [DIS]
All classes
Hey,
for sure I am using the options to get multiple items with ids=… . I figured out, that there is a maximum of 100 IDs, that are possible? So when trying to query n items I still have send n/100 queries to the API.
Can I find any information about the refreshing rate of the api? Prices at the TP change very fast – so it isn’t even possible to get the real-time-prices?
Regards
Kyle
Web Programmer
Hey,
for sure I am using the options to get multiple items with ids=… . I figured out, that there is a maximum of 100 IDs, that are possible? So when trying to query n items I still have send n/100 queries to the API.
There’s a maximum of 200 ids/request, you may be hitting IIS’s URL length limit. You can also use the ?page_size=200&page=X parameters to paginate through the resources if you’re hitting the URL length limit.
Can I find any information about the refreshing rate of the api? Prices at the TP change very fast – so it isn’t even possible to get the real-time-prices?
All endpoints currently have a 5-minute cache. The cache is necessary to decouple the API from game services so that an API catastrophe does not cascade to other services.
If you’re only interested in the current price (and not every listing available) I highly recommend using /v2/commerce/prices instead (as it has a much lighter footprint on our backend).