API talk:2/items

From Guild Wars 2 Wiki
Jump to navigationJump to search

Ids Parameter Length Limit[edit]

It might be good to note that this endpoint is limited to 200 id requests at once. —Yasvisu (talk) 09:52, 12 December 2014 (UTC)

That applies to the whole paging mechanism of v2. I noted the limit here. poke | talk 18:56, 13 December 2014 (UTC)
https://api.guildwars2.com/v2/items?ids=19684,19709 is the form used to query multiple ids at once Separ (talk) 19:11, 7 September 2015 (UTC)

Item discovery[edit]

As the endpoint takes an item id, how do you discover the id of an item using it's in game name? Neon (talk) 14:48, 2 March 2015 (UTC)

Type /wiki, then Space, then shift+click on the item, then hit Enter. That will bring you to the wiki's search page which will decode the item's chat link and show you the ID. —Dr Ishmael User Dr ishmael Diablo the chicken.png 16:00, 2 March 2015 (UTC)

Add ids parameter[edit]

Why isn't the ids parameter listed on the page? I would think that should show up, albeit it would be desirable to report the noted limit (see other section here) nearby so people know from the get go.

searching item by recipe ID[edit]

Heya, so I've been trying to do a search slightly differently than I have before and I'm running into issues.

If we look at https://api.guildwars2.com/v2/items?id=78680, we see

{"name":"Recipe: Small Flute","type":"Consumable","level":0,"rarity":"Masterwork","vendor_value":0,"game_types":["Wvw","Dungeon","Pve"],"flags":["AccountBound","NoMysticForge","NoSalvage","NoSell","AccountBindOnUse"],"restrictions":[],"id":78680,"chat_link":"[&AgFYMwEA]","icon":"https://render.guildwars2.com/file/027D1D382447933D074BE45F405EA1F379471DEB/63127.png","details":{"type":"Unlock","unlock_type":"CraftingRecipe","recipe_id":11807}}

The part which interests me is <"recipe_id":11807>. What I would like to do is be able to type in "11807" and get the value <id=78680> in return. The goal here would be to have a recipe ID, and figure out which recipe sheet is used to discover the recipe.

To be clear, simply doing https://api.guildwars2.com/v2/recipes?ids=11807, does NOT return the recipe sheet ID but instead the crafted item ID. -Darqam (talk) 16:48, 25 April 2016 (UTC)

Can't directly help solve this, but I can't point out two things.
  1. The Recipe ID's that get unlocked can appear in two separate locations, "recipe_id" which contains a single ID, and "extra_recipe_ids" which can contain multiple ID's, as seen on https://api.guildwars2.com/v2/items/74718
  2. Taking a look through https://forum-en.gw2archive.eu/forum/community/api may give you some idea as to what can be done, and what's in the works. Posting on there may get some faster responses from community members and the devs concerning the API usage.
Hope this helps. G R E E N E R 17:03, 25 April 2016 (UTC)
(Edit conflict) Um, I don't think doing the search that way around works. You could however scrape the entire items database, store it locally and then CTRL+F the recipe id you wanted ><. -Chieftain AlexUser Chieftain Alex sig.png 17:04, 25 April 2016 (UTC)
Damn, I was hoping I just couldn't figure it out and there was some fancy way to do it :(. Thanks Greener for showing that link, I might go there, but I was hoping for a currently working system, not one in the future :p. As for your suggestion Chieftain; I thought of that, but don't have the means to do that at the moment. If I still care for it at a later point I might bother finding a work-around like that, but not for now I guess. -Darqam (talk) 17:19, 25 April 2016 (UTC)
I did bring this to Lawton's attention, so there may be an API feature that supports this in the future, but I can't say when it would be implemented. Eearslya (talk) 17:33, 25 April 2016 (UTC)
@Darqam, I've uploaded a spreadsheet with the json results that contained a recipe_id here, you can do a crude search through it. (My pc didn't like the full items api being in one text document). -Chieftain AlexUser Chieftain Alex sig.png 17:37, 25 April 2016 (UTC)
Thanks for that Eearslya. Chieftain, thanks for the link I'll confirm a few things with it (still requires more copy-pasta than I'd like, but this already cuts the work down quite a bit); thanks! -Darqam (talk) 17:42, 25 April 2016 (UTC)

new addition, "stat_choices"[edit]

It seems a recent addition was made to the items, in that the API now shows which stats are selectable by it (WOOOOO!). See for example Malicious Xera Backpiece (Infused). The stats correspond with those shown in API:2/itemstats. -Darqam (talk) 16:04, 29 June 2016 (UTC)

