Kyle Corver.1897:

Hi guys,

I have a question regarding the number of queries, that can be send to the API to obtain Information. My goal is to write an application that frequently updates the trading post data (price, numoffers) etc. of a specific list of items.

Now I want to know if there is a limitation to the number of queries that are allowed to send to the API (per hour/minute/etc.). I don’t want my IP to get banned for spam or similar ^^

Regards

Kyle

sookya.8625:

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

Nabrok.9023:

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.

Kyle Corver.1897:

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

Lawton Campbell.8517:

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).