Senji.4326:

(apologies if this has been asked before, I couldn’t find it)

Repro:
https://api.guildwars2.com/v2/items?ids=37090,66924,43766

The items in the JSON come back 43766, 37090, 66924
(Actually it appears they come back in random order, I just hit that same URL again and got a different order)

I’m attempting to use the API in combination with ImportJSON in a google spreadsheet.
For the most part this works great! However when I have a query that pulls back only Item IDS, and I want to see the name (or other info) about that Item, it doesn’t work because the order that is returned is different than the requested order.

I end up with something like:

ID Name
437666 Rurik’s Royal Signet Ring
37090 Ralena’s Band
66924 Black Lion Chest

(If you look up those IDS, you can see it’s completely wrong)

Is there a way I can tell the API to please return the JSON for the items in the order requested? I really don’t want to have to learn the scripting language myself well enough to do it during the JSON parse …

Thanks!

Senji.4326:

Additionally, does the API for items support a POST request so that I can avoid having to do a bunch of separate queries for many IDs without hitting URL limitations?

smiley.1438:

The returned items are completely unordered due to the asynchronous behaviour of the backend (i believe Lawton or Pat explained that somewhere over here).

Also, the URL size problem has already been discussed. We’ve agreed to just use ~200 IDs (which is a bit below 4096 bytes, Internet Explorer URL max size).
Also: this https://forum-en.guildwars2.com/forum/community/api/help-with-making-a-list-of-item-names/5267994

The API only currently allows a max of 200 results/request

Senji.4326:

Sigh. That’s disappointing. Now I have to learn spreadsheet scripting to try to parse the URL to get the list of IDs, and then sort the resulting JSON the same way. Anyone have anything like that for google spreadsheets that does that already?

DistantStatic.6098:

If you can, just throw it all into a database and update it as people access certain items.

Lawton Campbell.8517:

The returned items are completely unordered due to the asynchronous behaviour of the backend (i believe Lawton or Pat explained that somewhere over here).

That’s pretty much it. I’m going to put an item on the backlog to return them sorted when a specific set of ids is requested — there’s no reason not to.