2016-07-26 update[edit]

Infusion slot subobject
flags – now always an empty array. Offensive, Defensive, Utility, Agony doesn't exist.
item_id – known ids are now [49428, 78028, 78052].
Note: If no infusion slot is present, the value of the infusion_slots property is an empty array. If Enrichment or Infusion slots exist, then the list will contain that many subobjects.

--BryghtShadow (talk) 07:32, 1 August 2016 (UTC)

Consumable Food: New properties[edit]

Hi, I just saw that there are 2 new properties in https://api.guildwars2.com/v2/items/12452 --> apply_count (number) and name (string, translatable) are not yet documented. Also the example code needs to be updated with the new response. The preceding unsigned comment was added by Leylin (talkcontribs) at 15:30, October 16, 2016‎ (UTC).

Thanks for the heads up, edited it for now. -Darqam (talk) 17:01, 16 October 2016 (UTC)

New possible enum values[edit]

While syncing my local item database i encountered some new enum values in the /items endpoint:

flags:

  • Attuned
  • BulkConsume
  • DeleteWarning
  • Infused
  • Tonic

restrictions:

  • Female

--Richardreloaded (talk) 18:17, 6 October 2017 (UTC)

I'll take a look, where did you see that restriction by the way? -Darqam 18:41, 6 October 2017 (UTC)
On the item "Order of Shadows Intel Report" (https://api.guildwars2.com/v2/items/84141). Seems like a mistake to me. --Richardreloaded (talk) 11:18, 7 October 2017 (UTC)
That's.... strange. I'm going to poke lye about this. -Darqam 23:29, 7 October 2017 (UTC)

New consumable type: RandomUnlock[edit]

Guaranteed Armor Unlock Check the API for this one. J.Tesla (talk) 20:07, 14 December 2017 (UTC)

Added it, sorry hadn't noticed this post earlier. -Darqam 16:22, 17 December 2017 (UTC)

new type, "Key"[edit]

Just found a reference to item ID:82444 "Exotic Florid Bouquet" under a section titled "Key" 146.200.52.128 15:27, 15 July 2018 (UTC)

I believe "type": "Key" shouldn't be appearing for items since the key storage was added (and key items were generally removed). Also, all of the other items for this series of collections are correctly listed as "Trophy". This item should be showing as a trophy, so I believe this is probably a bug in the API itself (and quite possibly the API is grabbing the details for the developer version of this item instead of the live version.) Bandlero (talk) 20:40, 15 July 2018 (UTC)

upgrades_into, upgrades_from[edit]

My code stumbled upon an unknown and currently undocumented field. Item 37000 (Quiver of a Thousand Arrows) has a field upgrades_into, which is an array containing one object with the fields upgrade and item_id. The value of item_id is 49365 (Quiver of a Thousand Arrows (Infused)). That item has the reverse info: upgrades_from pointing to the uninfused item. Both have upgrade = "Infusion" which I believe to be an enum.

I haven't checked the whole database if there are other items or other types of upgrade. 79.243.28.119 23:24, 6 November 2019 (UTC)

Good catch! Haven't seen that field before, either! I'll see if I can quickly enumerate the possibilities of upgrade and get it added to the page. Eearslya (talk) 00:03, 7 November 2019 (UTC)

auto "casting" number strings to numbers[edit]

The first example on this page does not conform to the given schema. The 'default_skin' property of an Item is supposed to be a number (the schema says "(number, optional)", however in the example the actual value is a string with a numeric value in it. Is this allowed? In general, are we just supposed to parse "number" strings to actual numbers whenever they occur? Dtrombley (talk) 05:16, 22 April 2020 (UTC)

This was an error within the example. The actual endpoint does return a number value; I've fixed it now. I haven't been maintaining this namespace recently, but every documented value type should be able to be taken literally, with no casting required. Eearslya (talk) 18:59, 22 April 2020 (UTC)

Gizmo vendor_ids optional and Infix upgrade subobject new attribute[edit]

I was just implementing a type validator for my API calls when I noticed two things:

  • Gizmo details: vendor_ids is marked as (array of numbers) even though it seems to be missing on some gizmos and therefore should be marked as optional (example).
  • Infix upgrade subobject: Missing attribute value AgonyResistance. Found on some items (example). - Nimmi (talk) at 20:27, 24 May 2021‎ (UTC).
tweaked it. Let me know if anything else needs changing. -Chieftain AlexUser Chieftain Alex sig.png 21:58, 24 May 2021 (UTC)