The Commerce APIs are now live!

#1 - Sept. 8, 2014, 2:52 p.m.
Blizzard Post

Hi API community,

We just want to let you know that the Commerce APIs are now live and available here:
http://api.guildwars2.com/v2/commerce/listings
http://api.guildwars2.com/v2/commerce/exchange

Documentation for these APIs will be added to the wiki at some point but it’s not ready yet. When it finished, it’ll be added to this page: http://wiki.guildwars2.com/wiki/API:Main

Thanks and have fun!

#19 - Sept. 11, 2014, 1:20 p.m.
Blizzard Post

Here’s a quick update about this API: the /v2/commerce/prices is now enabled and you can find documentation about it on the wiki: http://wiki.guildwars2.com/wiki/API:2/commerce/prices

#25 - Sept. 12, 2014, 5:25 p.m.
Blizzard Post

Are the result from,

https://api.guildwars2.com/v2/commerce/exchange/gems?quantity=100

live values (same values we can see in game) and not a delayed value like from GW2Spidy?

They are live values (with 60 seconds of caching) for all APIs except the /v2/commerce/prices one, which is cached for about 5 minutes.

#30 - Sept. 15, 2014, 1:32 p.m.
Blizzard Post

/v2/commerce/prices is what we show in search results on the TP and totally usable for places where absolutely up-to-the-minute data isn’t necessary.

/v2/commerce/listings is closer to being live data, but is also more expensive for us to retrieve. It may end up getting a longer cache time on it to avoid problems on the backend.

#34 - Sept. 16, 2014, 12:16 a.m.
Blizzard Post

/v2/commerce/prices is what we show in search results on the TP and totally usable for places where absolutely up-to-the-minute data isn’t necessary.

/v2/commerce/listings is closer to being live data, but is also more expensive for us to retrieve. It may end up getting a longer cache time on it to avoid problems on the backend.

I have a TP website and we use commerce/prices to update all the items.

I realize that they can’t be live, but going from 1 minute to 5 minutes is a huge difference when prices can change very quickly.

If it is stuck at 5 minutes, then I would switch back to using commerce/listings which seems to put a heavier load on the server as it takes longer to complete.

The cache times on those two APIs come from different places. /v2/commerce/listings I control, /v2/commerce/prices I do not.

That said, if /v2/commerce/listings starts stressing the commerce systems too much we’ll increase the cache time on the API frontends. Live data’s no good if folks are taking down the commerce servers to get it!

Try to use the right API for the data you need, basically.

#37 - Sept. 17, 2014, 2:20 p.m.
Blizzard Post

Does the BL inside the game use either listings or prices? You just made me think that, if the results are cached, then the data we see in-game isn’t live? Or does it use other mechanism unavailable to the API to be live?

The TP uses the same backend APIs that both /v2/commerce/listings & /v2/commerce/prices uses. It doesn’t go through the public API layer though.

/v2/commerce/prices has a caching layer on the backend API, so the TP is getting identical values to the public API.

/v2/commerce/listings is cached on the Public API layer (currently for 1 minute) because the public API gets hammered much harder than the in-game TP. This is mostly due to folks spidering for the entire state of the market every few minutes, which no user would ever be able to do from within the game.

#43 - Sept. 18, 2014, 4:23 p.m.
Blizzard Post

Most use-cases for the data in /prices don’t actually require the freshest data in the world. You can get it from /listings in that case if you do need data with a lower cache time, with the caveat that if it gets abused we’ll need to up the cache time on /listings until it isn’t much fresher than /prices.