AQ Closet

The API

The API

The JSON this site's own pages read, written down so an extension or a tool can read it too. Updated with the site; the changes list at the bottom says what moved and when.

The ground rules

An item

Every route that answers with items uses the same record. The first block is the catalogue's own; the second is worked out per request and says what the wardrobe's chip should say.

FieldTypeMeaning
namestringThe item's name as the sheet spells it.
filestringThe SWF path under the game's item tree, forward slashes, no leading slash: items/helms/DragonHelm.swf. The one name the catalogue, the renders and the share links agree on; use it as the key.
slotstringOne of armor, helm, cape, weapon, pet, ground. Hairs, locks and visages are helm.
kindstring"hair" for a hair, else "".
wtypestringOn a weapon, the type the sheet declares: one of Sword, Dagger, Gauntlet, Staff, Gun, Mace, Polearm, Scythe, Wand, Bow, Whip. Empty or absent when the sheet does not say; the file's folder is then the best guess.
memberbooleanMembers only.
acbooleanSold for AdventureCoins.
raritystringThe rarity word, for example Rare, Awesome, Pseudo-Rare, or "".
idstringThe community sheet's id, or "" for an item the site learned from a character before the sheet had it.
ccbooleanColour custom: the item takes the player's base, trim and accent colours.
linkstringThe SWF's linkage class, when known. Usually absent; the renderer works it out.
chipWordstringWhat the card's chip says, which is not always the rarity word: an item gated by a wiki tag says the gate.
rarityStatestringCan it be had: in-game, seasonal, rare, unobtainable or unknown.
rarityNotestringA sentence for the tooltip.
seasonalbooleanComes back at a time of year; separate from the state, since a Mogloween item in October is both available and seasonal.
whenstringThe month it comes back, like October, or "".
awaynumber or nullHow many months off that is.
ownedbooleanOnly for a signed-in person with an imported inventory. Absent otherwise.
ownedInstringBeside owned, where it is: inv, bank, chest (inside a collection chest or collection the person owns, not pulled out yet), house or pet (in the shop of a house item or a pet they own) or badge (a Book of Lore shop one of the person's badges opens).
ownedFromstringWith chest, house, pet or badge, the container's name or the badge's title.
whystring[]Only from complete the look: why this item was suggested. See that route.

Extra fields may appear over time; read the ones you need and ignore the rest.

Items

GET /api/items/search

The wardrobe's search box. q is the box as typed, operators and all (slot:helm, rarity:rare, is:ingame, ac:no, -word, "exact phrase", a or b); the wardrobe's help button lists them. slot narrows to one slot, limit (default 25) and offset page, sort is name, new, rarity or availability, and browse=1 asks for the catalogue with nothing typed.

Answers { ready, total, offset, count, folded, note, results }: results is a page of items, total how many matched, count how many items the catalogue holds, folded how many were hidden under a card that shares their art (the card says +N), and note a sentence when something in the query was read differently than typed.

GET /api/items/latest

Newest first: the items people taught the catalogue, then the sheet by id descending (the sheet has no dates). slot, limit (default 40, at most 200), offset. Answers { ready, total, count, ordering, results }.

GET /api/items/thumb/:id.png

A picture of one item, transparent, cropped to the art, cached for a week. :id is the sheet id, or unlisted when the item has none; pass file and slot as well so an item the sheet lacks can still be drawn, and gender=F for the female body. A picture that has to be rendered fresh counts against the thumbnail allowance; one already drawn does not.

GET /api/items/random

One random item per slot, from whatever q would find. slots (required) is a comma list. Answers { ready, items: { slot: item }, pool: { slot: count } }.

GET /api/items/complete

What would go with what is worn. worn is a comma list of files; slots which empty slots to fill (default: every one not worn); limit per slot (default 8, at most 24); gender=F; sets=1 to allow pieces from the same set as what is worn, which are otherwise left out.

Answers { ready, slots: { slot: [item] }, worn, visual, mode, basis, sets, setsOut, themes }. Each item carries why: worn (people wear it with these), goes (its look and colour match), looks (a plain lookalike, from an older picture service), set:<stem> (same set), theme:<word> (the names share a theme). worn and visual say whether those channels had anything to say; setsOut whether set pieces were held back.

GET /api/items/lookalike

Items that look like some words (q) or like items by sheet id (like, comma list), narrowed by slot and gender, limit at most 48. Answers { ready, results }, or ready: false with a reason while the picture service is cold.

GET /api/items/wanted

Items the game has that the catalogue has no art for. slot, q, limit, offset. Answers { ready, total, results } where each result has a name, a slot and a wiki link but no file.

GET /api/items/hair

The hairs for one body: gender (M or F), limit. Answers { ok, gender, count, results }.

GET /api/items/facts

Everything the site knows about every listed item, keyed by sheet id, gzipped and large: { v, capturedAt, count, facts: { id: { r, s, z, i, ac, m, c } } }. Short keys because seventy thousand rows go over the wire: r rarity word, s state (as rarityState above), z seasonal (0 or 1), i which IoDA reaches it (normal, kb or ""), ac, m member, c colour custom. Fetch it once and keep it; it changes with the catalogue, at most a few times a day.

Characters and closets

GET /api/character?name=

What a character is wearing, read from their character page. Answers { ok, outfit: { name, gender, items: { slot: { name, file, link, slot } }, hair: { name, file }, colors }, learned, unrecorded }, or ok: false with a reason (not-found, unreachable). Looking a character up teaches the catalogue anything new they wear, and counts the outfit towards what people wear together.

GET /api/closets/:who

A closet its owner chose to make public, by display name or id. Answers { ok, id, name, address, sets: [{ id, name, outfit, saved, picture }] } and, when its owner also chose to show them, favourites (items) and favouritesTotal. A closed or unknown closet is 404 with reason private or ambiguous. Each set's outfit is a share query (below) and picture a public PNG.

The share link

An outfit is a query string, and it is what /wardrobe, /compare, a saved set and /api/outfit.png all take:

g=M
armor=Name|classes/M/File.swf|Linkage
helm=Name|items/helms/File.swf
cape=Name|items/capes/File.swf
weapon=Name|items/swords/File.swf|Linkage|Dagger
pet=Name|items/pets/File.swf
ground=Name|items/ground/File.swf
hair=Name|hair/M/File.swf
c_hair=RRGGBB  c_skin=RRGGBB  c_eye=RRGGBB
c_base=RRGGBB  c_trim=RRGGBB  c_accessory=RRGGBB

Each slot is name|file|link, with a fourth part on a weapon when its type is not what the folder says. The linkage part may be empty. g is M or F. Colours are six hex digits, no hash. GET /api/outfit.png?... with the same query draws it as a picture (a render, so the render allowance applies); /wardrobe?... opens it to try on. The picture carries its own link: a PNG tEXt chunk with the keyword AQ Closet outfit holds the share URL, and a GIF holds the same URL in a comment block that begins AQ Closet outfit: . The wardrobe puts the outfit back on when either file is dropped on it. The pixels are not changed by it. The renderer writes the same link into the pictures the Discord bot posts, so those load too.

Housekeeping

Changes

Questions

Something here wrong, or a field you need that is not served? Say so on the report page or write to [email protected].