These are chat archives for arenanet/api-cdi

23rd
Dec 2017
Quaggan BooOOoot
@QuagganBooOOoot
Dec 23 2017 16:23

API V2 request cache time
by XNum.2391 in API Development

Hello, ArenaNet,
I'm pretty new to GW2 API development and my first need/idea is to develop a small script to monitor gems exchange rate, so I could be notified when the rate is in desired intervals (e.g. 400 gems for <100 gold). I figured out how to use https://api.guildwars2.com/v2/commerce/exchange/coins, but the response is very confusing and it seems cached for some time, based on "quantity" param. While in the game the price is fluctuating, API still provides the same value.

This is an example of my script execution:
2017-12-23 10:57:09: https://api.guildwars2.com/v2/commerce/exchange/coins?quantity=1000000
2017-12-23 10:57:09: 100 gems = 25.77.00 400 gems = 103.08.00 800 gems = 103.08.00 1200 gems = 103.08.00 2000 gems = 103.08.00
2017-12-23 10:57:19: https://api.guildwars2.com/v2/commerce/exchange/coins?quantity=1000000
2017-12-23 10:57:19: 100 gems = 25.77.00 400 gems = 103.08.00 800 gems = 103.08.00 1200 gems = 103.08.00 2000 gems = 103.08.00
2017-12-23 10:57:29: https://api.guildwars2.com/v2/commerce/exchange/coins?quantity=1000000
2017-12-23 10:57:29: 100 gems = 25.77.00 400 gems = 103.08.00 800 gems = 103.08.00 1200 gems = 103.08.00 2000 gems = 103.08.00

New discussion in API Development:
Archomeda
@Archomeda
Dec 23 2017 16:28
this was a funny read
Werdes
@werdes
Dec 23 2017 21:35
so the gem exchange rate has a cache time longer than 10 seconds? shocking